Page 1 of 1

Newbe question

Posted: Saturday 04 November 2017 21:46
by BartSr
Hi!
just started understandng Lua scipts.
I took some from the web to study them.
Now I like to experiment with UserVariables.
But how create/store.
I read about json but don't understand that yet.
Any suggestion? URL with examples to study?
TIA
-Bart

Re: Newbe question

Posted: Saturday 04 November 2017 23:27
by jannl
Urls with json examples are in the Domoticz wiki. Propably exactly what you need

Re: Newbe question

Posted: Sunday 05 November 2017 18:09
by BartSr
Thanks. Going to study the code.
KR
-Bart

Re: Newbe question

Posted: Sunday 05 November 2017 18:58
by niki_lauda
BartSr wrote: Sunday 05 November 2017 18:09 Thanks. Going to study the code.
KR
-Bart
Create a variable Counter

Use
a=tonumber(uservariables['Counter']) to extract a variable
Use
commandArray['Variable:Counter'] = tostring(Counter) to store a variable