Home Assistant Community

Please explain how to implement Input Booleans with Node Red

#1

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.

#2

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.

#3

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

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

#4

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

#5

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

image

image

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