rrozema wrote: Friday 20 March 2020 9:46
I would suggest to use dzVents if you're already working on your lua skills. dzVents scripts are also written in lua, but with a lot of the boilerplate code already done by dzVents for you. Here's an (UNTESTED!) example to get you started:
Ok I have used/test your script. It did not work at start. so I slightly modified it to:
Code: Select all
-- Define Default room tempature
local defaultTemp = 22; -- Degrees
return {
on = {
devices = {
'KamerTemp Set'
}
},
execute = function(domoticz, device)
if (device.name == 'KamerTemp Set' and tonumber(device.setPoint) >= 25) then
print("RoomTemp set to:" .. tonumber(device.setPoint) .. " Degrees")
device.updateSetPoint( defaultTemp )
domoticz.notify('Reset Room Temp','Temp was set at '.. tostring(device.setPoint) .. ' Degrees' , domoticz.PRIORITY_NORMAL,nil,nil,domoticz.NSS_PUSHBULLET)
end
end
}
Now it does work, but Notifications still comes in twice..
Seems to me this is more a PushBullet problem then Domoticz
I say this because of the log output.
Code: Select all
Mar 20 21:11:48 domoticz domoticz[21654]: 2020-03-20 21:11:48.109 Status: dzVents: Info: Handling events for: "KamerTemp Set", value: "25.50"
Mar 20 21:11:48 domoticz domoticz[21654]: 2020-03-20 21:11:48.109 Status: dzVents: Info: ------ Start internal script: Reset_Room_Temp: Device: "KamerTemp Set (OpenTherm)", Index: 38
Mar 20 21:11:48 domoticz domoticz[21654]: 2020-03-20 21:11:48.109 Status: dzVents: RoomTemp set to:25.5 Degrees
Mar 20 21:11:48 domoticz domoticz[21654]: 2020-03-20 21:11:48.110 Status: dzVents: Info: ------ Finished Reset_Room_Temp
Mar 20 21:11:48 domoticz domoticz[21654]: 2020-03-20 21:11:48.116 Status: EventSystem: Script event triggered: /home/domoticz/domoticz/dzVents/runtime/dzVents.lua
Mar 20 21:11:48 domoticz domoticz[21654]: 2020-03-20 21:11:48.175 Status: OTGW: Setting Room SetPoint to: 22.0
Mar 20 21:11:48 domoticz domoticz[21654]: 2020-03-20 21:11:48.198 Status: OTGW: TT: 22.00
Mar 20 21:11:48 domoticz domoticz[21654]: 2020-03-20 21:11:48.487 Status: dzVents: Info: Handling events for: "KamerTemp Set", value: "22"
Mar 20 21:11:48 domoticz domoticz[21654]: 2020-03-20 21:11:48.488 Status: dzVents: Info: ------ Start internal script: Reset_Room_Temp: Device: "KamerTemp Set (OpenTherm)", Index: 38
Mar 20 21:11:48 domoticz domoticz[21654]: 2020-03-20 21:11:48.488 Status: dzVents: Info: ------ Finished Reset_Room_Temp
Mar 20 21:11:48 domoticz domoticz[21654]: 2020-03-20 21:11:48.808 Status: dzVents: Info: Handling events for: "KamerTemp Set", value: "22.00"
Mar 20 21:11:48 domoticz domoticz[21654]: 2020-03-20 21:11:48.809 Status: dzVents: Info: ------ Start internal script: Reset_Room_Temp: Device: "KamerTemp Set (OpenTherm)", Index: 38
Mar 20 21:11:48 domoticz domoticz[21654]: 2020-03-20 21:11:48.809 Status: dzVents: Info: ------ Finished Reset_Room_Temp
Mar 20 21:11:49 domoticz domoticz[21654]: 2020-03-20 21:11:49.071 Status: dzVents: Info: Handling events for: "KamerTemp Set", value: "22"
Mar 20 21:11:49 domoticz domoticz[21654]: 2020-03-20 21:11:49.071 Status: dzVents: Info: ------ Start internal script: Reset_Room_Temp: Device: "KamerTemp Set (OpenTherm)", Index: 38
Mar 20 21:11:49 domoticz domoticz[21654]: 2020-03-20 21:11:49.071 Status: dzVents: Info: ------ Finished Reset_Room_Temp
Mar 20 21:11:49 domoticz domoticz[21654]: 2020-03-20 21:11:49.303 Status: dzVents: Info: Handling events for: "KamerTemp Set", value: "22.00"
Mar 20 21:11:49 domoticz domoticz[21654]: 2020-03-20 21:11:49.303 Status: dzVents: Info: ------ Start internal script: Reset_Room_Temp: Device: "KamerTemp Set (OpenTherm)", Index: 38
Mar 20 21:11:49 domoticz domoticz[21654]: 2020-03-20 21:11:49.303 Status: dzVents: Info: ------ Finished Reset_Room_Temp
Mar 20 21:11:49 domoticz domoticz[21654]: 2020-03-20 21:11:49.536 Status: dzVents: Info: Handling events for: "KamerTemp Set", value: "22.00"
Mar 20 21:11:49 domoticz domoticz[21654]: 2020-03-20 21:11:49.536 Status: dzVents: Info: ------ Start internal script: Reset_Room_Temp: Device: "KamerTemp Set (OpenTherm)", Index: 38
Mar 20 21:11:49 domoticz domoticz[21654]: 2020-03-20 21:11:49.536 Status: dzVents: Info: ------ Finished Reset_Room_Temp
Mar 20 21:11:49 domoticz domoticz[21654]: 2020-03-20 21:11:49.811 Status: dzVents: Info: Handling events for: "KamerTemp Set", value: "22.00"
Mar 20 21:11:49 domoticz domoticz[21654]: 2020-03-20 21:11:49.811 Status: dzVents: Info: ------ Start internal script: Reset_Room_Temp: Device: "KamerTemp Set (OpenTherm)", Index: 38
Mar 20 21:11:49 domoticz domoticz[21654]: 2020-03-20 21:11:49.811 Status: dzVents: Info: ------ Finished Reset_Room_Temp
Mar 20 21:11:55 domoticz domoticz[21654]: 2020-03-20 21:11:55.952 Status: dzVents: Info: Handling events for: "KamerTemp Set", value: "22.00"
Mar 20 21:11:55 domoticz domoticz[21654]: 2020-03-20 21:11:55.953 Status: dzVents: Info: ------ Start internal script: Reset_Room_Temp: Device: "KamerTemp Set (OpenTherm)", Index: 38
Mar 20 21:11:55 domoticz domoticz[21654]: 2020-03-20 21:11:55.953 Status: dzVents: Info: ------ Finished Reset_Room_Temp
Mar 20 21:12:26 domoticz domoticz[21654]: 2020-03-20 21:12:26.016 Status: dzVents: Info: Handling events for: "KamerTemp Set", value: "22.00"
Mar 20 21:12:26 domoticz domoticz[21654]: 2020-03-20 21:12:26.017 Status: dzVents: Info: ------ Start internal script: Reset_Room_Temp: Device: "KamerTemp Set (OpenTherm)", Index: 38
I do see that the dzVents script is running every 30 sec. (have not looked it up but this seems normal behaviour)
I do not see the notification being sent twice..