Page 1 of 1
API - When to use nvalue and when svalue?
Posted: Monday 29 May 2017 19:57
by maho2nd
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.).
Re: API - When to use nvalue and when svalue?
Posted: Monday 29 May 2017 21:41
by maho2nd
Thanks!
Re: API - When to use nvalue and when svalue?
Posted: Saturday 10 November 2018 13:06
by tvurce
I am interested too...
Re: API - When to use nvalue and when svalue?
Posted: Saturday 10 November 2018 13:51
by waaren
nValue = numeric ( one value -- INTEGER DEFAULT 0)
sValue = string ( multiple values -- VARCHAR(200) DEFAULT null )
Re: API - When to use nvalue and when svalue?
Posted: Monday 12 November 2018 10:08
by tvurce
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...)
Re: API - When to use nvalue and when svalue?
Posted: Monday 12 November 2018 10:17
by febalci
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
Re: API - When to use nvalue and when svalue?
Posted: Monday 12 November 2018 10:43
by emme
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)