Below is a part of my script_device code in lua where b1 and b2 are user variables
I can easily read them but I cannot change them
Code: Select all
...
b1 = 'Batterie1'
b2 = 'Batterie2'
------------------------------------------------------------------------------
commandArray = {}
if (devicechanged[actb1]) then
print("B1 : " .. tostring(devicechanged[actb1]) .. " User VarB1 = " .. uservariables[b1])
if( (tostring(devicechanged[actb1]) == "EN SERVICE") and (uservariables[b1] == 0) ) then
print ("En service et B1 == 0")
commandArray['Variable:b1'] = '1'
...
Code: Select all
commandArray['Variable:b1'] = '1'
An idea ?
Thanks for your help