the script I send below, verifies an energy value and sends a message by pushover.
The problem is that if the value is always above, every minute sends a notification! Is there any way to send in this script for example, 3 notifications max ? And not minute by minute.
Ty
Code: Select all
return {
on =
{
timer =
{
'every minute',
}
},
execute = function(domoticz)
local floatFormat = '%d*%.*%d*'
local rawEnergiaConsumida = domoticz.devices('Energia Consumida').rawData[1]
local EnergiaConsumida = tonumber(string.match(rawEnergiaConsumida, floatFormat))
if EnergiaConsumida >= 3200 then
local textmensagem = "A voltagem " .. EnergiaConsumida .. " Watt, está muito ALTA! O disjuntor pode disparar!"
domoticz.notify("⚡ VOLTAGEM ELECTRICA", textmensagem , domoticz.PRIORITY_HIGH, domoticz.SOUND_COSMIC, "" , domoticz.NSS_PUSHOVER)
end
end
}