Im having a light switch turning off all my lights, but this flow also runs after every time I’m restarting my HA or when I deploy NodeRed. How do I avoid that?
Use a state node with extra state conditions:
[{"id":"146fe6d099162075","type":"trigger-state","z":"0e72705ddcb6c27b","name":"waterverbruik esp","server":"1190584e6afd2564","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"sensor.waterteller","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"does_not_include","comparatorValueDatatype":"list","comparatorValue":"unknown,unavailable"},{"targetType":"this_entity","targetValue":"","propertyType":"previous_state","propertyValue":"old_state.state","comparatorType":"does_not_include","comparatorValueDatatype":"list","comparatorValue":"unknown,unavailable"}],"inputs":0,"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","enableInput":false,"x":130,"y":480,"wires":[["fa35e810490f5fdf"],[]]},{"id":"1190584e6afd2564","type":"server","name":"Home Assistant","version":5,"addon":false,"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","enableGlobalContextStore":true}]