Insteon Leak Sensor (2852-222) - Heartbeat Signal

487 views
Skip to first unread message

ResIpsa

unread,
Apr 12, 2015, 3:22:42 PM4/12/15
to ope...@googlegroups.com
It's my understanding that wireless sensors, such as the Insteon leak sensor are supposed to send a "heartbeat" message once a day that you can use to determine whether the sensor is in range and has battery.  But it looks like there is no handler for the heartbeat message.  Is this something that can be added through my own features.xml file?  I believe that I captured the traffic from the sensor when the heartbeat signal is sent:

2015-04-10 21:08:22 TRACE o.o.b.i.i.message.MsgFactory[:111]- msgLen expected: 10
2015-04-10 21:08:22 TRACE o.o.b.i.i.message.MsgFactory[:117]- keeping buffer len 5 data: 02 57 A2 02 36
2015-04-10 21:08:22 TRACE o.o.b.i.i.message.MsgFactory[:56]- read buffer: len 7 data: 02 57 A2 02 36 D2 45
2015-04-10 21:08:22 TRACE o.o.b.i.i.message.MsgFactory[:92]- header length expected: 2 extended: false
2015-04-10 21:08:22 TRACE o.o.b.i.i.message.MsgFactory[:111]- msgLen expected: 10
2015-04-10 21:08:22 TRACE o.o.b.i.i.message.MsgFactory[:117]- keeping buffer len 7 data: 02 57 A2 02 36 D2 45
2015-04-10 21:08:22 TRACE o.o.b.i.i.message.MsgFactory[:56]- read buffer: len 10 data: 02 57 A2 02 36 D2 45 02 2F 43
2015-04-10 21:08:22 TRACE o.o.b.i.i.message.MsgFactory[:92]- header length expected: 2 extended: false
2015-04-10 21:08:22 TRACE o.o.b.i.i.message.MsgFactory[:111]- msgLen expected: 10
2015-04-10 21:08:22 TRACE o.o.b.i.i.message.MsgFactory[:117]- keeping buffer len 0 data:
2015-04-10 21:08:22 DEBUG o.o.b.i.InsteonPLMActiveBinding[:509]- got msg: IN:Cmd:0x57|RecordFlags:0xA2|ALLLinkGroup:0x02|LinkAddr:36.D2.45|LinkData1:0x02|LinkData2:0x2F|LinkData3:0x43|
2015-04-10 21:08:22 DEBUG o.o.b.i.internal.driver.Port[:332]- writing (0): OUT:Cmd:0x6A|
2015-04-10 21:08:22 TRACE o.o.b.i.internal.driver.Port[:305]- writer waiting for ack.
2015-04-10 21:08:22 TRACE o.o.b.i.internal.driver.Port[:211]- enqueued msg: OUT:Cmd:0x6A|
2015-04-10 21:08:22 TRACE o.o.b.i.internal.driver.Port[:276]- got unsolicited message

Thank you.

Bernd Pfrommer

unread,
Apr 13, 2015, 8:26:44 AM4/13/15
to ope...@googlegroups.com
First off, I don't own a leak sensor, so I have to go by the developer documents:

http://cache.insteon.com/developer/2852-222dev-102013-en.pdf

The message you posted above:
2015-04-10 21:08:22 DEBUG o.o.b.i.InsteonPLMActiveBinding[:509]- got msg: IN:Cmd:0x57|RecordFlags:0xA2|ALLLinkGroup:0x02|LinkAddr:36.D2.45|LinkData1:0x02|LinkData2:0x2F|LinkData3:0x43|

has command code 0x57, identifying as an ALLLinkRecord response from the modem to the host. I don't think it originates from the leak sensor: it's just an internal record.

If the dev docs are true, you should be getting an SD broadcast message, command code 0x50, with command1 = 0x11 (dry) or 0x13 (wet), and command2 = 0x04 (always).
From looking at the code, the binding may actually react to 0x11, but should ignore 0x13 (which is actually the more important one!).

Suggestions:
1) Make sure the modem is properly linked to the sensor
2) Run the binding in DEBUG mode (TRACE is almost too verbose) for 24h and grep for anything that comes from the leak sensor. Look in particular for command2 = 0x04, those should be the heartbeats.
3) This will likely need coding, i.e. you will need to clone the openhab master repository, set up a dev environment, and probably add a new handler specific for the leak sensor (right now it's using a generic contact). It should correctly handle the following messages:
  - Dry Status (page 9)
  - Wet Status (page 10)
  - Heartbeat (page 11)
 No need to support the other fancy stuff: openhab is not meant as a configuration tool.

I'm a bit disappointed that the battery level is not reported.

Question: even if you process the heartbeat correctly (which I think is a good idea): how you want to detect the absence of it? You may want to try a rule, using the "lasttime" feature (I introduced that during debugging but never really used it for anything afterwards, so not sure how well it actually works).

Good luck.

Bernd

ResIpsa

unread,
Apr 13, 2015, 8:54:04 AM4/13/15
to ope...@googlegroups.com
Thanks, Bernd.  My thought was to use the "lasttime" feature, but it was not being updated by the heartbeat message.  It was only updated when I tested the leak sensor by placing it in water.  Once working, the thought is to have a rule that checks the "lasttime" value a few times per day (e.g., 9am, 3pm, 9pm) and to send me a message if the "lasttime" value is more than 24 hours in the past.  I do not really need instant notification in the middle of the night if the battery dies.

I may have to revisit whether the sensor is properly linked to my modem.  I receive a message when I place it in water, but I do not get a message whenever I press the set button (which I should).

Just to be sure, in debug mode, should I see every command received by the modem, even if the commands are not captured by the binding?

Bernd Pfrommer

unread,
Apr 13, 2015, 9:02:10 AM4/13/15
to ope...@googlegroups.com
Yes, even in debug mode the message should be logged as incoming, whether it is handled correctly or not.

Nicholas Waterton

unread,
Jul 1, 2015, 3:58:38 PM7/1/15
to ope...@googlegroups.com
I also have a leak detector, I've got it configured as a contact closure, and the lastUpdated field registers once per day. In the log though, I get a record of 'CLOSED' ie Dry, followed immediately by uninitialized (maybe last updated or battery status?), so in the openhab app, it always shows as 'uninitialized'. Battery status never reports anything.

Anyone have an example of how this should be configured in items or site map?

Thanks.

Nicholas Waterton

unread,
Jul 1, 2015, 4:12:51 PM7/1/15
to ope...@googlegroups.com
Here is what I have in my insteonplm log (still on debug), and still running well (after days) I have to add.

This is the leak detector - exactly as expected. Not sure what you are supposed to get if it gets wet (0x13 I guess), or if you press the button -I should try it.

2015-07-01 07:51:23 DEBUG o.o.b.i.i.d.MessageDispatcher[:62]- 36.B4.0C:LeakSensorContact->OpenedOrClosedContactHandler cmd1:0x11 group 4/1:IN:Cmd:0x50|fromAddress:36.B4.0C|toAddress:00.00.04|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x11|command2:0x04|
2015-07-01 07:51:24 DEBUG o.o.b.i.i.d.MessageDispatcher[:62]- 36.B4.0C:LeakSensorContact->OpenedOrClosedContactHandler cmd1:0x11 group 4/1:IN:Cmd:0x50|fromAddress:36.B4.0C|toAddress:00.00.04|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x11|command2:0x04|
2015-07-01 07:51:24 DEBUG o.o.b.i.i.d.MessageDispatcher[:62]- 36.B4.0C:LeakSensorContact->OpenedOrClosedContactHandler cmd1:0x11 group 4/1:IN:Cmd:0x50|fromAddress:36.B4.0C|toAddress:2A.E7.67|messageFlags:0x45=ALL_LINK_CLEANUP:1:1|command1:0x11|command2:0x04|
2015-07-01 07:51:24 DEBUG o.o.b.i.i.d.MessageDispatcher[:62]- 36.B4.0C:LeakSensorContact->OpenedOrClosedContactHandler cmd1:0x11 group 4/1:IN:Cmd:0x50|fromAddress:36.B4.0C|toAddress:2A.E7.67|messageFlags:0x45=ALL_LINK_CLEANUP:1:1|command1:0x11|command2:0x04|
2015-07-01 07:51:25 DEBUG o.o.b.i.i.d.MessageDispatcher[:62]- 36.B4.0C:LeakSensorContact->OpenedOrClosedContactHandler cmd1:0x11 group 4/1:IN:Cmd:0x50|fromAddress:36.B4.0C|toAddress:11.02.04|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x06|command2:0x00|
2015-07-01 07:51:25 DEBUG o.o.b.i.i.d.MessageDispatcher[:62]- 36.B4.0C:LeakSensorContact->OpenedOrClosedContactHandler cmd1:0x11 group 4/1:IN:Cmd:0x50|fromAddress:36.B4.0C|toAddress:11.02.04|messageFlags:0xCB=ALL_LINK_BROADCAST:3:2|command1:0x06|command2:0x00|
nick@proliant:/var/log/openhab$

This shows once per day.

Nicholas Waterton

unread,
Jul 1, 2015, 4:19:32 PM7/1/15
to ope...@googlegroups.com
Ok, this what I get when I press the button, plus it registers in openhab display correctly. I should check the battery configuration, everything else seems to work as expected.

2015-07-01 16:14:26 DEBUG o.o.b.i.i.d.MessageDispatcher[:62]- 36.B4.0C:LeakSensorContact->OpenedOrClosedContactHandler cmd1:0x11 group 1/1:IN:Cmd:0x50|fromAddress:36.B4.0C|toAddress:00.00.01|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x11|command2:0x01|
2015-07-01 16:14:26 DEBUG o.o.b.i.i.device.DeviceFeature[:250]- 36.B4.0C:LeakSensorContact publishing: OPEN
2015-07-01 16:14:27 DEBUG o.o.b.i.i.d.MessageDispatcher[:62]- 36.B4.0C:LeakSensorContact->OpenedOrClosedContactHandler cmd1:0x11 group 1/1:IN:Cmd:0x50|fromAddress:36.B4.0C|toAddress:00.00.01|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x11|command2:0x01|
2015-07-01 16:14:27 DEBUG o.o.b.i.i.device.DeviceFeature[:250]- 36.B4.0C:LeakSensorContact publishing: OPEN
2015-07-01 16:14:27 DEBUG o.o.b.i.i.d.MessageDispatcher[:62]- 36.B4.0C:LeakSensorContact->OpenedOrClosedContactHandler cmd1:0x11 group 1/1:IN:Cmd:0x50|fromAddress:36.B4.0C|toAddress:2A.E7.67|messageFlags:0x45=ALL_LINK_CLEANUP:1:1|command1:0x11|command2:0x01|
2015-07-01 16:14:27 DEBUG o.o.b.i.i.device.DeviceFeature[:250]- 36.B4.0C:LeakSensorContact publishing: OPEN
2015-07-01 16:14:27 DEBUG o.o.b.i.i.d.MessageDispatcher[:62]- 36.B4.0C:LeakSensorContact->OpenedOrClosedContactHandler cmd1:0x11 group 1/1:IN:Cmd:0x50|fromAddress:36.B4.0C|toAddress:2A.E7.67|messageFlags:0x45=ALL_LINK_CLEANUP:1:1|command1:0x11|command2:0x01|
2015-07-01 16:14:27 DEBUG o.o.b.i.i.device.DeviceFeature[:250]- 36.B4.0C:LeakSensorContact publishing: OPEN
2015-07-01 16:14:27 DEBUG o.o.b.i.i.d.MessageDispatcher[:62]- 36.B4.0C:LeakSensorContact->OpenedOrClosedContactHandler cmd1:0x11 group 1/1:IN:Cmd:0x50|fromAddress:36.B4.0C|toAddress:11.02.01|messageFlags:0xCF=ALL_LINK_BROADCAST:3:3|command1:0x06|command2:0x00|

Bernd Pfrommer

unread,
Jul 2, 2015, 8:31:49 AM7/2/15
to ope...@googlegroups.com
Nick,
I don't think you should have to press the button to make the "UNINITIALIZED" go away. Plus you don't want to have to do that every time you restart the binding.

The first question is: what causes the uninitialized status? Is it the binding that sets it to that?
Please post a good section of the insteonplm debug log around the time the transition to uninitialized happens. Also the beginning, where it dumps the PLM database.
Post the openhab "events" log for that time period.
Lastly, post your .items file entry.

BTW: here are the developer notes for the device. I assume you have the 2852-xxx:


Bernd

Waterton, Nick (GE Healthcare)

unread,
Jul 2, 2015, 8:48:03 AM7/2/15
to ope...@googlegroups.com

Bernd,

 

It seems to be working correctly now, I think the trick in the configuration is to set a persistence entry, so now the last state is remembered. The developer notes were useful as I didn’t realize that you could get a test “DRY” or “WET” message by pressing the button.

 

I was really just looking for some examples of what other people had in their item files or sitemaps for this, as I was just getting an “uninitialized” display all the time (and I had to wait 24 hours to see if it updated). I also wasn’t clear whether you get an OPEN or CLOSED message on DRY/WET (this is unintuitive in the insteon setup – for the motion detector OPEN is motion and CLOSED is NOMOTION) with the leak detector OPEN is DRY.

 

I think I have it for now…

 

Nick Waterton P.Eng.

National Support Leader - Nuclear Medicine, PET and RP

GE Healthcare

 

M+1 416 859 8545

F +1 905 248 3089

E nick.w...@med.ge.com

 

2300 Meadowvale Boulevard

Mississauga, ON  L5N 5P9  Canada

 

GE imagination at work

--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/chu17X9VlD4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
To view this discussion on the web visit https://groups.google.com/d/msgid/openhab/65521a5a-42d2-4dc8-8e44-9cc27f51e0d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bernd Pfrommer

unread,
Jul 2, 2015, 8:53:39 AM7/2/15
to ope...@googlegroups.com
Nick,

Could you please add your working config to the InsteonPLM wiki? I know it's growing out of control, at some point we have to reorganize the content there, but for now just add it somewhere with the other device config examples.

Thanks!

Bernd
Reply all
Reply to author
Forward
0 new messages