31.10.2022, 07:09
event.getvalue() does not accept any arguments. You need to use grp.getvalue() for all other groups than the event source.
Your script blocks multiple "on" messages but does not block "off" messages. Use this instead:
Your script blocks multiple "on" messages but does not block "off" messages. Use this instead:
Code:
require('user.telegram')
key = 'boiler_status'
curr = event.getvalue()
prev = storage.get(key)
if curr ~= prev then
message = curr and 'boiler on' or 'boiler off'
telegram(message)
storage.set(key, curr)
end