What about a ‘complex object’? For example the ANALOG_SENSOR item has a few components inside it. It listens for xap temperature values, and this can be queried through $object->temperature. The actual state is user defined.
As this water sensor still isn’t that straightforward (it seems non-deterministic what ON messages are sent to group 1 and then to group 2), An object that is set to wet or dry (that can be set by manual methods — to allow web control or script control) that is also set by insteon ON messages. Since mine has a reliable heartbeat, having a $object->heartbeat method would be good to test each New_minute to see if the battery is dead.
This approach might be regressive based on messages on the list over the past few months about having more simple objects rather than fewer complex ones...
That said, in absence of anything else, this is probably the type of usercode I’d sketch up - a generic item set to wet or dry that changes based on group 1 messages from a water sensor as a triggerlinc. I’d also set up a 25 hour timer based on heartbeat messages. This would work for my use, but I’m wondering if something more robust might be useful as these leak sensors are cheap and I think quite useful.
Any other ideas or suggestions from those that have these sensors?