Creating a toggle switch for on and off scripts

I used to be the laziest when it came to controlling my bedroom fan. I just had on/off buttons in the Home Assistant dashboard. Sounds fine, but it got messy real quick, especially when I tried to use it from different places. A real headache!

The answer? A toggle switch! Yeah, I know, not the fanciest thing, but it’s a game-changer. Now, I’ve got this handy toggle switch that does the fan magic for me. No more fumbling with buttons, no more confusion. I know many people have read about it in the community, but the solutions are just all over the place, and it’s hard to find a quick and short guide on how to do it - so I’ve spilled the beans on how I did, basically:

Step 1: Create custom scripts to control your devices.

Step 2: Set up a toggle switch helper for a more intuitive user interface.

Step 3: Craft an automation that responds to the toggle switch’s state changes.

You can get the YAML configurations and read about it in my latest blog post - Creating a Smart Home Toggle Switch for Home Assistant.

Thanks

2 Likes

thanks super helpful

Yes, Thanks for this.
After some playing around though, you don’t need to create the scripts. You can do the service call directly in the automation configuration.

2 Likes

Almost a year and a bit further, but I can’t get this to work. Working with RFXcom, so that might be the problem.
To set my livingroom fan to low, I have to send this command to HA

Blokcitaat
48 7F 00 08 06 01 03 03 40 01 2E 03 3F 01 30 03 3F 01 2E 03 45 01 2C 01 B6 02 B6 01 BB 02 B5 03 44 01 2C 01 BA 02 B5 01 B8 02 B7 03 45 01 2C 03 43 01 28 03 44 01 2E 03 43 01 2C 03 40 01 2D 03 45 01 2C 03 40 01 2D 23 28