Firstable, sorry for my English. My mother tongue is french.
I have a qubino ZMNHID1, which have a thermostat mode switch placed in the Utility Tab. This switch can take the values "On" or "Auto".
The problem is that, randomly, this switch changes from Auto to Off, which is not cool for a thermostat

I try to write a LUA script which change the state of this switch when it pass to off.
I am a newbie with LUA.
In LUA, the value of the Thermostat mode switch can be either 0 (Off) or 1 (Auto). The type is string.
Here is my simple script :
function delay_s(delay)
delay = delay or 1
local time_to = os.time() + delay
while os.time() < time_to do end
end
commandArray = {}
if devicechanged['Bureau_Thermostat_Mode'] == '0' then
Delay_s(5)
commandArray['Bureau_Thermostat_Mode']='1'
end
And... It doesnt work at all. The switch remains to 'Off'.
Any idea? I am stuck with this since 2 days...HELP!!!!!
Mike