i have a "type: general, percentage" device called "wtw filter levensduur (9mnd)" that is logging a filter life usage
i want to send an email when filter is 50% used and 75% used
this is what i got:
Code: Select all
commandArray = {}
if devicechanged['wtw filter levensduur (9mnd)'] then
waarde = (tonumber(otherdevices_svalues["wtw filter levensduur (9mnd)"]))
if waarde == 50 then
commandArray[1]={['SendEmail'] = 'wtw filter#wtw filter is 50% vervuild, uitzuigen!#[email protected]' }
end
if waarde == 75 then
commandArray[1]={['SendEmail'] = 'wtw filter#wtw filter is 75% vervuild, bestel een nieuwe!#[email protected]' }
end
end
return commandArray
but nothing happens if i have 50% or 75%
i think the error must be in this part: waarde = (tonumber(otherdevices_svalues["wtw filter levensduur (9mnd)"])) but i dont know how to fix it
or is this some kind of loop prevention couse the ['wtw filter levensduur (9mnd)'] is updated by another script?????!!!!