JSON commands

Post Reply
Adso76
Posts: 6
Joined: Tuesday 28 August 2018 21:09
Target OS: -
Domoticz version:
Contact:

JSON commands

Post by Adso76 » Tuesday 28 August 2018 21:15

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.

User avatar
Egregius
Posts: 2715
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: Beta
Location: Beitem, BE
Contact:

Re: JSON commands

Post by Egregius » Tuesday 28 August 2018 22:37

You should use a code block, now the url is showed shortened.

Adso76
Posts: 6
Joined: Tuesday 28 August 2018 21:09
Target OS: -
Domoticz version:
Contact:

Re: JSON commands

Post by Adso76 » Wednesday 29 August 2018 9:27

Code: Select all

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

User avatar
philchillbill
Posts: 205
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: JSON commands

Post by philchillbill » Wednesday 29 August 2018 9:57

Your syntax looks correct. Are you sure your idx is relevant?
NUC/Ubuntu, Evohome Heating + HGI80, Evohome Security, 4x HikVision IP cams, Aeotec, Neo & Fibaro Z-Wave, Logitech Media Server (on Synology DS916+), 10x SqueezeBox, Kodi, Harmony Hub, 5x Amazon Echo, HA-Bridge, Hue.

Adso76
Posts: 6
Joined: Tuesday 28 August 2018 21:09
Target OS: -
Domoticz version:
Contact:

Re: JSON commands

Post by Adso76 » Wednesday 29 August 2018 11:00

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests