Hi, Im very new to NodeRed and as a result I am stuck on the following:
Im trying to create a series of timers to select different radio station during the day that will turn off and on set by the timers and also by presence.
The problem Im having is with the switching of the amp on and off.
If we look at the 'off' output, Im thinking there needs to be some sort of AND gate from the switch "off' outputs to the amp, so when all switches are off the amp turns off.
The problem with that is the 'off' outputs from the timers are not re-triggered if a timer is already off, meaning a AND gate would only receive one 'off' input at a particle time. From what I understand a AND gate would need all inputs trigged to output a trigger.
Theres probable loads of different ways of doing this but Im just not sure so any help with this would be appreciated
Ive included a mock up of part of my flow where the trouble is.
[{"id":"a9307e4b.57c1","type":"light-scheduler","z":"8c0817a6.a3ccd8","settings":"9da02f7b.19039","events":"[{\"start\":{\"dow\":6,\"mod\":360},\"end\":{\"dow\":6,\"mod\":720}}]","topic":"","name":"Timer 1 6:00 - 12:00","onPayload":"ON","onPayloadType":"str","offPayload":"OFF","offPayloadType":"str","onlyWhenDark":false,"scheduleRndMax":0,"sunElevationThreshold":6,"sunShowElevationInStatus":false,"outputfreq":"output.statechange.startup","x":260,"y":420,"wires":[["cb6fe6f8.55306"]]},{"id":"c1b8fadf.4a0ae8","type":"light-scheduler","z":"8c0817a6.a3ccd8","settings":"9da02f7b.19039","events":"[{\"start\":{\"dow\":6,\"mod\":720},\"end\":{\"dow\":6,\"mod\":960}}]","topic":"","name":"Timer 2 12:00 - 16:00","onPayload":"ON","onPayloadType":"str","offPayload":"OFF","offPayloadType":"str","onlyWhenDark":false,"scheduleRndMax":0,"sunElevationThreshold":6,"sunShowElevationInStatus":false,"outputfreq":"output.statechange.startup","x":260,"y":480,"wires":[["57c9cf8c.1aa1e8"]]},{"id":"1c6cc6ac.92b231","type":"light-scheduler","z":"8c0817a6.a3ccd8","settings":"9da02f7b.19039","events":"[{\"start\":{\"dow\":6,\"mod\":960},\"end\":{\"dow\":6,\"mod\":1260}}]","topic":"","name":"Timer 3 16:00 - 21:00","onPayload":"ON","onPayloadType":"str","offPayload":"OFF","offPayloadType":"str","onlyWhenDark":false,"scheduleRndMax":0,"sunElevationThreshold":6,"sunShowElevationInStatus":false,"outputfreq":"output.statechange.startup","x":260,"y":540,"wires":[["5b722875.af545"]]},{"id":"cb6fe6f8.55306","type":"switch","z":"8c0817a6.a3ccd8","name":"Switch 1","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"},{"t":"eq","v":"OFF","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":440,"y":420,"wires":[["8ca3bcda.a30e48","ea2b833c.d0df6"],["2cf23dd5.c0e91a","8ca3bcda.a30e48","9f6c3072.ef0228"]]},{"id":"57c9cf8c.1aa1e8","type":"switch","z":"8c0817a6.a3ccd8","name":"Switch 2","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"},{"t":"eq","v":"OFF","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":440,"y":480,"wires":[["73d7984.d9b97e8","ea2b833c.d0df6"],["2cf23dd5.c0e91a","73d7984.d9b97e8","9f6c3072.ef0228"]]},{"id":"5b722875.af545","type":"switch","z":"8c0817a6.a3ccd8","name":"Switch 3","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"},{"t":"eq","v":"OFF","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":440,"y":540,"wires":[["5cf5482e.25453","ea2b833c.d0df6"],["2cf23dd5.c0e91a","5cf5482e.25453","9f6c3072.ef0228"]]},{"id":"facdeb03.8bea5","type":"comment","z":"8c0817a6.a3ccd8","name":"Streams a radio station 1","info":"","x":870,"y":420,"wires":[]},{"id":"58212c2b.6e2da4","type":"comment","z":"8c0817a6.a3ccd8","name":"Streams a radio station 3","info":"","x":870,"y":545,"wires":[]},{"id":"2e7ff36a.a23f5c","type":"comment","z":"8c0817a6.a3ccd8","name":"Streams a radio station 2","info":"","x":870,"y":480,"wires":[]},{"id":"8ca3bcda.a30e48","type":"link out","z":"8c0817a6.a3ccd8","name":"","links":[],"x":745,"y":420,"wires":[]},{"id":"73d7984.d9b97e8","type":"link out","z":"8c0817a6.a3ccd8","name":"","links":[],"x":745,"y":480,"wires":[]},{"id":"5cf5482e.25453","type":"link out","z":"8c0817a6.a3ccd8","name":"","links":[],"x":745,"y":545,"wires":[]},{"id":"4da9d54f.9c0704","type":"comment","z":"8c0817a6.a3ccd8","name":"Amp on","info":"","x":830,"y":280,"wires":[]},{"id":"ea2b833c.d0df6","type":"link out","z":"8c0817a6.a3ccd8","name":"","links":[],"x":765,"y":280,"wires":[]},{"id":"756f9767.95faf","type":"comment","z":"8c0817a6.a3ccd8","name":"Amp off","info":"","x":830,"y":650,"wires":[]},{"id":"2cf23dd5.c0e91a","type":"link out","z":"8c0817a6.a3ccd8","name":"","links":[],"x":765,"y":650,"wires":[]},{"id":"acacce9.429543","type":"comment","z":"8c0817a6.a3ccd8","name":"input to timers is set by presence detection","info":"","x":200,"y":306,"wires":[]},{"id":"aa38c16e.009c38","type":"comment","z":"8c0817a6.a3ccd8","name":"and outputs 'off' if away and 'auto' if home","info":"","x":200,"y":336,"wires":[]},{"id":"2126f819.a24de","type":"comment","z":"8c0817a6.a3ccd8","name":"to reset timers","info":"","x":110,"y":366,"wires":[]},{"id":"51432cb7.3b6074","type":"inject","z":"8c0817a6.a3ccd8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"off","payloadType":"str","x":90,"y":650,"wires":[["a9307e4b.57c1","c1b8fadf.4a0ae8","1c6cc6ac.92b231"]]},{"id":"bdfbbd10.c3cca8","type":"inject","z":"8c0817a6.a3ccd8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"auto","payloadType":"str","x":90,"y":690,"wires":[["1c6cc6ac.92b231","c1b8fadf.4a0ae8","a9307e4b.57c1"]]},{"id":"9f6c3072.ef0228","type":"debug","z":"8c0817a6.a3ccd8","name":"off output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":800,"y":720,"wires":[]},{"id":"ed9ba9e4.068798","type":"comment","z":"8c0817a6.a3ccd8","name":"Simulate presence detection","info":"","x":130,"y":730,"wires":[]},{"id":"9da02f7b.19039","type":"light-scheduler-settings","z":"","name":"my settings","latitude":"38.8977","longitude":"77.0365"}]
I hope Ive explains myself clearly