The mode switch is normally a switch to control 2 lights and thus has 2 codes with the status on or off. the left side; home and sleep, the right side; away and holiday.
when I click on the home button the switch gives the on ‘’ signal to HA, and switches home mode on.
the night mode must be set with the off signal from the switch.
when I press home, the status changes to home, I now press for example sleep, switches off the home status, but the status of sleep does not turn on, so also the same happens at away and holiday. I can turn on ‘away’ but not holiday.
@Tomahawk thanks for the code above. I literally started on HA this evening (bought an RPI 4 4GB version and got HA installed along with LIFX and Hue bulbs and sensors) so I’m a complete newbie and getting to grips with HA. I have come from SmartThings and then Hubitat (both of which had modes built in to make life easier). My question is - if the files don’t exist, do I just go ahead and create them? Or does the entire code snippet go into configuration.yaml?
I know this is an old thread but the information still applies. I’d like to thank Tomahawk for this. I implemented it as a controller for the evaporative cooler in my house. I needed to be able to select one of three available fan speeds and no two speeds are allowed to be selected at once. I modified Tomahawk’s code to suit my needs and it worked perfectly, first go!