Hi there,
Would like some help please?
I am trying to create a simple slider buttom (like for a light switch) on the front page called “Curtain”. A bit complicated for me, but I recon not for some gugu’s here here is the logic I need:
1: At HASSIO startup, read status of curtain (open/closed) from a JSON the status string returned from https request, which will be something like http://10.0.0.1:222/json/id=1 - this will return a value in the JSON which will either be “open” or “closed” (a string value) - so I probabley need to parse the JSON as it will return other data too.
2: Create a button/slider on the main fromt end called “Curtain1” and set status to what was returned n step 1 (open/closed)
3: When the above button is pressed/slided/turned on, I would like it to make a call to the device on the internal network (something like: http://10.0.0.1:222/json/id=1$action=open) and then keep the poll the curtain device after 5 seconds for the status (Like the JSON value obtained in step 1) and set the button to off (if the value is acually off)
4: Same as above, but for the for the closed bit
Anyone have any ideas on where to start with this please?
Thanks