Home Assistant Community

Please explain how to implement Input Booleans with Node Red


Hey Everybody, thanks to this awesome community, I have my first two automations going. However, in an effort to become more acquainted with Node Red, I am wanting to learn how to add an Input Boolean to my existing automation, so that I can have manual control of it via the front end. If I understand it correctly, I need to use the trigger: state node, but I am 90% I am doing it wrong, as I cannot figure it out. I also tried using the current state node, but again, no luck. This is my flow

and this is my input boolean
I assume I have to put the new input boolean node in between the current state node and the switch node.


Not 100% what you are asking for but if you want to control anything with your input_boolean you will need to use the event state node set to your boolean. When you flick the switch it can call what ever service you want using the call service node.
If you want your automation to work depending on whether the input_boolean is on or off would mean you using a current state node set to your boolean and placing it into your flow.


Quick check, are you using the ‘node-red-contrib-home-assistant-websocket’ palette?

As above it’s the event:state node that you need.


Correct, or after chromecast named node. You don’t want to continue if the boolean is off, so select in “halt if state” select is and put “off”

You can also use the trigger state node where you can add several constraints in one node


I use Input booleans to turn enable and disable my device trackers manually from the HA UI all the time.



   name: Enable Notifications
   initial: on
   icon: mdi:cellphone-iphone