It can't be any different than a physical sensor because the logger doesn't distinguish between them for any device type.
It took some trial & error but I got it. I changed
else if ('motion' == evt.name) { // Motion: Calculate a binary value (active = 1, inactive = 0)
unit = 'motion'
value = '"' + value + '"'
valueBinary = ('active' == evt.value) ? '1i' : '0i'
data += ",unit=${unit} value=${value},valueBinary=${valueBinary}"
}
To
else if ('motion' == evt.name) { // Motion: Calculate a boolean value (active = true, inactive = false)
type = 'bool'
boolean valueBoolean = ('active' == evt.value) ? true : false
data += ",type=${type} value=${valueBoolean}"
}
And it's working like I want now.
Many thanks to all for suggestions and guidance!
1 Like
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.