starting with my first LUA script, but it is not working as it should.
For taking a shower I want to create a script which will set the temperature of the thermostat in the bathroom on 23°C for 30minutes.
I'm using Devolo thermostats which are equal to danfoss thermostats.
The name of the thermostat is 'Heizung Bad' and the idx is 26.
Here is my script:
Code: Select all
commandArray = {}
local clock = os.clock
function sleep(n) -- seconds
local t0 = clock()
while clock() - t0 <= n do
end
end
print ("All based event fired");
-- loop through all the devices
for deviceName,deviceValue in pairs(otherdevices) do
if (deviceName == 'Jetzt Duschen') then
if deviceValue == "On" then
print("Bad heizen auf 23 Grad")
commandArray['Heizung Bad']='26|0|23' -- Idx | 0 | temp
sleep(1800) -- 30min warm
commandArray['Heizung Bad']='17'
commandArray['Jetzt Duschen']='Off'
print("Duschen fertig! Heizung aus!")
end
end
return commandArray
"Lua script execution exceeds maximum number of lines"
ok turning it off for testing...
But setting the tempeature to 23degree is also not working. Nothing changes on the thermostat.
idx is 26 on the devicelist and the name is "Heizung Bad"
Could you please help me?