JSON commands

Moderator: leecollings

Post Reply
Adso76
Posts: 20
Joined: Tuesday 28 August 2018 21:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

JSON commands

Post 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.
Domoticz Version: 4.9895 running on Raspberry Pi B 3+ (Raspbian). PCF8574 as input and output.
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: JSON commands

Post by Egregius »

You should use a code block, now the url is showed shortened.
Adso76
Posts: 20
Joined: Tuesday 28 August 2018 21:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: JSON commands

Post by Adso76 »

Code: Select all

http://192.168.1.5:8080/json.htm?type=command&param=switchlight&idx=2&switchcmd=On
Domoticz Version: 4.9895 running on Raspberry Pi B 3+ (Raspbian). PCF8574 as input and output.
User avatar
philchillbill
Posts: 399
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: JSON commands

Post by philchillbill »

Your syntax looks correct. Are you sure your idx is relevant?
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
Adso76
Posts: 20
Joined: Tuesday 28 August 2018 21:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: JSON commands

Post 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.
Domoticz Version: 4.9895 running on Raspberry Pi B 3+ (Raspbian). PCF8574 as input and output.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest