So I’ve got an MQTT switch which is really clear in the front end whether it’s on/off and how to toggle its state.
I’ve got a command line switch which is the opposite. I don’t know which icon signifies on and off and in addition it has no means of displaying its state. I realise I would have to periodically ‘send’ the state from the host system if I wanted it to be up to date between HA reboots or if the state changed on the host system and NOT by command from Hass.
But is there any way I can make a command line switch display and work as an MQTT toggle switch?
Thanks - I’d like to go the correct route - but does this mean I’d have to write a script that is constantly running on the source host waiting to answer the command_state query?
hmmm, thanks Tinkerer. My script at the moment returns “Value: NIGHT” or “Value: DAY” - is there some search term I should be Googling for how to convert those strings into binary? THANKS!
I want to join this thread. I had the same thing to do and following your tips I made it. Now I have command-line switch looking like real one and its state even refresh but very slow. I mean in very long tome after change is made from HA external device.
Is there any way to set “refresh time”? Or is any way to introduce weebhook to refresh “manually” its state by url call by external device?