Shelly updated light conditions

hello everybody,

i am very new to the universe of node red. so forgive me if the right answer is already figured out.

from the beginning, i used for all the time till now the alexa app to do my tasks. i have 40 devices in my "smarthome" but i always struggle with the limited options alexa can handle. so i purchased a raspberry and installed homeassistant. but for a visual person like me i loved the visual flow of node red.

but i came to the same borders that alexa gives me. i have 4 shelly motion and it bordered me the whole time that alexa can not expand the motion time. so i set up a flow that looks for motion -> than looks for luminosity and then fires up a delay.

but that's not what i want, as soon that the first condition comes true and the lights goes on the luminosity increase because the shelly sees the light from the bulbs.

so, the real question, is there a workaround -> if condition where dark and motion is detected -> expand the time motion is detected. not evaluating that the light level has changed. motion -> light level -> bulbs are on. new condition motion -> light level to high because the bulbs are on.

i am very new to this topic, but i hope i can explain what my misery is.

greetings from germany, torsten

Hi and welcome,.

This may help you with logic
I am guessing as to your input values. I also do not have HA installed. The injects simulate your HA state change nodes ( but guessed outputs sent).
This should only send 1 if motion is detected and light level is below 100, it should ignore any light level changes once triggered, until no motion or light is turned off manually. You can also set light on manually and the light should come on and then be controlled by any motion. have a play.

[{"id":"7adc3ba8.bfdee4","type":"inject","z":"30af2d3e.d94ea2","name":"lumen 50","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"lumen","payload":"50","payloadType":"num","x":224,"y":3266,"wires":[["bbf6d58c.40cf68"]]},{"id":"bbf6d58c.40cf68","type":"change","z":"30af2d3e.d94ea2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$$.payload < 100","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":424,"y":3286,"wires":[["fdc5ee62.2dfc48"]]},{"id":"aa1e5740.09be6","type":"inject","z":"30af2d3e.d94ea2","name":"lumen 100","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"lumen","payload":"100","payloadType":"num","x":214,"y":3306,"wires":[["bbf6d58c.40cf68"]]},{"id":"fdc5ee62.2dfc48","type":"join","z":"30af2d3e.d94ea2","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":650,"y":3360,"wires":[["8bc15d6.c33d12","32ed7004.d24bb8"]]},{"id":"d2ecca89.4d44","type":"trigger","z":"30af2d3e.d94ea2","name":"","op1":"","op2":"","op1type":"pay","op2type":"payl","duration":"5","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":450,"y":3360,"wires":[["fdc5ee62.2dfc48"]]},{"id":"8bc15d6.c33d12","type":"debug","z":"30af2d3e.d94ea2","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":790,"y":3320,"wires":[]},{"id":"32ed7004.d24bb8","type":"change","z":"30af2d3e.d94ea2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"($$.payload.lumen = true or \t$flowContext(\"light1\") = true) and \t$$.payload.motion = true ? 1 : 0","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":890,"y":3360,"wires":[["3bea8591.1d5c02"]]},{"id":"983188b3.798368","type":"change","z":"30af2d3e.d94ea2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1 in $$.payload.*","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"motion","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":3440,"wires":[["d2ecca89.4d44"]]},{"id":"efe91387.3d21c8","type":"change","z":"30af2d3e.d94ea2","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"motion","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"$$.payload = 1","tot":"jsonata"},{"t":"set","p":"light1","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":3580,"wires":[["d2ecca89.4d44"]]},{"id":"3bea8591.1d5c02","type":"change","z":"30af2d3e.d94ea2","name":"","rules":[{"t":"set","p":"light1","pt":"flow","to":"$$.payload = 1","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1130,"y":3360,"wires":[["85362332.719c38"]]},{"id":"a09dcdfb.12002","type":"join","z":"30af2d3e.d94ea2","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":370,"y":3440,"wires":[["983188b3.798368"]]},{"id":"917706b7.682e3","type":"inject","z":"30af2d3e.d94ea2","name":"light1 1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"light1","payload":"1","payloadType":"num","x":220,"y":3580,"wires":[["efe91387.3d21c8"]]},{"id":"e43623d2.640198","type":"inject","z":"30af2d3e.d94ea2","name":"light1 0","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"light1","payload":"0","payloadType":"num","x":210,"y":3620,"wires":[["efe91387.3d21c8"]]},{"id":"85362332.719c38","type":"rbe","z":"30af2d3e.d94ea2","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","x":1290,"y":3360,"wires":[["dc03bc53.eb15a"]]},{"id":"ac09db4b.21fd48","type":"inject","z":"30af2d3e.d94ea2","name":"motion1 1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"motion1","payload":"1","payloadType":"num","x":230,"y":3380,"wires":[["a09dcdfb.12002"]]},{"id":"9839cf11.388818","type":"inject","z":"30af2d3e.d94ea2","name":"motion1 0","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"motion1","payload":"0","payloadType":"num","x":220,"y":3420,"wires":[["a09dcdfb.12002"]]},{"id":"ee9d50e1.6b2948","type":"inject","z":"30af2d3e.d94ea2","name":"motion2 1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"motion2","payload":"1","payloadType":"num","x":230,"y":3480,"wires":[["a09dcdfb.12002"]]},{"id":"eeff7b7d.87184","type":"inject","z":"30af2d3e.d94ea2","name":"motion2 0","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"motion2","payload":"0","payloadType":"num","x":220,"y":3520,"wires":[["a09dcdfb.12002"]]},{"id":"dc03bc53.eb15a","type":"debug","z":"30af2d3e.d94ea2","name":"output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1420,"y":3360,"wires":[]}]

Not fully tested.

Hello E1cid,

many many thanks for your work. i will try it out the next days. this is so great, i am happy that this is maybe the solution :slight_smile:

greeting Torsten

Hello E1cid, i tinkered a little bit around with your code. what i was not sure about, the light1 and light0 at the bottom, they are supposed to be a trigger state of the actual light? so i feed them with the conditions the light has that was triggered? ore they are only for manual switch press? i added my shelly motion as inputs, and changed the join node for motion / no motion to two message pieces, with three as you posted i cant get any debug information out of this note. when both conditions are true i get a {"lumen":true,"motion":true}. and also the opposite works, with any condition false. also the 1 and 0 as output works. but i am not shure, the shelly motion looks like it dont accept a retrigger until it runs into a no motion. i triggered motion, when its accepted and the light goes on i turn on my desk lamp to simulate higher lumen. when i then try to retrigger motion the higher lumen makes a {"lumen":false,"motion":true} and the light goes off. here are how far i got. i am not worried if you have no time, i am thankful for your ideas you provided to me.

[{"id":"7adc3ba8.bfdee4","type":"inject","z":"c7fd36215719691e","name":"lumen 50","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"lumen","payload":"50","payloadType":"num","x":360,"y":40,"wires":[[]]},{"id":"bbf6d58c.40cf68","type":"change","z":"c7fd36215719691e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$$.payload < 100","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":220,"wires":[["fdc5ee62.2dfc48"]]},{"id":"aa1e5740.09be6","type":"inject","z":"c7fd36215719691e","name":"lumen 100","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"lumen","payload":"100","payloadType":"num","x":350,"y":80,"wires":[[]]},{"id":"fdc5ee62.2dfc48","type":"join","z":"c7fd36215719691e","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":706,"y":294,"wires":[["32ed7004.d24bb8","a1fb01a221a823e9"]]},{"id":"d2ecca89.4d44","type":"trigger","z":"c7fd36215719691e","name":"","op1":"","op2":"","op1type":"pay","op2type":"payl","duration":"5","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":506,"y":294,"wires":[["fdc5ee62.2dfc48"]]},{"id":"32ed7004.d24bb8","type":"change","z":"c7fd36215719691e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"($$.payload.lumen = true or \t$flowContext(\"light1\") = true) and \t$$.payload.motion = true ? 1 : 0","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":946,"y":294,"wires":[["3bea8591.1d5c02"]]},{"id":"983188b3.798368","type":"change","z":"c7fd36215719691e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1 in $$.payload.*","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"motion","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":606,"y":374,"wires":[["d2ecca89.4d44"]]},{"id":"efe91387.3d21c8","type":"change","z":"c7fd36215719691e","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"motion","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"$$.payload = 1","tot":"jsonata"},{"t":"set","p":"light1","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":520,"wires":[["d2ecca89.4d44"]]},{"id":"3bea8591.1d5c02","type":"change","z":"c7fd36215719691e","name":"","rules":[{"t":"set","p":"light1","pt":"flow","to":"$$.payload = 1","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1140,"y":280,"wires":[["85362332.719c38","039f295e1797e67f"]]},{"id":"a09dcdfb.12002","type":"join","z":"c7fd36215719691e","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":426,"y":374,"wires":[["983188b3.798368"]]},{"id":"917706b7.682e3","type":"inject","z":"c7fd36215719691e","name":"light1 1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"light1","payload":"1","payloadType":"num","x":170,"y":640,"wires":[[]]},{"id":"e43623d2.640198","type":"inject","z":"c7fd36215719691e","name":"light1 0","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"light1","payload":"0","payloadType":"num","x":170,"y":680,"wires":[[]]},{"id":"85362332.719c38","type":"rbe","z":"c7fd36215719691e","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","x":1346,"y":294,"wires":[["dc03bc53.eb15a","7394d9b9fabde130","50f460a06ac69e94"]]},{"id":"ee9d50e1.6b2948","type":"inject","z":"c7fd36215719691e","name":"motion2 1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"motion2","payload":"1","payloadType":"num","x":160,"y":40,"wires":[[]]},{"id":"eeff7b7d.87184","type":"inject","z":"c7fd36215719691e","name":"motion2 0","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"motion2","payload":"0","payloadType":"num","x":160,"y":80,"wires":[[]]},{"id":"dc03bc53.eb15a","type":"debug","z":"c7fd36215719691e","name":"output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1810,"y":300,"wires":[]},{"id":"a1fb01a221a823e9","type":"debug","z":"c7fd36215719691e","name":"debug 9","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1000,"y":380,"wires":[]},{"id":"039f295e1797e67f","type":"debug","z":"c7fd36215719691e","name":"debug 10","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1380,"y":420,"wires":[]},{"id":"7394d9b9fabde130","type":"debug","z":"c7fd36215719691e","name":"debug 11","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1400,"y":620,"wires":[]},{"id":"0cc72a4e06da5f59","type":"server-state-changed","z":"c7fd36215719691e","name":"Bad Motion","server":"9d907d4e.89b82","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.shelly_musik_bad_motion","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"1","valueType":"num"},{"property":"topic","propertyType":"msg","value":"motion2","valueType":"str"}],"x":150,"y":320,"wires":[["a09dcdfb.12002"],[]]},{"id":"e8a358e5d8084e1c","type":"server-state-changed","z":"c7fd36215719691e","name":"Luminosity < 150","server":"9d907d4e.89b82","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.shelly_musik_bad_luminosity","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"150","halt_if_type":"num","halt_if_compare":"lt","outputs":2,"output_only_on_state_change":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"50","valueType":"num"},{"property":"topic","propertyType":"msg","value":"lumen","valueType":"str"}],"x":160,"y":180,"wires":[["bbf6d58c.40cf68"],[]]},{"id":"a1e41c2fe9a7d40a","type":"server-state-changed","z":"c7fd36215719691e","name":"Bad no Motion","server":"9d907d4e.89b82","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.shelly_musik_bad_motion","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"off","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"0","valueType":"num"},{"property":"topic","propertyType":"msg","value":"motion2","valueType":"str"}],"x":160,"y":380,"wires":[["a09dcdfb.12002"],[]]},{"id":"4b552526ddea9ea0","type":"server-state-changed","z":"c7fd36215719691e","name":"Luminosity > 150","server":"9d907d4e.89b82","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.shelly_musik_bad_luminosity","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"150","halt_if_type":"num","halt_if_compare":"gt","outputs":2,"output_only_on_state_change":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"100","valueType":"num"},{"property":"topic","propertyType":"msg","value":"lumen","valueType":"str"}],"x":160,"y":240,"wires":[["bbf6d58c.40cf68"],[]]},{"id":"0cec3c78eff3d3e8","type":"trigger-state","z":"c7fd36215719691e","name":"Lampe 1 an","server":"9d907d4e.89b82","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"switch.arbeitsplatte_switch_1","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"on"}],"inputs":0,"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","enableInput":false,"x":150,"y":480,"wires":[["62e54e8caeecdfdc"],[]]},{"id":"65526a298f981d6c","type":"trigger-state","z":"c7fd36215719691e","name":"Lampe 1 aus","server":"9d907d4e.89b82","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"switch.arbeitsplatte_switch_1","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"off"}],"inputs":0,"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","enableInput":false,"x":150,"y":540,"wires":[["b5e12bf37072e549"],[]]},{"id":"62e54e8caeecdfdc","type":"change","z":"c7fd36215719691e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"light1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":480,"wires":[["efe91387.3d21c8"]]},{"id":"b5e12bf37072e549","type":"change","z":"c7fd36215719691e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"light1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":540,"wires":[["efe91387.3d21c8"]]},{"id":"1c68c620fa0f5c4c","type":"api-call-service","z":"c7fd36215719691e","name":"","server":"9d907d4e.89b82","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":["728d8484ef4934fa8f6198e54fdda164"],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1940,"y":500,"wires":[[]]},{"id":"50f460a06ac69e94","type":"switch","z":"c7fd36215719691e","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1550,"y":180,"wires":[["0724ff139c2ebdb7","95673226f0f0a326"],["0724ff139c2ebdb7"]]},{"id":"bb14116a39c7fe8f","type":"api-call-service","z":"c7fd36215719691e","name":"","server":"9d907d4e.89b82","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":["728d8484ef4934fa8f6198e54fdda164"],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1940,"y":560,"wires":[[]]},{"id":"0724ff139c2ebdb7","type":"trigger","z":"c7fd36215719691e","name":"2 Min no Motion","op1":"","op2":"","op1type":"nul","op2type":"pay","duration":"2","extend":false,"overrideDelay":false,"units":"min","reset":"1","bytopic":"all","topic":"topic","outputs":1,"x":1660,"y":240,"wires":[["95673226f0f0a326"]]},{"id":"95673226f0f0a326","type":"rbe","z":"c7fd36215719691e","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1790,"y":180,"wires":[["61371f2dbe2ca8c1"]]},{"id":"61371f2dbe2ca8c1","type":"switch","z":"c7fd36215719691e","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1970,"y":180,"wires":[["1c68c620fa0f5c4c"],["bb14116a39c7fe8f"]]},{"id":"9d907d4e.89b82","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"}]

greetings Torsten

Lumens is the lumens when ever it changes.
Motion 1 & 2 are two motion detectors, if you have one you will need to change the join and its change node output.
Light1 is the state of the light.

As i said before i have no idea of you HA node outputs, and you have not mentioned what they are. You need to select a HA node that outputs the state change for the above mention devices.
You should only need one state change node per device.

I would need alot more info of your device outputs from the HA nodes to help further.