Problem with suddenly turn off the lights (HUE Motion Sensor)

Hi there,

Hi there,

I have a very painful problem with my light configuration.

As you can see in the follwing picture an flow json I configured my kitchen light with a hue motion sensor an a stop timer.

Unfortunately I cannot avoid the lights turning off although I am in the kitchen and I am moving.

What I can see is when the hue motion sensor is switching to "no motion" in case I am really moving any more. But for this I thought I connected both cases (true & false) to restart the stoptimer.

Do you see a problem here which I do not see?

Thank you!

Greets from germany
Daniel

[{"id":"b9bd4b27.84783","type":"hue-motion","z":"aeb20ff2.63de98","name":"Küche","bridge":"25f6fec6.ecf4b2","sensorid":"29","skipevents":false,"x":90,"y":120,"wires":[["f6e9ddbd.a3d948"]]},{"id":"f6e9ddbd.a3d948","type":"function","z":"aeb20ff2.63de98","name":"","func":"msg.payload = msg.payload.motion;\nreturn msg;","outputs":1,"noerr":0,"x":210,"y":120,"wires":[["d98adbf6.147d68"]]},{"id":"d98adbf6.147d68","type":"switch","z":"aeb20ff2.63de98","name":"true - false","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":350,"y":120,"wires":[["7fd4eba8.d33a34","56095985.f81e88"],["56095985.f81e88"]]},{"id":"7fd4eba8.d33a34","type":"api-current-state","z":"aeb20ff2.63de98","name":"15lx","server":"bf7fb19a.bb8b","version":1,"outputs":2,"halt_if":"15","halt_if_type":"num","halt_if_compare":"lt","override_topic":false,"entity_id":"sensor.kuche_light_level","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":530,"y":60,"wires":[["ab709bfc.efc3f8"],[]]},{"id":"ab709bfc.efc3f8","type":"api-current-state","z":"aeb20ff2.63de98","name":"Licht Wohnzimmer","server":"bf7fb19a.bb8b","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.wohnzimmer","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":690,"y":60,"wires":[["f63fc2c5.1b9a1"],["5e216e9b.3b7fe8"]]},{"id":"ffaab7b4.9fb3a","type":"api-current-state","z":"aeb20ff2.63de98","name":"Bewegung Küche","server":"bf7fb19a.bb8b","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.motion_kuche","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":690,"y":180,"wires":[["8ec32ff5.6f22e8"]]},{"id":"56095985.f81e88","type":"stoptimer","z":"aeb20ff2.63de98","duration":"120","units":"Second","payloadtype":"num","payloadval":"0","name":"120s","x":530,"y":180,"wires":[["ffaab7b4.9fb3a"],[]]},{"id":"8ec32ff5.6f22e8","type":"switch","z":"aeb20ff2.63de98","name":"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":860,"y":180,"wires":[[],["c5ed160a.116dd8"]]},{"id":"f63fc2c5.1b9a1","type":"api-call-service","z":"aeb20ff2.63de98","name":"Licht Küche 50%","server":"bf7fb19a.bb8b","version":1,"service_domain":"light","service":"turn_on","entityId":"light.kuche","data":"{   \"brightness_pct\": \"50\", \"transition\": \"0\" }","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":910,"y":40,"wires":[[]]},{"id":"5e216e9b.3b7fe8","type":"api-call-service","z":"aeb20ff2.63de98","name":"Licht Küche 25%","server":"bf7fb19a.bb8b","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.kuche","data":"{   \"brightness_pct\": \"25\", \"transition\": \"0\" }","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":910,"y":80,"wires":[[]]},{"id":"c5ed160a.116dd8","type":"api-call-service","z":"aeb20ff2.63de98","name":"Licht Küche aus","server":"bf7fb19a.bb8b","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.kuche","data":"{ \"transition\": \"0\" }","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1020,"y":180,"wires":[[]]},{"id":"25f6fec6.ecf4b2","type":"hue-bridge","z":"","name":"Philips hue","bridge":"192.168.0.101","key":"eYIINc82teCAHU7xgPYQbJ51vC8kb2rboGtWVR4c","interval":"1000","disableupdates":false},{"id":"bf7fb19a.bb8b","type":"server","z":"","name":"Home Assistant"}]

you may be better off using a trigger node set to extend itself if more messages arrive - and then it will turn itself off x secs after last trigger.

1 Like

Do you mean that?

  • Send nothing
  • then wait 120s
  • (extend delay when new message arrives)
  • then send off

yes... or send on... then wait... extend if necessary... turn off

OK, thank you. I will give it a try. I had this a couple of month ago in that way but maybe I made a mistake.

Thank you for your help!

If you got this working can you send a snapshot of what your flow looks like? I’m new to node red and I can’t figure out out to keep the lights on. My flow is a lot simpler than what you have. I have a sensor in event state and a trigger to turn light off after 5 minutes. I just can’t figure how to keep on if no motion.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.