Help with buttom making http request for curtain open/close

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 :slight_smile: 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

Look at the components coomand line cover and template cover.

I looked into this but I am facing a massive obstacle where I cannot figure out how to call the remote device API via the http://10.0.0.1:222/json/id=1%24action=open provided by the device. A simple switch would do, just to test, but even that does not work (see request for help at Help with switch please)

Found the solution from the community, without them I would NEVER have found the solution: See here: Help with switch please