This is a plugin for homebridge. It allows for management of the Philips Somneo HF3670/60. Additionally, it provides sensor data from the clock.
The Somneo Clock has a small HTTP server running inside with a limited API. Through Googling and trial-and-error, I've found commands that work to replicate the SleepMapper app.
This server is very low powered though and if you see error messages in your logs it's most likely that two connections were trying to be processed at once.
In the physical world, the Somneo clock is a single device. But in the HomeBridge world, it is multiple. For this reason, I've created the concept of Conflicting Accessories.
A Conflicting Accessory means an accessory that needs full control over a physical device. In the case of the Somneo clock, there are two physical devices:
If a program requires light, it will turn off all other devices that require light. If it requires audio it will turn off all that require audio.
Below, is a chart explaining what will be turned off (if on) when an accessory is turned on.
Main Light | Night Light | Sunset Program | RelaxBreathe Program | Audio | |
---|---|---|---|---|---|
Main Light Turns On |
N/A | Turns Off | Turns Off | Turns Off | Unaffected |
Night Light Turns On |
Turns Off | N/A | Turns Off | Turns Off | Unaffected |
Sunset Turns On |
Turns Off | Turns Off | N/A | Turns Off | Turns Off |
RelaxBreathe Turns On |
Turns Off | Turns Off | Turns Off | N/A | Turns Off |
Audio Turns On |
Unaffected | Unaffected | Turns Off | Turns Off | N/A |
Before installing this plugin, you should install Homebridge using the official instructions.
Homebridge Somneo
on the Plugins tab of Config UI X.Homebridge Somneo
plugin and use the form to enter your configuration.sudo npm install -g homebridge-somneo --unsafe-perm
.config.json
manually to add your information. See below for instructions on that.Field | Required | Data Type | Description | Default Value |
---|---|---|---|---|
platform | Yes | string | Must always be set to HomebridgeSomneo . |
N/A |
name | Yes | string | Set the platform name for display in the Homebridge logs. | Homebridge Somneo |
somneos | Yes | object[] | An array of configurations for Somneo clocks | N/A |
pollingSeconds | No | number | Time in seconds for how often to ping the clock. | 30 (30000 milliseconds) |
Field | Required | Data Type | Description | Default Value |
---|---|---|---|---|
name | Yes | string | The name of the clock. It will be used as a prefix for all of the accessories it exposes. | N/A |
host | Yes | string | IP address or hostname of the Somneo clock. | N/A |
sensors | Yes | object | Settings for sensors in the Somneo clock. | N/A |
lights | Yes | object | Settings for lights in the Somneo clock. | N/A |
switches | Yes | object | Settings for switches in the Somneo clock. | N/A |
audio | Yes | object | Settings for the audio device in the Somneo clock. | N/A |
Field | Required | Data Type | Description | Default Value |
---|---|---|---|---|
humidity | Yes | object | Settings for the humidity sensor. | N/A |
lux | Yes | object | Settings for the lux (light) sensor. | N/A |
temperature | Yes | object | Settings for the temperature sensor. | N/A |
Field | Required | Data Type | Description | Default Value |
---|---|---|---|---|
isEnabled | No | boolean | Determines whether or not to expose the humidity sensor. | true |
Field | Required | Data Type | Description | Default Value |
---|---|---|---|---|
isEnabled | No | boolean | Determines whether or not to expose the lux (light) sensor. | true |
Field | Required | Data Type | Description | Default Value |
---|---|---|---|---|
isEnabled | No | boolean | Determines whether or not to expose the temperature sensor. | true |
Field | Required | Data Type | Description | Default Value |
---|---|---|---|---|
mainLight | Yes | object | Settings for the main (dimmable) light. | N/A |
nightLight | Yes | object | Settings for the (on/off) night light. | N/A |
Field | Required | Data Type | Description | Default Value |
---|---|---|---|---|
isEnabled | No | boolean | Determines whether or not to expose the main light. | true |
Field | Required | Data Type | Description | Default Value |
---|---|---|---|---|
isEnabled | No | boolean | Determines whether or not to expose the night light. | true |
Field | Required | Data Type | Description | Default Value |
---|---|---|---|---|
relaxBreathe | Yes | object | Settings for the RelaxBreathe Program switch. | N/A |
sunset | Yes | object | Settings for the Sunset Program switch. | N/A |
Field | Required | Data Type | Description | Default Value |
---|---|---|---|---|
isEnabled | No | boolean | Determines whether or not to expose the RelaxBreathe Program switch. | true |
breathsPerMin | No | number | How many breaths you want to take per minute. | 4 (BPM converted to the Philips value 1) |
duration | No | number | How long the RelaxBreathe Program should run for. | 10 (minutes) |
guidanceType | No | number | What kind of guided RelaxBreathe program to run. Possible values:
|
0 (Light) |
lightIntensity | No | number | How bright the RelaxBreathe Program be at its peak. The value is a percentage that will be converted to a number between 1 and 25 . |
80 (80% converted to the the Philips API value 20) |
volume | No | number | How loud the RelaxBreathe Program should be at its peak. The value is a percentage that will be converted to a number between 1 and 25 . |
48 (48% converted to the the Philips API value 12) |
Field | Required | Data Type | Description | Default Value |
---|---|---|---|---|
isEnabled | No | boolean | Determines whether or not to expose the Sunset Program switch. | true |
duration | No | number | How long the Sunset Program should run for. | 30 (minutes) |
lightIntensity | No | number | How bright the Sunset Program be at the start. The value is a percentage that will be converted to a number between 1 and 25 . |
80 (80% converted to the the Philips API value 20) |
colorScheme | No | string | What color pattern should play during the Sunset Program. Possible values:
|
'0' (Sunny Day) |
ambientSounds | No | string | What sounds should play during the Sunset Program. Possible values:
|
'1' (Soft Rain) |
volume | No | number | How loud the Sunset Program should be at the start. The value is a percentage that will be converted to a number between 1 and 25 . |
48 (48% converted to the the Philips API value 12) |
Field | Required | Data Type | Description | Default Value |
---|---|---|---|---|
isEnabled | No | boolean | Determines whether or not to expose the Audio Device. | true |
favoriteInput | No | number | Numeric value specifying the input for the Somneo Audio to go to the first time its turned on in a session. After changing the input, the Somneo will go to the last used input. Possible values:
|
1 (FM Preset 1) |
The Somneo clock has 5 FM radio presets and an auxiliary input. To help accomodate this, an audio receiver called Somneo Audio
is available. You can turn in on and it will default to FM Preset 1
. Additionally, you can raise and lower the volume with the Remote widget in iOS/iPadOS's Control Center.
However, due the way that audio receivers are implemented in Homebridge, they must be exposed as an External Plugin. This means that the Somneo Audio
will need to be onboarded separately from the other accessories.
Add Accessory
in the Home app.I Don't Have a Code or Cannot Scan
.Somneo Audio
receiver should show as an option. It should look like:
This configuration will expose all items and use the default polling interval with the least work.
{
"name": "Homebridge Somneo",
"somneos": [
{
"name": "Master Bedroom Somneo",
"host": "[INSERT_IP_ADDRESS_HERE]"
}
],
"platform": "HomebridgeSomneo"
}
This configuration will expose all items with default values, but is very verbose. It is presented here to help visualize the JSON structure.
{
"name": "Homebridge Somneo",
"somneos": [
{
"name": "Master Bedroom Somneo",
"host": "[INSERT_IP_ADDRESS_HERE]",
"sensors": {
"humidity": {
"isEnabled": true
},
"lux": {
"isEnabled": true
},
"temperature": {
"isEnabled": true
}
},
"lights": {
"mainLight": {
"isEnabled": true
},
"nightLight": {
"isEnabled": true
}
},
"switches": {
"relaxBreathe": {
"isEnabled": true,
"breathsPerMin": 4,
"duration": 10,
"guidanceType": 0,
"lightIntensity": 80,
"volume": 48
},
"sunset": {
"isEnabled": true,
"duration": 30,
"lightIntensity": 80,
"colorScheme": 0,
"ambientSounds": "1",
"volume": 48
}
},
"audio": {
"isEnabled": true,
"favoriteInput": 1
}
}
],
"pollingSeconds": 30,
"platform": "HomebridgeSomneo"
}
Thanks to: