I have a node-red flow that leverages Google TTS to announce when doors are opened/closed as well as send IOS notification.
I need to create a “Nap Time” toggle switch in HA front-end, that I can use the state of to disable the “Google TTS” portion but still allow for the IOS notification.
Since this won’t be tied to any physical device, I was looking at maybe a template switch, but that didn’t seem to fit.
there is a “gate” node available … you can put this one into your flow and open/close the gate based on your input_boolean. This way the msg.payload will not be overwritten
you need to setup a HA trigger-node which is getting the new input-binary whenever it is changed. Than just feed the true/false or on/off as trigger into the gate
I’m quite new to all of this too. I have been doing something similar with the HA current state switch. I have 0 background in programming so I’m sure there will be much prettier/nicer ways. But surely you could just have a ha current state node for the input Boolean before the google TTS? If you configured it to halt if off then it would just halt the flow and the TTS would not trigger.
Ah I see, ofcourse. As I said before I’m new to all this so my solutions are definitely not the most pretty or efficient. I would just make a different flow for each door. You could still have a switch which routes the on and off and then just pre-defined TTS messages for each door. with a current state before the TTS. You would have 4 flows, but then you would not need to worry about the saving the state etc and it would work!