Motion sensor and too high lux after light got on and off

Hi,

I’ve made a simple automation where the light goes on as soon as it is dark and it will also extend as long as there is motion. My problem is, however, that if I got right into the motion sensor once the light switches off, it often has still the high lux value from the time the light was still on. This results in the light not being switched on.

I never had this problem when I used the motion and lux sensing directly using the Philips Hue app. Is there a simple way to fix this?

I’ve now watched the lux sensor of the hue motion sensor during the whole process:

  1. As soon as the light goes on, the lux goes up to about 100
  2. when no motion is detected, the light goes off and the lux stays at 100

it will then take a few minutes till it goes down to 1 lux again (during nighttime) if there is no motion detected.
If, however, motion is detected no light goes on as it still sees the old 100lux but then updates immediately the lux to 1.

So the problem is that after the light goes off, that the lux are no updates to the new state. the only update happens if there is new motion detected or after a few minutes.

Is there any way to force a lux update, after the light goes off?

Maybe there is something wrong in my node red flow:

1 Like

has nobody got an idea how to solve the lux problem with motion sensors after the light goes off? I assume Philips has directly solved this in the Hue app as I never had this problem before.

There’s a service available that is designed to force a sensor to update itself. It’s called homeassistant.update_entity.

From the documentation:

I don’t use Node-Red with Home Assistant but I imagine there must be a node that exposes this service. In an automation it would be used like this:

    - service: homeassistant.update_entity
      entity_id: sensor.my_sensor

@123 unfortunately using the homeassistant.update_entity service won’t update the lux of the motion sensor. Maybe this is not possible with the Philips motion sensor. Only if there is motion again, there is an update.

Oh well, it was worth a try.

So this combination motion and light sensor only sends its light measurement when it detects motion? In the interests of conserving the battery (I assume it’s battery-powered?) I guess this is a prudent strategy. However, it impinges on the usefulness of the light sensor.

yes, it was worth a try…would have been fantastic if it really worked. The lux is updated every time there is motion and then every few minutes.

@enigma2k I have recently experienced to HA from Hubitat and SmartThings (with WebCoRE) before that. I only added Hue motion sensors tonight to HA and have encountered the same problem. I am also brand new to node red. How good are your node red skills?
In the old systems, the way I used to over come this problem was create a variable that constantly updated its value when the room light was off and then use that variable to be the set point to trigger on light with motion - the motion sensor lux value was never used directly for the automation. Do you have any ideas how to create variables in node red?

@enigma2k solved it as suggested above - storing lux value when the light isnt on and restricting, in my case, to enabling light below 30. here is my flow (which includes setting light levels via my mode manager):

[{“id”:“6559bb71.86041c”,“type”:“tab”,“label”:“Downstairs Hall”,“disabled”:false,“info”:""},{“id”:“445dfd5b.10b0cc”,“type”:“server-state-changed”,“z”:“6559bb71.86041c”,“name”:“Motion in Downstairs Hall”,“server”:“9ee46d87.3f71d”,“version”:1,“entityidfilter”:“binary_sensor.downstairs_hall_motion”,“entityidfiltertype”:“substring”,“outputinitially”:false,“state_type”:“str”,“haltifstate”:"",“halt_if_type”:“str”,“halt_if_compare”:“is”,“outputs”:1,“output_only_on_state_change”:false,“x”:150,“y”:240,“wires”:[[“80b84482.b924d8”]]},{“id”:“ed9cd1fc.4c0eb8”,“type”:“api-call-service”,“z”:“6559bb71.86041c”,“name”:“ON”,“server”:“9ee46d87.3f71d”,“version”:1,“service_domain”:“light”,“service”:“turn_on”,“entityId”:“light.front_door_light, light.downstairs_hall_light”,“data”:"{“brightness_pct”:80,“kelvin”:3200,“transition”:0.5}",“dataType”:“json”,“mergecontext”:"",“output_location”:“payload”,“output_location_type”:“msg”,“mustacheAltTags”:false,“x”:1580,“y”:20,“wires”:[[]]},{“id”:“9fc76d55.6aa298”,“type”:“switch”,“z”:“6559bb71.86041c”,“name”:“motion on/off?”,“property”:“payload”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“on”,“vt”:“str”},{“t”:“eq”,“v”:“off”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:2,“x”:550,“y”:240,“wires”:[[“c7fca2d8.63f4b8”,“800876de.32f2c8”],[“c7fca2d8.63f4b8”]]},{“id”:“b58d3f04.0dfa3”,“type”:“api-call-service”,“z”:“6559bb71.86041c”,“name”:“OFF”,“server”:“9ee46d87.3f71d”,“version”:1,“service_domain”:“light”,“service”:“turn_off”,“entityId”:“light.downstairs_hall_light, light.front_door_light”,“data”:"",“dataType”:“json”,“mergecontext”:"",“output_location”:“payload”,“output_location_type”:“msg”,“mustacheAltTags”:false,“x”:1100,“y”:380,“wires”:[[]]},{“id”:“800876de.32f2c8”,“type”:“api-current-state”,“z”:“6559bb71.86041c”,“name”:“light on?”,“server”:“9ee46d87.3f71d”,“version”:1,“outputs”:2,“halt_if”:“on”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“override_topic”:false,“entity_id”:“light.front_door_light”,“state_type”:“str”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“blockInputOverrides”:false,“x”:750,“y”:200,“wires”:[[],[“417f9034.57eb”]]},{“id”:“c7fca2d8.63f4b8”,“type”:“stoptimer”,“z”:“6559bb71.86041c”,“duration”:“30”,“units”:“Second”,“payloadtype”:“num”,“payloadval”:“2”,“name”:"",“x”:720,“y”:340,“wires”:[[“d7e76bdc.29722”],[]]},{“id”:“d7e76bdc.29722”,“type”:“api-current-state”,“z”:“6559bb71.86041c”,“name”:“motion on?”,“server”:“9ee46d87.3f71d”,“version”:1,“outputs”:2,“halt_if”:“on”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“override_topic”:false,“entity_id”:“binary_sensor.downstairs_hall_motion_group”,“state_type”:“str”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“blockInputOverrides”:false,“x”:920,“y”:340,“wires”:[[],[“b58d3f04.0dfa3”]]},{“id”:“80b84482.b924d8”,“type”:“api-current-state”,“z”:“6559bb71.86041c”,“name”:“All Away?”,“server”:“9ee46d87.3f71d”,“version”:1,“outputs”:2,“halt_if”:“on”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“override_topic”:false,“entity_id”:“input_boolean.ha_mode_away”,“state_type”:“str”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“blockInputOverrides”:false,“x”:130,“y”:360,“wires”:[[],[“1604543f.e91fd4”]]},{“id”:“1604543f.e91fd4”,“type”:“api-current-state”,“z”:“6559bb71.86041c”,“name”:“Automation enabled?”,“server”:“9ee46d87.3f71d”,“version”:1,“outputs”:2,“halt_if”:“on”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“override_topic”:false,“entity_id”:“input_boolean.downstairs_hall_automation”,“state_type”:“str”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“blockInputOverrides”:false,“x”:350,“y”:360,“wires”:[[“9fc76d55.6aa298”],[]]},{“id”:“ba91281c.25b48”,“type”:“api-current-state”,“z”:“6559bb71.86041c”,“name”:“Evening?”,“server”:“9ee46d87.3f71d”,“version”:1,“outputs”:2,“halt_if”:“on”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“override_topic”:false,“entity_id”:“input_boolean.ha_mode_evening”,“state_type”:“str”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“blockInputOverrides”:false,“x”:1330,“y”:20,“wires”:[[“ed9cd1fc.4c0eb8”],[]]},{“id”:“8aea56c8.8828d”,“type”:“api-current-state”,“z”:“6559bb71.86041c”,“name”:“Midweek?”,“server”:“9ee46d87.3f71d”,“version”:1,“outputs”:2,“halt_if”:“on”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“override_topic”:false,“entity_id”:“input_boolean.ha_mode_midweek”,“state_type”:“str”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“blockInputOverrides”:false,“x”:1340,“y”:80,“wires”:[[“4226c853.47d5e”],[]]},{“id”:“b6df0ab5.698f48”,“type”:“api-current-state”,“z”:“6559bb71.86041c”,“name”:“Midweek morning?”,“server”:“9ee46d87.3f71d”,“version”:1,“outputs”:2,“halt_if”:“on”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“override_topic”:false,“entity_id”:“input_boolean.ha_mode_midweek_morning”,“state_type”:“str”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“blockInputOverrides”:false,“x”:1360,“y”:260,“wires”:[[“48fa699f.08d1a8”],[]]},{“id”:“8004ed84.0ff4e”,“type”:“api-current-state”,“z”:“6559bb71.86041c”,“name”:“Weekend?”,“server”:“9ee46d87.3f71d”,“version”:1,“outputs”:2,“halt_if”:“on”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“override_topic”:false,“entity_id”:“input_boolean.ha_mode_weekend”,“state_type”:“str”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“blockInputOverrides”:false,“x”:1340,“y”:140,“wires”:[[“4226c853.47d5e”],[]]},{“id”:“228c54dd.db0b64”,“type”:“api-current-state”,“z”:“6559bb71.86041c”,“name”:“Weekend morning?”,“server”:“9ee46d87.3f71d”,“version”:1,“outputs”:2,“halt_if”:“on”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“override_topic”:false,“entity_id”:“input_boolean.ha_mode_weekend_morning”,“state_type”:“str”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“blockInputOverrides”:false,“x”:1360,“y”:200,“wires”:[[“4d907a43.7be354”],[]]},{“id”:“4226c853.47d5e”,“type”:“api-call-service”,“z”:“6559bb71.86041c”,“name”:“ON”,“server”:“9ee46d87.3f71d”,“version”:1,“service_domain”:“light”,“service”:“turn_on”,“entityId”:“light.front_door_light, light.downstairs_hall_light”,“data”:"{“brightness_pct”:100,“kelvin”:3200,“transition”:0.5}",“dataType”:“json”,“mergecontext”:"",“output_location”:“payload”,“output_location_type”:“msg”,“mustacheAltTags”:false,“x”:1580,“y”:100,“wires”:[[]]},{“id”:“4d907a43.7be354”,“type”:“api-call-service”,“z”:“6559bb71.86041c”,“name”:“ON”,“server”:“9ee46d87.3f71d”,“version”:1,“service_domain”:“light”,“service”:“turn_on”,“entityId”:“light.downstairs_hall_light, light.front_door_light”,“data”:"{“brightness_pct”:50,“kelvin”:3200,“transition”:0.5}",“dataType”:“json”,“mergecontext”:"",“output_location”:“payload”,“output_location_type”:“msg”,“mustacheAltTags”:false,“x”:1580,“y”:200,“wires”:[[]]},{“id”:“54ae4f06.6a072”,“type”:“api-current-state”,“z”:“6559bb71.86041c”,“name”:“Night??”,“server”:“9ee46d87.3f71d”,“version”:1,“outputs”:2,“halt_if”:“on”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“override_topic”:false,“entity_id”:“input_boolean.ha_mode_night”,“state_type”:“str”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“blockInputOverrides”:false,“x”:1330,“y”:320,“wires”:[[“48fa699f.08d1a8”],[]]},{“id”:“48fa699f.08d1a8”,“type”:“api-call-service”,“z”:“6559bb71.86041c”,“name”:“ON”,“server”:“9ee46d87.3f71d”,“version”:1,“service_domain”:“light”,“service”:“turn_on”,“entityId”:“light.front_door_light, light.downstairs_hall_light”,“data”:"{“brightness_pct”:30,“kelvin”:3200,“transition”:0.5}",“dataType”:“json”,“mergecontext”:"",“output_location”:“payload”,“output_location_type”:“msg”,“mustacheAltTags”:false,“x”:1580,“y”:280,“wires”:[[]]},{“id”:“abba4f40.2eed6”,“type”:“server-state-changed”,“z”:“6559bb71.86041c”,“name”:“Motion in Front Door”,“server”:“9ee46d87.3f71d”,“version”:1,“entityidfilter”:“binary_sensor.front_door_motion”,“entityidfiltertype”:“substring”,“outputinitially”:false,“state_type”:“str”,“haltifstate”:"",“halt_if_type”:“str”,“halt_if_compare”:“is”,“outputs”:1,“output_only_on_state_change”:false,“x”:140,“y”:480,“wires”:[[“80b84482.b924d8”]]},{“id”:“e653647f.66cd88”,“type”:“server-state-changed”,“z”:“6559bb71.86041c”,“name”:“Lux Change?”,“server”:“9ee46d87.3f71d”,“version”:1,“entityidfilter”:“sensor.downstairs_hall_lux”,“entityidfiltertype”:“exact”,“outputinitially”:false,“state_type”:“str”,“haltifstate”:"",“halt_if_type”:“str”,“halt_if_compare”:“is”,“outputs”:1,“output_only_on_state_change”:true,“x”:130,“y”:620,“wires”:[[“398b3cd1.83c6c4”]]},{“id”:“257c1597.0ff8ea”,“type”:“switch”,“z”:“6559bb71.86041c”,“name”:“Lux threshold 30 or less”,“property”:“payload”,“propertyType”:“msg”,“rules”:[{“t”:“lte”,“v”:“30”,“vt”:“num”},{“t”:“else”}],“checkall”:“true”,“repair”:false,“outputs”:2,“x”:810,“y”:620,“wires”:[[“d7d611be.2993a”],[“1c8e0614.12cdda”]]},{“id”:“398b3cd1.83c6c4”,“type”:“api-current-state”,“z”:“6559bb71.86041c”,“name”:“Hall lights on?”,“server”:“9ee46d87.3f71d”,“version”:1,“outputs”:2,“halt_if”:“on”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“override_topic”:false,“entity_id”:“light.downstairs_hall_light”,“state_type”:“str”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“blockInputOverrides”:false,“x”:340,“y”:620,“wires”:[[],[“de0fcd2.7b08a3”]]},{“id”:“de0fcd2.7b08a3”,“type”:“api-current-state”,“z”:“6559bb71.86041c”,“name”:“Get lux level”,“server”:“9ee46d87.3f71d”,“version”:1,“outputs”:1,“halt_if”:"",“halt_if_type”:“str”,“halt_if_compare”:“is”,“override_topic”:false,“entity_id”:“sensor.downstairs_hall_lux”,“state_type”:“num”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“blockInputOverrides”:false,“x”:550,“y”:620,“wires”:[[“257c1597.0ff8ea”]]},{“id”:“d7d611be.2993a”,“type”:“change”,“z”:“6559bb71.86041c”,“name”:“Enable light”,“rules”:[{“t”:“set”,“p”:“light_enabled”,“pt”:“flow”,“to”:“yes”,“tot”:“str”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:1030,“y”:580,“wires”:[[]]},{“id”:“1c8e0614.12cdda”,“type”:“change”,“z”:“6559bb71.86041c”,“name”:“Disable light”,“rules”:[{“t”:“set”,“p”:“light_enabled”,“pt”:“flow”,“to”:“no”,“tot”:“str”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:1030,“y”:660,“wires”:[[]]},{“id”:“417f9034.57eb”,“type”:“switch”,“z”:“6559bb71.86041c”,“name”:“Light enabled?”,“property”:“light_enabled”,“propertyType”:“flow”,“rules”:[{“t”:“eq”,“v”:“yes”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:1,“x”:1080,“y”:200,“wires”:[[“ba91281c.25b48”,“8aea56c8.8828d”,“8004ed84.0ff4e”,“228c54dd.db0b64”,“b6df0ab5.698f48”,“54ae4f06.6a072”]]},{“id”:“c50637d.97a50c8”,“type”:“comment”,“z”:“6559bb71.86041c”,“name”:“Note”,“info”:“Store lux values when hall light is off”,“x”:450,“y”:580,“wires”:[]},{“id”:“e617a8b1.d6af58”,“type”:“comment”,“z”:“6559bb71.86041c”,“name”:“Note”,“info”:“Change to whatever max lux value before lights dont come on”,“x”:810,“y”:580,“wires”:[]},{“id”:“9ee46d87.3f71d”,“type”:“server”,“z”:"",“name”:“Home Assistant”,“legacy”:false,“hassio”:true,“rejectUnauthorizedCerts”:true,“ha_boolean”:“y|yes|true|on|home|open”,“connectionDelay”:true}]

If feasible, post a screenshot of the flow.

It’s the bottom flow that captures lux levels and outputs the value of on or off depending on the lux threshold that I’ve set.
The main flow ‘Light enabled?’ Then uses that on/off value to switch on lights or keep them off if over the lux threshold

1 Like

@Townsmcp
Could you please re-post the export of the stream from Node-Red ? what you published is not imported because Node-Red gives the following message:

Parse error on line 1:
TownsmcpJames TSep
^
Expecting ‘STRING’, ‘NUMBER’, ‘NULL’, ‘TRUE’, ‘FALSE’, ‘{’, ‘[’, got ‘undefined’

Thanks in advance !

@andreat sure. Let me know if this works:

[{"id":"47f7d8d3.4386d8","type":"tab","label":"Downstairs Hall","disabled":false,"info":""},{"id":"f0655b54.dc0398","type":"server-state-changed","z":"47f7d8d3.4386d8","name":"Motion in Downstairs Hall","server":"9ee46d87.3f71d","version":1,"entityidfilter":"binary_sensor.downstairs_hall_motion","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":150,"y":320,"wires":[["7055d659.11f8c8"]]},{"id":"565efd6f.edb394","type":"api-call-service","z":"47f7d8d3.4386d8","name":"ON","server":"9ee46d87.3f71d","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.front_door_light, light.downstairs_hall_light","data":"{\"brightness_pct\":60,\"kelvin\":3200,\"transition\":0.1}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1580,"y":100,"wires":[[]]},{"id":"d6d1b57.a06fa48","type":"switch","z":"47f7d8d3.4386d8","name":"motion on/off?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":320,"wires":[["6bab279.cf4f5d8","a6d0bed5.1af8f"],["6bab279.cf4f5d8"]]},{"id":"c1dd2736.1bfbf8","type":"api-call-service","z":"47f7d8d3.4386d8","name":"OFF","server":"9ee46d87.3f71d","version":1,"service_domain":"light","service":"turn_off","entityId":"light.downstairs_hall_light, light.front_door_light","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1630,"y":480,"wires":[[]]},{"id":"a6d0bed5.1af8f","type":"api-current-state","z":"47f7d8d3.4386d8","name":"light on?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.front_door_light","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":750,"y":280,"wires":[[],["61702571.90e02c"]]},{"id":"6bab279.cf4f5d8","type":"stoptimer","z":"47f7d8d3.4386d8","duration":"30","units":"Second","payloadtype":"num","payloadval":"2","name":"","x":720,"y":420,"wires":[["5aae6d6f.34ac34"],[]]},{"id":"5aae6d6f.34ac34","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Downstairs hall motion on?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.downstairs_hall_motion","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":970,"y":420,"wires":[[],["17ab50c2.6393ef"]]},{"id":"7055d659.11f8c8","type":"api-current-state","z":"47f7d8d3.4386d8","name":"All Away?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.ha_mode_away","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":130,"y":440,"wires":[[],["9cdbcb6c.a3eea8"]]},{"id":"9cdbcb6c.a3eea8","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Automation enabled?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.downstairs_hall_automation","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":350,"y":440,"wires":[["d6d1b57.a06fa48"],[]]},{"id":"5cd2c561.5c899c","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Evening?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.ha_mode_evening","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1330,"y":100,"wires":[["565efd6f.edb394"],[]]},{"id":"f1017a62.1f2778","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Midweek?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.ha_mode_midweek","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1340,"y":160,"wires":[["5eb305a5.4c5bac"],[]]},{"id":"274d4916.15f436","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Midweek morning?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.ha_mode_midweek_morning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1360,"y":340,"wires":[["b1453c4a.55539"],[]]},{"id":"2e9113f2.8c063c","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Weekend?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.ha_mode_weekend","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1340,"y":220,"wires":[["5eb305a5.4c5bac"],[]]},{"id":"a277d757.b49ac8","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Weekend morning?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.ha_mode_weekend_morning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1360,"y":280,"wires":[["22be63bd.d2e00c"],[]]},{"id":"5eb305a5.4c5bac","type":"api-call-service","z":"47f7d8d3.4386d8","name":"ON","server":"9ee46d87.3f71d","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.front_door_light, light.downstairs_hall_light","data":"{\"brightness_pct\":100,\"kelvin\":3200,\"transition\":0.1}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1580,"y":180,"wires":[[]]},{"id":"22be63bd.d2e00c","type":"api-call-service","z":"47f7d8d3.4386d8","name":"ON","server":"9ee46d87.3f71d","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.downstairs_hall_light, light.front_door_light","data":"{\"brightness_pct\":50,\"kelvin\":3200,\"transition\":0.1}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1580,"y":280,"wires":[[]]},{"id":"b6f85996.330aa8","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Night??","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.ha_mode_night","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1330,"y":400,"wires":[["b1453c4a.55539"],[]]},{"id":"b1453c4a.55539","type":"api-call-service","z":"47f7d8d3.4386d8","name":"ON","server":"9ee46d87.3f71d","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.front_door_light, light.downstairs_hall_light","data":"{\"brightness_pct\":10,\"kelvin\":3200,\"transition\":0.1}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1580,"y":360,"wires":[[]]},{"id":"8356070a.536c38","type":"server-state-changed","z":"47f7d8d3.4386d8","name":"Motion in Front Door","server":"9ee46d87.3f71d","version":1,"entityidfilter":"binary_sensor.front_door_motion","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":140,"y":560,"wires":[["7055d659.11f8c8"]]},{"id":"81fa5568.50f3b8","type":"server-state-changed","z":"47f7d8d3.4386d8","name":"Lux Change?","server":"9ee46d87.3f71d","version":1,"entityidfilter":"sensor.downstairs_hall_lux","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":110,"y":700,"wires":[["d033392f.5fd908"]]},{"id":"c651498a.33e3d8","type":"switch","z":"47f7d8d3.4386d8","name":"Lux threshold 30 or less","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"30","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":990,"y":700,"wires":[["e2b68285.bed01"],["3bbfe353.7c40bc"]]},{"id":"d033392f.5fd908","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Hall lights on?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.downstairs_hall_light","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":300,"y":700,"wires":[[],["e98f7071.f80f1"]]},{"id":"705528cc.fe51a8","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Get lux level","server":"9ee46d87.3f71d","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.downstairs_hall_lux","state_type":"num","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":730,"y":700,"wires":[["c651498a.33e3d8"]]},{"id":"e2b68285.bed01","type":"change","z":"47f7d8d3.4386d8","name":"Enable light","rules":[{"t":"set","p":"light_enabled","pt":"flow","to":"yes","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":660,"wires":[[]]},{"id":"3bbfe353.7c40bc","type":"change","z":"47f7d8d3.4386d8","name":"Disable light","rules":[{"t":"set","p":"light_enabled","pt":"flow","to":"no","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":740,"wires":[[]]},{"id":"61702571.90e02c","type":"switch","z":"47f7d8d3.4386d8","name":"Light enabled?","property":"light_enabled","propertyType":"flow","rules":[{"t":"eq","v":"yes","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1040,"y":280,"wires":[["5cd2c561.5c899c","f1017a62.1f2778","2e9113f2.8c063c","a277d757.b49ac8","274d4916.15f436","b6f85996.330aa8"]]},{"id":"209b10f5.895c4","type":"comment","z":"47f7d8d3.4386d8","name":"Note","info":"Store lux values when hall light is off","x":450,"y":660,"wires":[]},{"id":"ec5fa9f.4f19c58","type":"comment","z":"47f7d8d3.4386d8","name":"Note","info":"Change to whatever max lux value before lights dont come on","x":990,"y":660,"wires":[]},{"id":"17ab50c2.6393ef","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Front door motion on?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.front_door_motion","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1180,"y":480,"wires":[[],["8c36470d.3e6398"]]},{"id":"e98f7071.f80f1","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Front door lights on?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.front_door_light","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":520,"y":700,"wires":[[],["705528cc.fe51a8"]]},{"id":"8c36470d.3e6398","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Automation enabled?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.downstairs_hall_automation","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1420,"y":480,"wires":[["c1dd2736.1bfbf8"],[]]},{"id":"9ee46d87.3f71d","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

Yes, so it is imported correctly.
Thank you very much !
:+1:

1 Like

Hi all,
I just thought I would update this thread with my latest flow. This flow also averages out lux level from multiple sensors. My sensors are Philips Hue. Im using Hue Magic in Node Red to get the quickest possible readings from the sensors.

Prerequisites:

  • Hue Magic palette installed and configured (not strictly required if your using HA native Hue integration however there will be a delay between the sensor changing and those values being fed back to HA - Hue Magic is virtually instant.
  • Node Red Companion Component installed in HACS and then the integration enabled.

Once the ‘Entity Node’ is added to Node Red, a restart of Node Red is required. This is because Node Red then creates the new entity in HA.

This workflow creates an average lux value between all Hue motion sensors. The average lux is then stored to a variable. The variable only updates the new average sensor when all lights are off (this catches the age old problem of low lux, light comes on, lux value goes up, lights go off because lux is to high).
On motion, the workflow steps through its normal process of making sure the flow should turn on lights if the average of all lux sensors is below the threshold.

[{"id":"47f7d8d3.4386d8","type":"tab","label":"Downstairs Hall","disabled":false,"info":""},{"id":"f4802a18.263ca8","type":"comment","z":"47f7d8d3.4386d8","name":"Front Door Lux","info":"Store lux values when hall light is off","x":160,"y":700,"wires":[]},{"id":"f2c7b46c.b9daa8","type":"comment","z":"47f7d8d3.4386d8","name":"Turn off automation","info":"","x":250,"y":440,"wires":[]},{"id":"7a5c79f4.dc31f8","type":"server-state-changed","z":"47f7d8d3.4386d8","name":"Downstairs hall automation off","server":"9ee46d87.3f71d","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.downstairs_hall_automation","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"off","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":280,"y":480,"wires":[["816ce214.6d6ad"],[]]},{"id":"816ce214.6d6ad","type":"change","z":"47f7d8d3.4386d8","name":"Stop timer","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"reset","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":480,"wires":[["743f811e.aa8f"]]},{"id":"743f811e.aa8f","type":"link out","z":"47f7d8d3.4386d8","name":"Cancel Timer","links":["ffb00bfc.08da28","2ea7789b.b69f2"],"x":715,"y":480,"wires":[]},{"id":"5a8b0b60.559ab4","type":"comment","z":"47f7d8d3.4386d8","name":"Turn on automation","info":"","x":250,"y":540,"wires":[]},{"id":"661dca91.ec9164","type":"server-state-changed","z":"47f7d8d3.4386d8","name":"Downstairs hall automation on","server":"9ee46d87.3f71d","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.downstairs_hall_automation","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":280,"y":580,"wires":[["67a984b7.170ccc"],[]]},{"id":"67a984b7.170ccc","type":"link out","z":"47f7d8d3.4386d8","name":"Resume timer","links":["ffb00bfc.08da28","2ea7789b.b69f2","d48a7fa7.972"],"x":495,"y":580,"wires":[]},{"id":"19f6983d.eb356","type":"api-current-state","z":"47f7d8d3.4386d8","name":"light on?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.downstairs_hall_lights","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1120,"y":200,"wires":[[],["8385cec7.df26c"]]},{"id":"517c4afd.4d4c94","type":"api-current-state","z":"47f7d8d3.4386d8","name":"All Away?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.ha_mode_away","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":720,"y":200,"wires":[[],["96433344.43d7d8"]]},{"id":"96433344.43d7d8","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Automation enabled?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.downstairs_hall_automation","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":920,"y":200,"wires":[["19f6983d.eb356"],[]]},{"id":"2f9a2c23.81220c","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Automation enabled?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.downstairs_hall_automation","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1580,"y":460,"wires":[["f89d452a.b4a1b"],[]]},{"id":"fc1e6d9a.dd4ff8","type":"hue-motion","z":"47f7d8d3.4386d8","name":"Front Door Motion Sensor","bridge":"e81e9b.75df5168","sensorid":"116","skipevents":false,"x":270,"y":240,"wires":[["d5ae3276.9866e"]]},{"id":"d5ae3276.9866e","type":"change","z":"47f7d8d3.4386d8","name":"Motion","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.motion","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":300,"wires":[["ab6258cc.3d8448"]]},{"id":"ab6258cc.3d8448","type":"function","z":"47f7d8d3.4386d8","name":"Motion","func":"switch (msg.payload)\n{\n    case false:\n        msg.payload = \"OFF\";\n        break;\n    case true:\n        msg.payload = \"ON\";\n        break;\n    default:\n    break;\n}\nreturn msg;","outputs":1,"noerr":0,"x":560,"y":300,"wires":[["517c4afd.4d4c94","ed8d7089.c4f96"]]},{"id":"ed8d7089.c4f96","type":"trigger","z":"47f7d8d3.4386d8","op1":"","op2":"off","op1type":"nul","op2type":"str","duration":"30","extend":false,"units":"s","reset":"ON","bytopic":"all","name":"","x":730,"y":340,"wires":[["2f9a2c23.81220c"]]},{"id":"5c0c4f63.8b4cb8","type":"hue-bridge-node","z":"47f7d8d3.4386d8","name":"","bridge":"e81e9b.75df5168","autoupdates":true,"x":140,"y":180,"wires":[["fc1e6d9a.dd4ff8"]]},{"id":"b042e490.e6892","type":"hue-motion","z":"47f7d8d3.4386d8","name":"Downstairs Hall Morion Sensor","bridge":"e81e9b.75df5168","sensorid":"119","skipevents":false,"x":290,"y":360,"wires":[["d5ae3276.9866e"]]},{"id":"823173b7.27b67","type":"api-call-service","z":"47f7d8d3.4386d8","name":"ON","server":"9ee46d87.3f71d","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.downstairs_hall_lights","data":"{\"brightness_pct\":60,\"kelvin\":3200,\"transition\":0.1}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1790,"y":60,"wires":[[]]},{"id":"f2b15aa3.377d08","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Evening?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.ha_mode_evening","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1540,"y":60,"wires":[["823173b7.27b67"],[]]},{"id":"65a19ae5.e74a54","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Midweek?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.ha_mode_midweek","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1550,"y":120,"wires":[["91607cff.b855a8"],[]]},{"id":"c85452d1.3cad8","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Midweek morning?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.ha_mode_midweek_morning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1570,"y":300,"wires":[["835c3a10.ce25"],[]]},{"id":"246625ce.3a1302","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Weekend?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.ha_mode_weekend","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1550,"y":180,"wires":[["91607cff.b855a8"],[]]},{"id":"8ef95740.c9056","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Weekend morning?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.ha_mode_weekend_morning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1570,"y":240,"wires":[["e29d6c76.7b0b88"],[]]},{"id":"91607cff.b855a8","type":"api-call-service","z":"47f7d8d3.4386d8","name":"ON","server":"9ee46d87.3f71d","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.downstairs_hall_lights","data":"{\"brightness_pct\":100,\"kelvin\":3200,\"transition\":0.1}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1790,"y":140,"wires":[[]]},{"id":"e29d6c76.7b0b88","type":"api-call-service","z":"47f7d8d3.4386d8","name":"ON","server":"9ee46d87.3f71d","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.downstairs_hall_lights","data":"{\"brightness_pct\":50,\"kelvin\":3200,\"transition\":0.1}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1790,"y":240,"wires":[[]]},{"id":"aa889a4e.d6b8","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Night??","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.ha_mode_night","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1540,"y":360,"wires":[["835c3a10.ce25"],[]]},{"id":"835c3a10.ce25","type":"api-call-service","z":"47f7d8d3.4386d8","name":"ON","server":"9ee46d87.3f71d","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.downstairs_hall_lights","data":"{\"brightness_pct\":10,\"kelvin\":3200,\"transition\":0.1}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1790,"y":320,"wires":[[]]},{"id":"f89d452a.b4a1b","type":"api-call-service","z":"47f7d8d3.4386d8","name":"OFF","server":"9ee46d87.3f71d","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.downstairs_hall_lights","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1790,"y":460,"wires":[[]]},{"id":"2ea7789b.b69f2","type":"link in","z":"47f7d8d3.4386d8","name":"Downstairs hall continued","links":["67a984b7.170ccc","743f811e.aa8f"],"x":606,"y":380,"wires":[["ed8d7089.c4f96"]]},{"id":"8926c811.c4378","type":"change","z":"47f7d8d3.4386d8","name":"Set lux variable","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.lux","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":740,"wires":[["69a2a435.b929e4"]]},{"id":"add50a7.89cb0f8","type":"hue-brightness","z":"47f7d8d3.4386d8","name":"Front Door","bridge":"e81e9b.75df5168","sensorid":"117","skipevents":false,"x":140,"y":740,"wires":[["8926c811.c4378"]]},{"id":"998026d4.d93298","type":"api-current-state","z":"47f7d8d3.4386d8","name":"Hall lights off?","server":"9ee46d87.3f71d","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.downstairs_hall_lights","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":900,"y":800,"wires":[["df9da15e.49c67"],[]]},{"id":"87947e4.30b3f","type":"switch","z":"47f7d8d3.4386d8","name":"Lux threshold 30 or less","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"30","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1670,"y":800,"wires":[["545316f.dc4c268"],["d6fc1a7.89ddae8"]]},{"id":"545316f.dc4c268","type":"change","z":"47f7d8d3.4386d8","name":"Enable light","rules":[{"t":"set","p":"light_enabled","pt":"flow","to":"yes","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1890,"y":780,"wires":[["fe139faa.e5d838"]]},{"id":"d6fc1a7.89ddae8","type":"change","z":"47f7d8d3.4386d8","name":"Disable light","rules":[{"t":"set","p":"light_enabled","pt":"flow","to":"no","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1890,"y":820,"wires":[["a0e2887b.f59c28"]]},{"id":"fe139faa.e5d838","type":"debug","z":"47f7d8d3.4386d8","name":"Enable Light","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":2080,"y":780,"wires":[]},{"id":"a0e2887b.f59c28","type":"debug","z":"47f7d8d3.4386d8","name":"Disable light","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":2082,"y":820,"wires":[]},{"id":"8385cec7.df26c","type":"switch","z":"47f7d8d3.4386d8","name":"Light enabled?","property":"light_enabled","propertyType":"flow","rules":[{"t":"eq","v":"yes","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1300,"y":200,"wires":[["f2b15aa3.377d08","65a19ae5.e74a54","246625ce.3a1302","8ef95740.c9056","c85452d1.3cad8","aa889a4e.d6b8"]]},{"id":"320ef1a1.5d188e","type":"comment","z":"47f7d8d3.4386d8","name":"Downstairs Hall Lux","info":"Store lux values when hall light is off","x":170,"y":820,"wires":[]},{"id":"e0059f.49a4426","type":"change","z":"47f7d8d3.4386d8","name":"Set lux variable","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.lux","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":860,"wires":[["69a2a435.b929e4"]]},{"id":"bdfc4ae9.9538b","type":"hue-brightness","z":"47f7d8d3.4386d8","name":"D Hall","bridge":"e81e9b.75df5168","sensorid":"120","skipevents":false,"x":130,"y":860,"wires":[["e0059f.49a4426"]]},{"id":"69a2a435.b929e4","type":"smooth","z":"47f7d8d3.4386d8","name":"average","property":"payload","action":"mean","count":"2","round":"1","mult":"single","reduce":false,"x":480,"y":800,"wires":[["57faa830.c8753"]]},{"id":"57faa830.c8753","type":"change","z":"47f7d8d3.4386d8","name":"Set average variable","rules":[{"t":"set","p":"dhaverage","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":800,"wires":[["998026d4.d93298"]]},{"id":"df9da15e.49c67","type":"change","z":"47f7d8d3.4386d8","name":"Payload back to variable","rules":[{"t":"set","p":"payload","pt":"msg","to":"dhaverage","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1130,"y":800,"wires":[["6c6d12a6.86a514"]]},{"id":"6c6d12a6.86a514","type":"ha-entity","z":"47f7d8d3.4386d8","name":"Downstairs Hall Average","server":"9ee46d87.3f71d","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"downstairs_hall_average"},{"property":"device_class","value":""},{"property":"icon","value":"weather-sunny"},{"property":"unit_of_measurement","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1390,"y":800,"wires":[["87947e4.30b3f"]]},{"id":"9ee46d87.3f71d","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true},{"id":"e81e9b.75df5168","type":"hue-bridge","z":"","name":"Philips hue","bridge":"192.168.1.5","key":"bzebqVHBEwYSOrxKTGL1Rk2rdHI3O3r3hsatCvJF","interval":"500","disableupdates":false}]
1 Like

I have no bridge so this approach will not work here I guess?

Adapt it to fit what you have installed. I’ve recently switched from Hue Bridge to ZHA as I wanted local push instead of polling devices

Interesting, I’ve been using deCONZ this is whole time, will need to investigate the differences.

I actually swapped from Hue Bridge, to DeConz for a few days but kept getting issues (when a device would loose connection, adding the device again would loose its name/settings etc and need rebuilding). Then I went over to ZHA which so far is working much better
In NR, replace the Hue Magic nodes with State Node

I am going to try this right now, hopefully the transition won’t be too hard, really nice it also works on the conbee 2 stick :smiley: