Simple question. may be simple answer but since I am struggling with this for weeks and tried to search all over but not finding any solution…
What I want. Just “simple AND” statement. For example I want to only turn the light on when another switch is on. Or I only want a snapshot of a camera be sent when another switch is on.
I see something like a switch with a double input. Just like that is input 1 and input 2 are on/true then only the output is on/true.
I think I am thinking too complicated a can really use a push in the right direction.
Another use-case is to “only” follow a flow if another input/switch is true. Like for example “a holiday switch”. If this is ON then only send a picture if the door is opened.
thanks in advance!
ps. I do not want to use complex functions/progamming to achieve…
EDIT: Nevermind. I did this:
I used the “HACS sensor” as an example. You can test the setup by opening and closing “the gate” manually or send an “on” msg.payload to the close gate or open gate to close or open the gate. then the gate will/will not pass any other stuff you flow to it (or not :-)).
This is the config (import in node red):
[{"id":"7de02708.031e08","type":"server-state-changed","z":"9ec3c5fb.13b3f8","name":"Events: State","server":"c6b350c5.b8b3c","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.hacs","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":1170,"y":1720,"wires":[["3dc95e1.33760a2"]]},{"id":"3dc95e1.33760a2","type":"gate","z":"9ec3c5fb.13b3f8","name":"Gate","controlTopic":"control","defaultState":"closed","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":true,"x":1810,"y":1720,"wires":[["c3debf3b.af8db"]]},{"id":"38d67019.f65f5","type":"inject","z":"9ec3c5fb.13b3f8","name":"","topic":"control","payload":"open","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1590,"y":1760,"wires":[["3dc95e1.33760a2","c3debf3b.af8db"]]},{"id":"c3debf3b.af8db","type":"debug","z":"9ec3c5fb.13b3f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":2150,"y":1720,"wires":[]},{"id":"7bf191a9.f694e8","type":"inject","z":"9ec3c5fb.13b3f8","name":"","topic":"control","payload":"close","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1590,"y":1620,"wires":[["3dc95e1.33760a2","c3debf3b.af8db"]]},{"id":"1ae9b450.eab7fc","type":"function","z":"9ec3c5fb.13b3f8","name":"Open Gate","func":"msg.topic = \"control\"\nmsg.payload = \"open\"\nreturn msg;","outputs":1,"noerr":0,"x":1590,"y":1800,"wires":[["3dc95e1.33760a2","c3debf3b.af8db"]]},{"id":"793e0e69.3a4e08","type":"inject","z":"9ec3c5fb.13b3f8","name":"","topic":"","payload":"on","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1410,"y":1800,"wires":[["1ae9b450.eab7fc"]]},{"id":"262f5e75.746332","type":"function","z":"9ec3c5fb.13b3f8","name":"Close Gate","func":"msg.topic = \"control\"\nmsg.payload = \"close\"\nreturn msg;","outputs":1,"noerr":0,"x":1590,"y":1660,"wires":[["3dc95e1.33760a2"]]},{"id":"58fae6f5.f88d7","type":"inject","z":"9ec3c5fb.13b3f8","name":"","topic":"","payload":"on","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1410,"y":1660,"wires":[["262f5e75.746332"]]},{"id":"c6b350c5.b8b3c","type":"server","z":"","name":"Home Assistant"}]
Goodluck