Page 1 of 1

JSON commands

Posted: Tuesday 28 August 2018 21:15
by Adso76
Hi,
Whan I type in a browces command:
http://192.168.1.5:8080/json.htm?type=c ... itchcmd=On

I got response:

{
"status" : "OK",
"title" : "SwitchLight"
}

However, it doesn't change the state of the switch in Domoticz. What I do wrong?

Thanks.

Re: JSON commands

Posted: Tuesday 28 August 2018 22:37
by Egregius
You should use a code block, now the url is showed shortened.

Re: JSON commands

Posted: Wednesday 29 August 2018 9:27
by Adso76

Code: Select all

http://192.168.1.5:8080/json.htm?type=command&param=switchlight&idx=2&switchcmd=On

Re: JSON commands

Posted: Wednesday 29 August 2018 9:57
by philchillbill
Your syntax looks correct. Are you sure your idx is relevant?

Re: JSON commands

Posted: Wednesday 29 August 2018 11:00
by Adso76
Thanks! Originally I took IDX from Setup / hardware, when I looked at Setup / devices I found out that my device has different IDX there. After changing JSON command works fine!
BTW It's confusing that device has different IDX than hardware connected with this device.