Requesting help with Item state via HTTP + HTTP Controls

Hi All,

Done lots of reading and still can’t come right…
I am using a 2 Way LightSwitch, so it is NB for me to determine status of the input of the IO device.

I use the following URL to determine item state:
http://IP:port/sinput0.html
This would give ON or OFF inside a webpage.

Then I can use
http://IP:Port/index.html?O1=1
Which would turn the device on
http://IP:Port/index.html?O1=0
Would turn the device off.

How do I query the state of the item upon startup?
How do I make a decision to turn ON or OFF based on the input status of the IO?
Thanking you very much for your assistance!

Have you read the documentation for the HTTP binding? I believe it can answer your questions. :slightly_smiling:

I have tried and received no success. I am not a programmer but trying my best to pick things up…
I am able to toggle the output but am not able to read the input state and make a decision based on that…

Are there any examples for something like this?

There are many examples on the HTTP binding wiki page, but I’m not sure if or how your objective is different from what is given there.

I am also looking at the HTTP Binding for control reading/writing to a device

I am using

Switch IPpower
{ http=">[ON:POST:http://admin:12345678@10.0.0.116/Set.cmd?cmd=setpower+p61=1] >[OFF:POST:http://admin:12345678@10.0.0.116/Set.cmd?cmd=setpower+p61=0]" }

if i use the url and Set.cmd as above in a browser, it works as expected . yet the version above does not, obviously something is wrong