What does nvalue and svalue represent?
In the JSON-API sometimes the nvalue is used (Air quality) and most times the svalue is used (Temperature, etc.).
API - When to use nvalue and when svalue? Topic is solved
Moderators: leecollings, remb0
-
- Posts: 30
- Joined: Saturday 27 October 2018 19:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: API - When to use nvalue and when svalue?
I am interested too...
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: API - When to use nvalue and when svalue?
nValue = numeric ( one value -- INTEGER DEFAULT 0)
sValue = string ( multiple values -- VARCHAR(200) DEFAULT null )
sValue = string ( multiple values -- VARCHAR(200) DEFAULT null )
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 30
- Joined: Saturday 27 October 2018 19:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: API - When to use nvalue and when svalue?
Yes. But in a lot of examples, there are numbers throwing to Domoticz with sValue. This is little bit confusing. But anyway, if one send number to Domoticz in sValue, it seems working (graphs, averages etc are calculated OK...)
-
- Posts: 331
- Joined: Monday 03 July 2017 19:58
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: API - When to use nvalue and when svalue?
You can find out when to use svalue or nvalue according to the device type in this page:
https://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s
https://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s
- emme
- Posts: 909
- Joined: Monday 27 June 2016 11:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Location: Milano, Italy
- Contact:
Re: API - When to use nvalue and when svalue?
nValue (Numeric Value) is only integer and is used command option for existing devices:
ON(1)
OFF(0)
STOP(17)
DIM LEVEL(2)
(I think there are more, but up to know I know these)
any other value should be set to sValue (String Value)
ON(1)
OFF(0)
STOP(17)
DIM LEVEL(2)
(I think there are more, but up to know I know these)
any other value should be set to sValue (String Value)
The most dangerous phrase in any language is:
"We always done this way"
"We always done this way"
Who is online
Users browsing this forum: No registered users and 1 guest