Hey everyone I would like to set that state of a switch in an automation I have. So I have a soundbar that turns off after nothing is being played through it after x. The soundbar is a dumb sound bar and is only IR. So I want to tell HA that the soundbard is off otherwise it still thinks it is on. So the automation would be something like if media player changes from playing to idle or off (might have to do two automations) for x minutes then set soundbar state to off. So does anyone know how to set the state of a switch?
calling the switch.turn_off service will set the state of the switch to off, but it will also execute the turn_off command.
This might, (or might not) be an issue for your implementation.
Yeah I know how to turn off a switch this won’t work for me since turning on and off is the same IR code and could actually turn it on. So I just need to set the state. You can do it in the developer settings in the GUI but I want to know how to do this in a script or automation. Thanks.
Have you found any solution? I am looking to do the same but can’t find any solution how to change the state of my broadlink without calling the service at the same time. Since the ON and OFF commands are the same it turns off the switch on HA but turns the speaker back on.
the speaker goes off soon after anyway as it is not in use but the solution is not as tidy as I wanted it to be.
Curious if anyone figured out the answer for this as I’m trying to do the same thing: set the state of a input_boolean switch to off without actually triggering the service ‘turn_off’
hello, maybe i am necroposting but, this is exactly what i want to do. it’s a bit starnge that there’s no solution… @phil1688 did you find out a solution?