I have a lot of virtual devices that I need to create a user variable for (for use with this script http://domoticz.com/forum/viewtopic.php?f=23&t=7512), but I would like to avoid to create them manually so I'm trying via LUA but am not able to get it to work:
Code: Select all
commandArray = {}
Domoticz_Devicename = 'Test Switch'
(devicechanged[''..Domoticz_Devicename..''] == 'On') then
if(uservariables[''..Domoticz_Devicename..''] == nil) then
commandArray['OpenURL'] = 'http://192.168.10.11:8080/json.htm?type=command¶m=saveuservariable&vname='..Domoticz_Devicename..'&vtype=2&vvalue=1'
Just figured out the issue is because of the 'blank' in Domoticz_Devicename
Are there a way to work around this - as it is possible to create user variables manually with 'blanks' in the name.
Thanks.
BR Søren