06.07.2015, 06:04
Here's an improved version where you don't have to set data type manually. The easiest way for this script to work it to map it on a tag instead of group address. This way you only need a single script for all group adresses that require read-response.
Code:
-- only reply to group read requests
if event.type == 'groupread' then
obj = grp.find(event.dst)
-- object found and has datatype set
if obj and obj.decoded then
grp.response(event.dst, obj.value, obj.datatype)
end
end