Trigger or state node once when power is above or below a value

I’m a bit lost with all the trigger and state nodes maybe somebody can help me because I’m still learning the node red every day

I have a smart light with a timer that runs on motion detection, lux also depending on the time of day.
(based on https://www.reddit.com/r/homeassistant/comments/afk6cd/building_smarter_motion_lighting_nodered_finite/)
I made my own adjustments on it and want to expand this scene.

What I want is when motion is detected the lights go on (timer runs) I want the timer to stop if the wall plug power is above 100w value.

The problem I found is when use the trigger or state nodes: when you set something > or < 100 every value of above or below 100 is triggering the output a lot of times because the power is never a stable value and so the timer.
I also tried something with the filter node but no luck.

What I want is a output set once on On or True when power is above 100 and once on Off/ false when the power is below 100.
If power is above 100 set it on true once again and so on… so the timer won’t get a lot of triggers and messing up the scene

Maybe it’s very simple but somehow I could not find the solution on the web

[{"id":"6c94d676f967559e","type":"inject","z":"ffbd7f06.4a014","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"120","payloadType":"num","x":114,"y":1520,"wires":[["731bdba266bb67f3"]]},{"id":"00adf111f7fc6a9d","type":"debug","z":"ffbd7f06.4a014","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":630,"y":1520,"wires":[]},{"id":"4736cd8d1fe028a7","type":"inject","z":"ffbd7f06.4a014","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"101","payloadType":"num","x":114,"y":1552,"wires":[["731bdba266bb67f3"]]},{"id":"4fb214c39fc60a4d","type":"inject","z":"ffbd7f06.4a014","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"100","payloadType":"num","x":114,"y":1584,"wires":[["731bdba266bb67f3"]]},{"id":"2133b67e44f7c2f2","type":"inject","z":"ffbd7f06.4a014","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":114,"y":1616,"wires":[["731bdba266bb67f3"]]},{"id":"731bdba266bb67f3","type":"change","z":"ffbd7f06.4a014","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload > 100 ? true : false","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":288,"y":1520,"wires":[["1af17a574c9d4920"]]},{"id":"1af17a574c9d4920","type":"rbe","z":"ffbd7f06.4a014","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":466,"y":1520,"wires":[["00adf111f7fc6a9d"]]}]
1 Like

Thank you for the flow. This is what I was looking for
Thanks!

Hi @D-Vine ,

Could you please upload your flow json ?

I was trying to use the same original flow as you, but without success.
I feel I that I have a problem with the state changes of the “state machine” node.

Having, your version would probably help me to troubleshoot mine.
(and btw, I was looking to do the sam personalization)

Thanks a lot,
François

@Bestofbasile

Here is my flow with some more adjustments.

I did the power with a trigger node finally.
A power > X Watts that stops the timer after the scene is started.
A power > X Watts that stops the timer each time if a new motion is triggert.
And A power < Watts to start the timer again
With these combinations you cover up all situations

I also made a adjustment on the state machine node because my z-wave switch was sending states that made the state machine stuck on a state without the possibility to trigger a motion again.

I want to make a extra setting so double clic on the switch will override the timer but that is for later.

And I made a check lux in the scene that when the lights are on and lux goes above a value the lights go out.

At this moment the scene is working like I have with Fibaro LUA code for the past 6 years so I’m happy so far.

If All things keep on working well I think I go to post my “Smart lights” node red flow official because I did not see the solution like I did yet in this forum.

I have also a flow with 2 motion sensors and more lights to check.

[{"id":"5eae6502a99b6b76","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"6d282604d7443090","type":"trigger-state","z":"5eae6502a99b6b76","name":"Zolder motion","server":"85cb4144.a30f7","version":0,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"binary_sensor.zolder_kamer_zolderkamer_motion_309","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"on","propertyValue":"new_state.state"}],"outputs":2,"customoutputs":[],"outputinitially":false,"x":80,"y":80,"wires":[["53f089b290242e3b"],[]]},{"id":"47f05cf8d6864adb","type":"trigger-state","z":"5eae6502a99b6b76","name":"Zolder lights","server":"85cb4144.a30f7","version":0,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"light.zolder_kamer_zolder_light_695","entityidfiltertype":"regex","debugenabled":false,"constraints":[],"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","x":70,"y":420,"wires":[["3a0131da65518731"],[]]},{"id":"504bd3934e42151f","type":"api-call-service","z":"5eae6502a99b6b76","name":"Light On 30%","server":"85cb4144.a30f7","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.zolder_kamer_zolder_light_695","data":"{\"brightness_pct\":30}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1040,"y":140,"wires":[["adf7426d85e4a457"]]},{"id":"332a886aef22abc4","type":"api-call-service","z":"5eae6502a99b6b76","name":"Turn off lights","server":"85cb4144.a30f7","version":3,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.zolder_kamer_zolder_light_695","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":840,"y":380,"wires":[["aeb28ec9c40fc262"]]},{"id":"3a0131da65518731","type":"change","z":"5eae6502a99b6b76","name":"switch","rules":[{"t":"set","p":"payload","pt":"msg","to":"switch","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":230,"y":420,"wires":[["cf8d010be097dcd5"]]},{"id":"876c4bae42b90bb9","type":"change","z":"5eae6502a99b6b76","name":"motion","rules":[{"t":"set","p":"payload","pt":"msg","to":"motion","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":120,"wires":[["cf8d010be097dcd5"]]},{"id":"414dedce40403034","type":"stoptimer","z":"5eae6502a99b6b76","duration":"10","units":"Second","payloadtype":"num","payloadval":"0","name":"pause detection","x":1040,"y":500,"wires":[["73198c89ebe706ef"],[]]},{"id":"73198c89ebe706ef","type":"api-current-state","z":"5eae6502a99b6b76","name":"Light state","server":"85cb4144.a30f7","version":2,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.zolder_kamer_zolder_light_695","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":1290,"y":380,"wires":[["5e6a0c287697f584"]]},{"id":"2f81a68f363a9f86","type":"change","z":"5eae6502a99b6b76","name":"stop","rules":[{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":850,"y":660,"wires":[["08eec4c38361ac8a"]]},{"id":"84188ca05f1ea590","type":"change","z":"5eae6502a99b6b76","name":"motion-on","rules":[{"t":"set","p":"payload","pt":"msg","to":"motion-on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1280,"y":280,"wires":[["5e6a0c287697f584"]]},{"id":"c0739b11882578fb","type":"change","z":"5eae6502a99b6b76","name":"motion-off","rules":[{"t":"set","p":"payload","pt":"msg","to":"motion-off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1280,"y":440,"wires":[["5e6a0c287697f584"]]},{"id":"aeb28ec9c40fc262","type":"stoptimer","z":"5eae6502a99b6b76","duration":"10","units":"Second","payloadtype":"num","payloadval":"0","name":"pause","x":1010,"y":380,"wires":[["73198c89ebe706ef"],[]]},{"id":"adf7426d85e4a457","type":"stoptimer","z":"5eae6502a99b6b76","duration":"10","units":"Second","payloadtype":"num","payloadval":"0","name":"pause","x":1270,"y":220,"wires":[["84188ca05f1ea590"],[]]},{"id":"114a9cd674bdcd85","type":"switch","z":"5eae6502a99b6b76","name":"motion-detected","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"motion-detected","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":640,"y":360,"wires":[["126bc55c7d61eb77","e5a7032f1892e1f7","7968e0677dc39310","f2db36b13dc6a527"]]},{"id":"2783b29ac034d83a","type":"switch","z":"5eae6502a99b6b76","name":"motion-on","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"motion-on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":620,"y":440,"wires":[["08eec4c38361ac8a","c6ede231124b5e57"]]},{"id":"90e1ef0a10fb5564","type":"link in","z":"5eae6502a99b6b76","name":"kitchen state machine","links":["5e6a0c287697f584"],"x":215,"y":480,"wires":[["cf8d010be097dcd5"]]},{"id":"5e6a0c287697f584","type":"link out","z":"5eae6502a99b6b76","name":"kitchen state machine","links":["90e1ef0a10fb5564"],"x":1435,"y":320,"wires":[]},{"id":"4aa4356740464a48","type":"switch","z":"5eae6502a99b6b76","name":"switch","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"switch","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":610,"y":480,"wires":[["2f81a68f363a9f86","414dedce40403034"]]},{"id":"d13a23694fd79305","type":"switch","z":"5eae6502a99b6b76","name":"motion-off","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"motion-off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":620,"y":400,"wires":[["332a886aef22abc4"]]},{"id":"08eec4c38361ac8a","type":"stoptimer","z":"5eae6502a99b6b76","duration":"5","units":"Minute","payloadtype":"num","payloadval":"0","name":"","x":1040,"y":440,"wires":[["c0739b11882578fb"],[]]},{"id":"53f089b290242e3b","type":"api-current-state","z":"5eae6502a99b6b76","name":"Zolder Lux < 30","server":"85cb4144.a30f7","version":2,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"sensor.zolder_kamer_zolder_lux_311","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"x":280,"y":80,"wires":[["222c4b9da609a862","5dd9a4eedcaf8014"]]},{"id":"126bc55c7d61eb77","type":"api-current-state","z":"5eae6502a99b6b76","name":"Morning","server":"85cb4144.a30f7","version":2,"outputs":2,"halt_if":"Morning","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_select.time_of_day","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":820,"y":140,"wires":[["504bd3934e42151f"],[]]},{"id":"e5a7032f1892e1f7","type":"api-current-state","z":"5eae6502a99b6b76","name":"Day","server":"85cb4144.a30f7","version":2,"outputs":2,"halt_if":"Day","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_select.time_of_day","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":810,"y":200,"wires":[["95b963b027970ece"],[]]},{"id":"7968e0677dc39310","type":"api-current-state","z":"5eae6502a99b6b76","name":"Evening","server":"85cb4144.a30f7","version":2,"outputs":2,"halt_if":"Evening","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_select.time_of_day","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":820,"y":260,"wires":[["82bd50f100bf9e81"],[]]},{"id":"f2db36b13dc6a527","type":"api-current-state","z":"5eae6502a99b6b76","name":"Night","server":"85cb4144.a30f7","version":2,"outputs":2,"halt_if":"Night","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_select.time_of_day","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":810,"y":320,"wires":[["eac31afb8bcd92cd"],[]]},{"id":"95b963b027970ece","type":"api-call-service","z":"5eae6502a99b6b76","name":"Light On 20%","server":"85cb4144.a30f7","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.zolder_kamer_zolder_light_695","data":"{\"brightness_pct\":20}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1040,"y":200,"wires":[["adf7426d85e4a457"]]},{"id":"82bd50f100bf9e81","type":"api-call-service","z":"5eae6502a99b6b76","name":"Light On 10%","server":"85cb4144.a30f7","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.zolder_kamer_zolder_light_695","data":"{\"brightness_pct\":10}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1040,"y":260,"wires":[["adf7426d85e4a457"]]},{"id":"eac31afb8bcd92cd","type":"api-call-service","z":"5eae6502a99b6b76","name":"Light On 5%","server":"85cb4144.a30f7","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.zolder_kamer_zolder_light_695","data":"{\"brightness_pct\":5}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1030,"y":320,"wires":[["adf7426d85e4a457"]]},{"id":"402b97daec21fb39","type":"comment","z":"5eae6502a99b6b76","name":"Smart Lights Zolder","info":"","x":90,"y":40,"wires":[]},{"id":"4375aac36897a116","type":"server-state-changed","z":"5eae6502a99b6b76","name":"power state > 110","server":"85cb4144.a30f7","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.computer_sensor_current","entityidfiltertype":"exact","outputinitially":false,"state_type":"num","haltifstate":"110","halt_if_type":"num","halt_if_compare":"gt","outputs":2,"output_only_on_state_change":true,"for":"80","forType":"num","forUnits":"seconds","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"true","valueType":"bool"}],"x":430,"y":660,"wires":[["3cb282755d12f06b"],[]]},{"id":"3cb282755d12f06b","type":"trigger","z":"5eae6502a99b6b76","name":"> 110W","op1":"true","op2":"0","op1type":"bool","op2type":"str","duration":"0","extend":false,"overrideDelay":false,"units":"ms","reset":"false","bytopic":"all","topic":"topic","outputs":1,"x":620,"y":660,"wires":[["2f81a68f363a9f86"]]},{"id":"67d4cb452fdef5d4","type":"change","z":"5eae6502a99b6b76","name":"start","rules":[{"t":"set","p":"payload","pt":"msg","to":"start","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":850,"y":600,"wires":[["08eec4c38361ac8a"]]},{"id":"598f1c16efa26a8f","type":"server-state-changed","z":"5eae6502a99b6b76","name":"power state < 90","server":"85cb4144.a30f7","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.computer_sensor_current","entityidfiltertype":"exact","outputinitially":false,"state_type":"num","haltifstate":"90","halt_if_type":"num","halt_if_compare":"lt","outputs":2,"output_only_on_state_change":true,"for":"40","forType":"num","forUnits":"seconds","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"true","valueType":"bool"}],"x":420,"y":600,"wires":[["5afb07bd4282fff8"],[]]},{"id":"5afb07bd4282fff8","type":"trigger","z":"5eae6502a99b6b76","name":"< 90W","op1":"true","op2":"0","op1type":"bool","op2type":"str","duration":"0","extend":false,"overrideDelay":false,"units":"ms","reset":"false","bytopic":"all","topic":"topic","outputs":1,"x":610,"y":600,"wires":[["67d4cb452fdef5d4"]]},{"id":"fbe36a4f1a8be687","type":"rbe","z":"5eae6502a99b6b76","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":610,"y":80,"wires":[["332a886aef22abc4"]]},{"id":"198666c91683ecac","type":"api-call-service","z":"5eae6502a99b6b76","name":"Light Off > 35 Lux","server":"85cb4144.a30f7","version":3,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.zolder_kamer_zolder_light_695","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":850,"y":80,"wires":[[]]},{"id":"222c4b9da609a862","type":"switch","z":"5eae6502a99b6b76","name":"> 35","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"35","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":450,"y":80,"wires":[["fbe36a4f1a8be687"]]},{"id":"5dd9a4eedcaf8014","type":"switch","z":"5eae6502a99b6b76","name":"< 35","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"35","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":450,"y":120,"wires":[["876c4bae42b90bb9"]]},{"id":"2f8540ea98b64479","type":"rbe","z":"5eae6502a99b6b76","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":130,"y":160,"wires":[[]]},{"id":"cf8d010be097dcd5","type":"state-machine","z":"5eae6502a99b6b76","name":"","triggerProperty":"payload","triggerPropertyType":"msg","stateProperty":"payload","statePropertyType":"msg","initialDelay":"","persistOnReload":false,"outputStateChangeOnly":true,"throwException":false,"states":["switch","motion-detected","motion-on","motion-off","off","on","motion"],"transitions":[{"name":"motion","from":"off","to":"motion-detected"},{"name":"motion","from":"motion-on","to":"motion-on"},{"name":"on","from":"*","to":"on"},{"name":"switch","from":"off","to":"switch"},{"name":"switch","from":"on","to":"switch"},{"name":"switch","from":"switch","to":"switch"},{"name":"switch","from":"motion-on","to":"switch"},{"name":"motion-on","from":"motion-detected","to":"motion-on"},{"name":"motion-off","from":"motion-on","to":"motion-off"},{"name":"motion","from":"switch","to":"motion-detected"},{"name":"motion","from":"off","to":"motion-detected"},{"name":"motion","from":"on","to":"motion-detected"},{"name":"motion","from":"motion-off","to":"motion-detected"}],"x":420,"y":420,"wires":[["114a9cd674bdcd85","d13a23694fd79305","2783b29ac034d83a","4aa4356740464a48"]]},{"id":"6a1269865c604e0b","type":"api-current-state","z":"5eae6502a99b6b76","name":"Power > 85","server":"85cb4144.a30f7","version":2,"outputs":2,"halt_if":"110","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.computer_sensor_current","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":830,"y":540,"wires":[["2f81a68f363a9f86"],[]]},{"id":"c6ede231124b5e57","type":"stoptimer","z":"5eae6502a99b6b76","duration":"1","units":"Minute","payloadtype":"num","payloadval":"0","name":"","x":640,"y":540,"wires":[["6a1269865c604e0b"],[]]},{"id":"85cb4144.a30f7","type":"server","name":"Home Assistant","version":1,"legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

Thanks a lot @D-Vine.

I have much better results with your version.

I only had very few times where the state machine was stuck to the ‘Off’ state
I’ll need to investigate it more deeper.

Thanks again :slightly_smiling_face:

@Bestofbasile

You are welcome.
I had also problem with the off state of mine z-wave switch first but after the adjustment it went well.
In my case off is off and only a new motion will trigger it to turn on the lights and only if the motion sensor Lux is above a X value.

If things still don’t work because I don’t know how your switch is reacting to things and send the output you can check with some debugs what is doing.

For the state machine.

The middle section is the actual state of the state machine.
The left section is the new state is send into the machine and then comes a output (right) if you set it.

So in this case if the state machine has a off. And a motion is send into the state machine the output is motion detected.

At this stage I made it that the motion always have to overrule the switch or on / off state into a motion detected only when lux is below a value.
So is you toggle the switch On, lights go On and Lux is below a value it wont trigger again off because you are at manual stage.

So if your state machine is on off stage check if Lux value is below the settings if so it should trigger over the off stage to motion.
Just for testing raise your switch node (next to motion lux node) value to above 400 so the motion will always trigger over your switch state.

I see I have a double entry now but should be fine I think.
But I’m also a bit new and adjust my smart light so it becomes a all round node red blue print for all sort off things.
If you see things that could be better of otherwise let it know maybe we can make it better and better

The advantage of the state machine is also that when you have new things that you want to trigger you easy can put into your flow and make a outcome like you want

Same here

Well, this is not a connected switch. This is still the “old school” version (non-connected) :smile:

We are not supposed to flip the switch, but kids still need to learn the domotics. I will maybe consider upgrading my switch to the ZWave Version later, but I would maybe use a virtual switch instead (Using an input boolean and a virtual button in my interface to still be able to force the 'on 'state if needed.

Very clear thanks.

This is clearly a real advantage.

Thanks again for your time. I’ll continue to work on this integration, and I’ll let you know If I will do some improvement.

1 Like