But now In Apple Home app I see a classic switch ON/OFF: the problem is when I switch it to ON, it remain s in ON position and send always wake-up packages to my TV…
actual switch.tv_wol already is stateless: every time I switch on toggle, it return itself on OFF state in HA…but it don’t happen also in Apple Home app…
state of switches on Apple Home aren’t automatically synced with HA?
I hear you, and that sounds odd. The states should be synced, as long the state changes are emitted.
I don’t have such buttons like you, but I do have some scripts that emulate IR remote control button presses — scripts like Tom suggested. Those work fine in my case.
What you can do to test this, is to make an input boolean, wrap it in a script to turn it on, wait, and turn it off. Check that this then works in HomeKit by exposing the script to it. If that works, there must be another issue.
Figured I’d chime in, in case it helps anyone else. But I wanted to have my Harmony Hub send a command to my air purifier as a stateless or toggle button in Homekit as well. I was able to achieve this by creating a ‘repeat’ script with a count of 1. So it automatically turns off or reverts after completing the action. Below is the yaml copied from the integration GUI: