i'm new with dzvents. In my First Script i want a time limitation of the Setpoint. When the Setpoint over a specific temperatur set it should be back to the specific temperatur.
My Problem is: When I set the Setpoint over the temperatur they write the uservariable in Time, but after 2-3 Minutes go back to orginal temperatur.
Where is my mistake?
Here is the mini script:
Code: Select all
--Script zum Überwachden der Heizung im Bad, getriggert nach dem Thermostat oder Timer
return {
on = {
devices = {
34
},
},
execute = function(domoticz,device)
local now = os.date('%H')+1 ..':'.. os.date('%M')
local BadHeizungThermo = domoticz.devices(34)
local BadHeizungValue = tonumber(BadHeizungThermo.state)
local HeizungausTemp = domoticz.variables('Heizungaus').value
local BadHeizungTime = domoticz.variables('HeizungBad')
if BadHeizungValue ~= HeizungausTemp and BadHeizungTime.value == '00:00' then
domoticz.log('Heizung wurde eingeschaltet. Max. 1 Stunde an',domoticz.LOG_INFO)
domoticz.log('Heizungbadzeit:'..now..' BadHeizungTime='..BadHeizungValue)
BadHeizungTime.set(now)
elseif BadHeizungTime.value <= now and BadHeizungTime ~= '00:00' then
domoticz.log('Bad Heizung wird ausgeschaltet und Timer zurückgestellt',domoticz.LOG_INFO)
domoticz.log('Heizungbadzeit:'..BadHeizungTime.value..'BadHeizungtemperatur:'..BadHeizungValue,domoticz.LOG_INFO)
BadHeizungTime.set('00:00')
BadHeizungThermo.updateSetPoint(HeizungausTemp)
end
end
}
Code: Select all
2018-11-01 11:06:02.729 Status: dzVents: Info: Handling events for: "Bad Heizung", value: "17.00"
2018-11-01 11:06:02.729 Status: dzVents: Info: ------ Start internal script: Bad_Heizung_neu: Device: "Bad Heizung (Razberry)", Index: 34
2018-11-01 11:06:02.730 Status: dzVents: Info: Bad Heizung wird ausgeschaltet und Timer zurückgestellt
2018-11-01 11:06:02.730 Status: dzVents: Info: Heizungbadzeit:00:00BadHeizungtemperatur:17
2018-11-01 11:06:02.730 Status: dzVents: Info: ------ Finished Bad_Heizung_neu
2018-11-01 11:06:02.809 Status: Set UserVariable HeizungBad = 00:00
2018-11-01 11:06:03.020 Status: dzVents: Info: Handling events for: "Bad Heizung", value: "18.00"
2018-11-01 11:06:03.020 Status: dzVents: Info: ------ Start internal script: Bad_Heizung_neu: Device: "Bad Heizung (Razberry)", Index: 34
2018-11-01 11:06:03.021 Status: dzVents: Info: Heizung wurde eingeschaltet. Max. 1 Stunde an
2018-11-01 11:06:03.021 Status: dzVents: Info: Heizungbadzeit:12:06 BadHeizungTime=18
2018-11-01 11:06:03.021 Status: dzVents: Info: ------ Finished Bad_Heizung_neu
2018-11-01 11:06:03.093 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2018-11-01 11:06:03.132 Status: Set UserVariable HeizungBad = 12:06
2018-11-01 11:06:35.212 (Razberry) Temp (Temperature)
2018-11-01 11:06:58.355 (Razberry) Thermostat (Esszimmer Heizung)
2018-11-01 11:07:03.443 (Razberry) Thermostat (Bad Heizung)
2018-11-01 11:07:03.721 (Razberry) Thermostat (Bad Heizung)
2018-11-01 11:07:03.582 Status: dzVents: Info: Handling events for: "Bad Heizung", value: "21.00"
2018-11-01 11:07:03.582 Status: dzVents: Info: ------ Start internal script: Bad_Heizung_neu: Device: "Bad Heizung (Razberry)", Index: 34
2018-11-01 11:07:03.583 Status: dzVents: Info: Bad Heizung wird ausgeschaltet und Timer zurückgestellt
2018-11-01 11:07:03.583 Status: dzVents: Info: Heizungbadzeit:12:06BadHeizungtemperatur:21
2018-11-01 11:07:03.583 Status: dzVents: Info: ------ Finished Bad_Heizung_neu
2018-11-01 11:07:03.664 Status: Set UserVariable HeizungBad = 00:00
2018-11-01 11:07:03.881 Status: dzVents: Info: Handling events for: "Bad Heizung", value: "17.00"
2018-11-01 11:07:03.881 Status: dzVents: Info: ------ Start internal script: Bad_Heizung_neu: Device: "Bad Heizung (Razberry)", Index: 34
2018-11-01 11:07:03.882 Status: dzVents: Info: Bad Heizung wird ausgeschaltet und Timer zurückgestellt
2018-11-01 11:07:03.882 Status: dzVents: Info: Heizungbadzeit:00:00BadHeizungtemperatur:17
2018-11-01 11:07:03.882 Status: dzVents: Info: ------ Finished Bad_Heizung_neu
2018-11-01 11:07:03.985 Status: Set UserVariable HeizungBad = 00:00