I am running 2 seperate scripts to turn my ceiling fan on/off. I have created a toggle switch template to control it in HA. When I toggle it on the fan turns on, but the toggle slide in HA turns itself off. The fan remains on and I am unable to toggle the fan off.
Is there a specific reason you want to use a script and or templates as turning a fan on and off is a pretty simple candidate for a standard automation?
Could you not simply make a Boolean for the front end and have a simple single automation using Boolean state as trigger to turn on or off?
Or is it part of something bigger or more complex that demands this type of use case?
Thanks for all the replies. I was trying to use a script to communicate between my RF ceiling fan and HA with a broadlink. I decided to take a different route and use a helper toggle with an automation. I was unaware of what helpers did. Also all the videos I saw with broadlink used scripts. Im still relatively new to HA and yaml. Not very efficient yet lol.
Last question. I removed the text concerning switches from my config. yaml, but the switches still appear under my entities. How can I remove them completely?
It just omits the case that the input boolean may be something other than on or off. Which TBH I have never seen happen. It’s a very stable core integration.
It’s also worth pointing out that your solution also requires that nothing outside of home assistant can change the state of the heater. Or the input boolean will get out of sync.