Home Assistant - Define a switch to do something
Emiliano Guerzoni
Project Manager | BESS Development | Driving 3+ GW of Energy Storage Projects in Italy
Hi guys,
Today I want to introduce the Input Boolean integration.
It's very simple and powerful: it just allows you to define a boolean value (ON / OFF) that can be controlled via the user interface and be used in automations.
Scenario
You want to do something only if the switch defined by the input button integration is ON.
Software configuration
Home Assistant code (yaml) / steps
领英推荐
Now it super easy creating an Automation like this one:
alias: Doing something if my toggle goes ON
description: Doing something if my toggle goes ON
trigger:
? - platform: state
? ? entity_id:
? ? ? - input_boolean.my_toggle
? ? from: "off"
? ? to: "on"
condition: []
action:
? do something
mode: single
Some specifics about the code / procedure above
Thank you for reading. ?? I hope you have enjoyed this article.
I'm available for any feedback so, feel free to contact me or share your thoughts in the comments section below.
Your feedbacks will be very appreciated!
Meanwhile,?if you liked this article share it or?subscribe?to my newsletter?about?Home Assistant?to read all previous episodes and still up to date on latest news.