json.html structure

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
YellowSky
Posts: 65
Joined: Tuesday 12 May 2015 12:09
Target OS: Raspberry Pi / ODroid
Domoticz version: Last
Location: Belgium
Contact:

json.html structure

Post by YellowSky »

Hi everyone,
i have a question about json structure.
In the wiki some of the sensor does not require nvalue=0 in the url.

For example the counter require:

Code: Select all

/json.htm?type=command&param=udevice&idx=idx&svalue=COUNTER
But if i try:

Code: Select all

/json.htm?type=command&param=udevice&idx=idx&svalue=COUNTER&nvalue=0
The answer is the same and the counter is updated.

Therefore why some sensors does not require this nvalue? And I wonder if there is any trouble to put one.
Indeed some others sensors must be finished by a

Code: Select all

;0
. If not the wiki says there could be a problem of database.

Thank you
Last edited by YellowSky on Monday 12 March 2018 6:06, edited 2 times in total.
asjmcguire
Posts: 71
Joined: Saturday 13 July 2013 2:45
Target OS: Linux
Domoticz version: 3.5877
Location: Scotland
Contact:

Re: JSON structure

Post by asjmcguire »

OK - first it isn't the JSON structure, JSON is something different - it's just that the URL is json.html which is a bit confusing.

svalue = STRING value
nvalue = NUMBER value

Sensors that require ;0 are devices that store more than one value - eg a Temperature and Humidity sensor, when it is updated requires TEMP;HUM and obviously it can't be a number if it has ; in it so it has to be a svalue eg: svalue=18.7;85
AEOTEC ZStick, 11 ZWave Nodes, RFXCOMM, 50ish Byron Sockets.. HE851 (PIR), 2x HE852 (DoorContact)
WS2300, CM180, CC128, 2xTHGR122NX, 2xPiZeroW w/DS18B20, 8Ch 1W Relay Board.
8 Panasonic IP Cams, 1 16ch CCTV DVR + 15 CCTV Cams
YellowSky
Posts: 65
Joined: Tuesday 12 May 2015 12:09
Target OS: Raspberry Pi / ODroid
Domoticz version: Last
Location: Belgium
Contact:

Re: json.htlm structure

Post by YellowSky »

Thank you for this answer.
So if i send a non expected nvalue, there is no problem?
Post Reply

Who is online

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