Philips Hue V2 – Dusk Sensor switches changing to OFF shortly after Domoticz restart
Domoticz version: 2026.4.18387
Operating system: Windows 10
Hardware: Three separate Philips Hue V2 bridges, serving three properties (identified below as 12, 38 and 46).
I am experiencing an issue in which the Domoticz Dusk Sensor devices associated with Hue motion sensors change to OFF shortly after Domoticz starts, despite the corresponding light-level readings indicating darkness.
What happens
Immediately following a Domoticz restart, all the Dusk Sensor switches initially show the correct state (ON).
However, approximately 10–11 minutes after startup, they change to OFF. The associated Hue light-level devices continue to report readings, often 0 lux, and the motion and temperature devices also appear to continue updating normally.
This affects all three Hue V2 bridges, and therefore does not appear to be isolated to one bridge or one sensor.
Reproducing the behaviour
I monitored the devices following a restart on 16 November 2026.
Domoticz restart completed at 17:10:21. All Dusk Sensor switches initially showed ON.
The subsequent OFF transitions were recorded as follows:
Property / sensor Time changed to OFF
38 – Study 17:20:27
38 – Cloakroom 17:21:05
38 – Passageway 17:21:05
38 – Patio 17:21:05
46 – Conservatory 17:21:18
12 – Bedroom 17:21:18
12 – Dining Room 17:21:18
12 – Conservatory 17:21:18
The Study sensor’s earlier transition may have been influenced by movement while I was working in that room. The other seven transitions occurred within approximately 13 seconds of one another.
The light-level readings continued to update, and the sensors were reporting very low or zero lux. Nevertheless, the Dusk Sensor switches remained OFF.
Further information
* There are three independent Hue V2 bridges, at properties 12, 38 and 46.
* The affected sensors include a mixture of Hue hardware types SML001, SML002 and SML003.
* All three Hue hardware entries use the same default polling interval (10 seconds).
* The issue appears to have started around 11 November 2026.
* A number of Hue motion sensors were also recreated with new Domoticz device IDs following a restart. This occurred across the bridges, but I do not know whether it is related.
* Other Hue sensor functions, including motion, temperature and light-level reporting, appear to be working.
* The Dusk Sensor devices are the switch functions associated with the Hue motion sensors, not separately created virtual switches.
The relevant Domoticz log entries show the Dusk Sensor and light-level devices being updated at the times above. There are no obvious errors in the excerpt I have examined. The log lines confirm the updates, but do not themselves show the resulting ON/OFF values; these were observed in the Domoticz device list.
Questions
1. Is the Dusk Sensor function supported and updated correctly when using the Philips Hue V2 integration?
2. Does Domoticz obtain the dusk/daylight state from a separate Hue API attribute, or is it derived from the reported light level?
3. Could a periodic V2 resynchronisation or event-stream update be causing the Dusk Sensor switches to be reset to OFF, even though the light-level readings continue to indicate darkness?
4. Is this a known issue in 2026.4, or is there any additional logging I could enable to identify what is changing the switch state?
I have not made any changes to the Hue bridges, sensors or existing Domoticz automations, as I would prefer to establish the cause before altering a working installation.
Any advice or suggestions would be appreciated.
Philips Hue V2 – Dusk Sensor switches changing to OFF after restart
Moderators: leecollings, remb0
Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.
Use the following template when posting here:
Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....
If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly
If you are replying, please do not quote images/code from the first post
Please mark your topic as Solved when the problem is solved.
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.
Use the following template when posting here:
Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....
If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly
If you are replying, please do not quote images/code from the first post
Please mark your topic as Solved when the problem is solved.
-
mikedavies1953
- Posts: 12
- Joined: Thursday 09 January 2020 19:24
- Target OS: Windows
- Domoticz version:
- Contact:
Philips Hue V2 – Dusk Sensor switches changing to OFF after restart
- Attachments
-
- Event System Event Log 2026-11-16.txt
- (9.46 KiB) Downloaded 8 times
-
mikedavies1953
- Posts: 12
- Joined: Thursday 09 January 2020 19:24
- Target OS: Windows
- Domoticz version:
- Contact:
Re: Philips Hue V2 – Dusk Sensor switches changing to OFF after restart
## Update: Investigation of Hue V2 Dusk Sensor behaviour — Domoticz 2026.4
Following my original report, I have investigated the Philips Hue V2 API directly and examined the Domoticz 2026.4 source code (release commit `cc668a1`).
I believe I have identified a likely explanation for the Dusk Sensor switches changing to OFF approximately ten minutes after a Domoticz restart.
### 1. What the Hue V2 API actually returns
I queried the property 12 Hue V2 bridge directly using its authenticated API:
`GET /clip/v2/resource/light_level`
The response for each of the three motion sensors included:
- `light_level`
- `light_level_valid`
- `light_level_report`
However, none of the responses contained a `dark` property.
The Conservatory sensor, for example, returned a valid light-level resource with `light_level_valid: true`, but no `dark` field.
The corresponding device resources identify all three as Hue SML003 motion sensors.
### 2. What the Domoticz source code does
I examined the following files at the 2026.4 release commit:
**PhilipsHueV2Sensors.h**
The `HueV2LightLevel` structure initialises:
`bool dark = false;`
**PhilipsHueV2Sensors.cpp**
In `parseLightLevelJson()`, Domoticz reads the `dark` field only if it exists:
`if (light.isMember("dark"))`
` ll.dark = light["dark"].asBool();`
If the Hue response does not contain that field, `dark` therefore remains false.
**PhilipsHue.cpp**
In `GetV2Sensors()`, Domoticz then uses that value directly:
`InsertUpdateSwitch(nodeID, 1, STYPE_Dusk, ll.dark, darkName, llBattery);`
The lux reading is converted and sent separately using `SendLuxSensor()`.
Consequently, a valid light-level reading can coexist with a Dusk Sensor switch being set to OFF.
### 3. The ten-minute resynchronisation
The `Do_Work()` function in `PhilipsHue.cpp` contains:
`if (m_use_v2_sensors && m_v2sensors && sec_counter % 600 == 0)`
This calls `GetV2Sensors()` every 600 seconds.
That is exactly ten minutes.
This appears to match my observations on 16 November:
- Following a Domoticz restart, the Dusk Sensor switches initially showed ON.
- Approximately ten minutes later, they changed to OFF.
- Seven of the eight sensors changed within a 13-second period.
- Lux readings continued to update.
The SSE real-time event handler, `HandleSSELightLevel()`, also initialises `dark` to false and only changes it if the incoming event contains a `dark` property. It then uses that value to update the Dusk Sensor switch.
### 4. Extent of the problem
The problem affects all eight Hue motion sensors across three independent V2 bridges (properties 12, 38 and 46).
The sensors continue to report light levels, including zero lux in darkness. Motion and temperature reporting also continue to work.
The Dusk Sensor switches nevertheless remain OFF.
I have temporarily changed my automations to use light-level readings instead.
### 5. Questions for the developers
Could someone familiar with the Philips Hue V2 implementation please clarify:
1. Is the `dark` property expected to be supplied by the Hue V2 `light_level` resource, or should Domoticz calculate darkness from the light-level reading?
2. If the property is optional or absent, should Domoticz really default it to false and set the Dusk Sensor switch OFF?
3. Is the ten-minute resynchronisation expected to overwrite the existing Dusk Sensor state in this way?
4. Why do the switches initially show ON after a Domoticz restart, before changing to OFF at the first ten-minute resynchronisation?
I appreciate that the initial ON state may involve a separate update path, which I have not yet fully traced.
**My suspicion is that Domoticz is creating and maintaining Dusk Sensor devices for Hue V2 light-level resources, but is not handling the absence of the `dark` property correctly.**
Relevant source files:
- `hardware/PhilipsHue/PhilipsHueV2Sensors.h`
- `hardware/PhilipsHue/PhilipsHueV2Sensors.cpp`
- `hardware/PhilipsHue/PhilipsHue.cpp`
All examined at release commit `cc668a1` (Domoticz 2026.4).
Following my original report, I have investigated the Philips Hue V2 API directly and examined the Domoticz 2026.4 source code (release commit `cc668a1`).
I believe I have identified a likely explanation for the Dusk Sensor switches changing to OFF approximately ten minutes after a Domoticz restart.
### 1. What the Hue V2 API actually returns
I queried the property 12 Hue V2 bridge directly using its authenticated API:
`GET /clip/v2/resource/light_level`
The response for each of the three motion sensors included:
- `light_level`
- `light_level_valid`
- `light_level_report`
However, none of the responses contained a `dark` property.
The Conservatory sensor, for example, returned a valid light-level resource with `light_level_valid: true`, but no `dark` field.
The corresponding device resources identify all three as Hue SML003 motion sensors.
### 2. What the Domoticz source code does
I examined the following files at the 2026.4 release commit:
**PhilipsHueV2Sensors.h**
The `HueV2LightLevel` structure initialises:
`bool dark = false;`
**PhilipsHueV2Sensors.cpp**
In `parseLightLevelJson()`, Domoticz reads the `dark` field only if it exists:
`if (light.isMember("dark"))`
` ll.dark = light["dark"].asBool();`
If the Hue response does not contain that field, `dark` therefore remains false.
**PhilipsHue.cpp**
In `GetV2Sensors()`, Domoticz then uses that value directly:
`InsertUpdateSwitch(nodeID, 1, STYPE_Dusk, ll.dark, darkName, llBattery);`
The lux reading is converted and sent separately using `SendLuxSensor()`.
Consequently, a valid light-level reading can coexist with a Dusk Sensor switch being set to OFF.
### 3. The ten-minute resynchronisation
The `Do_Work()` function in `PhilipsHue.cpp` contains:
`if (m_use_v2_sensors && m_v2sensors && sec_counter % 600 == 0)`
This calls `GetV2Sensors()` every 600 seconds.
That is exactly ten minutes.
This appears to match my observations on 16 November:
- Following a Domoticz restart, the Dusk Sensor switches initially showed ON.
- Approximately ten minutes later, they changed to OFF.
- Seven of the eight sensors changed within a 13-second period.
- Lux readings continued to update.
The SSE real-time event handler, `HandleSSELightLevel()`, also initialises `dark` to false and only changes it if the incoming event contains a `dark` property. It then uses that value to update the Dusk Sensor switch.
### 4. Extent of the problem
The problem affects all eight Hue motion sensors across three independent V2 bridges (properties 12, 38 and 46).
The sensors continue to report light levels, including zero lux in darkness. Motion and temperature reporting also continue to work.
The Dusk Sensor switches nevertheless remain OFF.
I have temporarily changed my automations to use light-level readings instead.
### 5. Questions for the developers
Could someone familiar with the Philips Hue V2 implementation please clarify:
1. Is the `dark` property expected to be supplied by the Hue V2 `light_level` resource, or should Domoticz calculate darkness from the light-level reading?
2. If the property is optional or absent, should Domoticz really default it to false and set the Dusk Sensor switch OFF?
3. Is the ten-minute resynchronisation expected to overwrite the existing Dusk Sensor state in this way?
4. Why do the switches initially show ON after a Domoticz restart, before changing to OFF at the first ten-minute resynchronisation?
I appreciate that the initial ON state may involve a separate update path, which I have not yet fully traced.
**My suspicion is that Domoticz is creating and maintaining Dusk Sensor devices for Hue V2 light-level resources, but is not handling the absence of the `dark` property correctly.**
Relevant source files:
- `hardware/PhilipsHue/PhilipsHueV2Sensors.h`
- `hardware/PhilipsHue/PhilipsHueV2Sensors.cpp`
- `hardware/PhilipsHue/PhilipsHue.cpp`
All examined at release commit `cc668a1` (Domoticz 2026.4).