error with domoticz.variables

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
bigpea
Posts: 91
Joined: Thursday 11 August 2016 12:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: IT
Contact:

error with domoticz.variables

Post by bigpea »

Hi all,
I have one problem with the instruction "domoticz.variables".

I take the value of one variable with the instrunction:

Code: Select all

allPromemoria = domoticz.variables('listaPromemoria').value
domoticz.log('allPromemoria: '..allPromemoria..'/', domoticz.LOG_DEBUG)
and the result is correct:
startTextmy NoteendTextstartData2017-10-18 16:14:00endData
after that, I execute the script and, at the end, I cancel the value in the user variable with this instruction:

Code: Select all

domoticz.variables('listaPromemoria').set('')
In the User Variable section of domoticz I can see that the value has been deleted:
Screenshot_1.png
Screenshot_1.png (9.37 KiB) Viewed 891 times
But at the next run of the script the log of the variable report the same value:
startTextmy NoteendTextstartData2017-10-18 16:14:00endData
In the user variable section the value is empty.
If I restart the raspberry all works fine until I insert new value in this variable.

Do you have any idea?
Thanks.
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: error with domoticz.variables

Post by dannybloe »

Ah, good catch. Indeed that's a bug.. Setting an empty string doesn't update the internal value caches. We'll fix it.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
bigpea
Posts: 91
Joined: Thursday 11 August 2016 12:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: IT
Contact:

Re: error with domoticz.variables

Post by bigpea »

Thanks. I solved, waiting the fix, setting it with a fake string.
Thanks!
bigpea
Posts: 91
Joined: Thursday 11 August 2016 12:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: IT
Contact:

Re: error with domoticz.variables

Post by bigpea »

One question, the lenght of the text (string type) in the domoticz.variables, have a max number of char?
I have some problem when I try to insert one String.
jvandenbroek
Posts: 37
Joined: Wednesday 12 March 2014 16:37
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: The Netherlands
Contact:

Re: error with domoticz.variables

Post by jvandenbroek »

bigpea wrote: Thursday 19 October 2017 21:00 One question, the lenght of the text (string type) in the domoticz.variables, have a max number of char?
I have some problem when I try to insert one String.
The limit is set to max 200 chars. Fix for this one (empty value) is coming soon ;)
bigpea
Posts: 91
Joined: Thursday 11 August 2016 12:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: IT
Contact:

Re: error with domoticz.variables

Post by bigpea »

Ok thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest