i have 4 temperature sensor to monitor and i created 4 setpoint to set the target temperature. (inside scripts now there are only 3)
i would like to receive (when reach the target) 3 notifications in the first minute....then after 2 minute i would like to receive again just one notification.
first of all i try to use the temperature sensor notification but, in this case i can set only one notification when the condition of temperature set are been met.
so i try with dzvent:
Code: Select all
-- script for smart BBQ thermometer with 4 probes
local scriptVar = 'BBQ TERMOMETER'
return
{
on =
{
timer =
{
-- 'at 07:30',
--'at 09:00',
},
devices = { 'Carne1_BBQ', 'Carne2_BBQ', 'Carne3_BBQ' -- temperature
},
},
logging =
{
level = domoticz.LOG_DEBUG, -- set to LOG_ERROR when tested and OK and domoticz.LOG_DEBUG when debug
},
execute = function(dz, item)
local measuredTemp1 = dz.utils.round(dz.devices('Carne1_BBQ').temperature,1)
local measuredTemp2 = dz.utils.round(dz.devices('Carne2_BBQ').temperature,1)
local measuredTemp3 = dz.utils.round(dz.devices('Carne3_BBQ').temperature,1)
local flapPrevention = 0.2
local offTemperature1 = measuredTemp1 - flapPrevention
local offTemperature2 = measuredTemp2 - flapPrevention
local offTemperature3 = measuredTemp3 - flapPrevention
local setPoint1 = dz.devices("Target1_BBQ").setPoint
local setPoint2 = dz.devices("Target2_BBQ").setPoint
local setPoint3 = dz.devices("Target3_BBQ").setPoint
_G.moduleLabel = _G.moduleLabel or scriptVar
_G.logMarker = _G.moduleLabel -- set logmarker to scriptname (dzVents >= 2.4.29)
if offTemperature1 >= setPoint1 then
dz.notify('BBQ TERMOMETER. ',item.name .. ' SENSORE1 => done at ', item.value .. '°C', dz.PRIORITY_NORMAL,dz.SOUND_DEFAULT, '' , dz.NSS_HTTP)
end
if offTemperature2 >= setPoint2 then
dz.notify('BBQ TERMOMETER. ',item.name .. ' SENSORE2 => done at ', item.value .. '°C', dz.PRIORITY_NORMAL,dz.SOUND_DEFAULT, '' , dz.NSS_HTTP)
end
if offTemperature3 >= setPoint3 then
dz.notify('BBQ TERMOMETER. ',item.name .. ' SENSORE3 => done at ', item.value .. '°C', dz.PRIORITY_NORMAL,dz.SOUND_DEFAULT, '' , dz.NSS_HTTP)
end
end
}
1) not succed on set the notification that i would like to have: 3 notifications in the first minute, then after 2 minute,just one notification (the last one)
2) using the script above, it is triggered every time that the sensors change their status, so when they are above the setpoint target they continue to send me a notification without stopping....
thanks