I have a small Script, that in the first Step, should send me a Mail, when one of the Temp Sensors reach a hight Temperature:
Code: Select all
return {
active = true,
on = { devices = { 'Tempsensor1',
'Tempsensor2,
'Tempsensor3',
'Tempsensor4',
'Tempsensor5',
'Tempsensor6',
'Tempsensor7',
'Tempsensor8',
'Tempsensor9,
'Tempsensor10'}},
execute = function(domoticz, device, email)
if
domoticz.devices('Tempsensor1').temperature >= 60
or
domoticz.devices('Tempsensor2').temperature >= 60
or
domoticz.devices('Tempsensor3').temperature >= 60
or
domoticz.devices('Tempsensor4').temperature >= 60
or
domoticz.devices('Tempsensor5').temperature >= 60
or
domoticz.devices('Tempsensor6').temperature >= 60
or
domoticz.devices('Tempsensor7').temperature >= 60
or
domoticz.devices('Tempsensor8').temperature >= 60
or
domoticz.devices('Tempsensor9').temperature >= 60
or
domoticz.devices('Tempsensor10').temperature >= 45
then domoticz.devices('Feueralarm').updateAlertSensor(domoticz.ALERTLEVEL_RED, 'Feueralarm!!! prüfen und evakuieren!')
domoticz.email('Feueralarm Temperatursensoren', 'Achtung stark erhöhte Temperaturwerte von ' .. device.name .. ' ' .. device.temperature .. ' °C , es könnte auch ein Feuer sein, prüfen und evakuieren!', '[email protected]')
else domoticz.devices('Feueralarm').updateAlertSensor(domoticz.ALERTLEVEL_GREEN, 'alle Temperatursensoren im grünen Bereich, alles OK')
end
end
}
Now all Sensors that are over 20° sends me a single Alarm Mail.
Why?
I just want to receive it only from the affected one.
Hope you understand what my Problem is and maybe you see my Error, I can't find it.
Please help