hello i wanted to ask about http get toggle switches currently i use them to control a few stuff in an online game called rust to control smart switches (ingame item) how i have it set up atm is that when the toggle switch is on it sends an http get to a specific url and when its off it sends an http get to an other url now this set up works great but there is one flaw with it the toggle switch might be on in ha but the smart switch ingame might be off if turned off from ingame or in any other way so what i want to do is have the toggle in ha be synced with the ingame switch through an http get url that tells the status of the ingame switch i am not sure if this is possible
#HTTP get toggle switches
14 messages · Page 1 of 1 (latest)
Wow that was a long sentence.
But you need an automation to fetch the status periodically
so make an automation that uses http get to get the status of the switch via the url and depending on if it returns on or off turn on or off the toggle?
oh man thats going to be a lot of automations
2 per switch
also can i make these automations through the ui or do i need to make them in the config file
Make one pair in the UI first. Then once you are satisfied with them, use them as a basis to make a blueprint that you can just reuse the logic and sub in the relevant entities.
so i dont have to deal with the config file at all?
also how do i make a triger that fires when the http get changes
To make the initial pair, you can try doing it in the UI. But to convert the pair into blueprints, you'd need to write yaml.
I think you would need an automation that triggers regularly eg. Every 1min, to get the state of the switch. I.e. to poll the http endpoint, unless you can adjust the endpoint to push updates to HA?