I think that the Switchmate component has an issue where instead of turning things on or off , it toggles the switch instead.
This is what I have seen:
-Someone switches the switchmate on manually at the device
- someone then goes to Homeassistant and toggles the switch in the device on
This results in the switch being the opposite of what it is in home assistant.
In the past when we had to use the script below:
when the swtichmate device was on then using homeassistant to turn the device on would not do anything until the device was turned off.
To be clear, I am not asking for homeassistant to track the status of the light but to sent the correct command not just to toggle the swtich