API - When to use nvalue and when svalue? Topic is solved

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.
Post Reply
maho2nd
Posts: 3
Joined: Wednesday 24 May 2017 0:13
Target OS: Raspberry Pi
Domoticz version:
Contact:

API - When to use nvalue and when svalue?

Post by maho2nd » Monday 29 May 2017 19:57

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.).

maho2nd
Posts: 3
Joined: Wednesday 24 May 2017 0:13
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: API - When to use nvalue and when svalue?

Post by maho2nd » Monday 29 May 2017 21:41

Thanks!

tvurce
Posts: 21
Joined: Saturday 27 October 2018 19:12
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: API - When to use nvalue and when svalue?

Post by tvurce » Saturday 10 November 2018 14:06

I am interested too...

User avatar
waaren
Posts: 1351
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: API - When to use nvalue and when svalue?

Post by waaren » Saturday 10 November 2018 14:51

nValue = numeric ( one value -- INTEGER DEFAULT 0)
sValue = string ( multiple values -- VARCHAR(200) DEFAULT null )
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

tvurce
Posts: 21
Joined: Saturday 27 October 2018 19:12
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: API - When to use nvalue and when svalue?

Post by tvurce » Monday 12 November 2018 11:08

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...)

febalci
Posts: 353
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: API - When to use nvalue and when svalue?

Post by febalci » Monday 12 November 2018 11:17

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

User avatar
emme
Posts: 957
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: API - When to use nvalue and when svalue?

Post by emme » Monday 12 November 2018 11:43

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)
The most dangerous phrase in any language is:
"We always done this way"

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests