kuestess / homebridge-platform-insteonlocal

Homebridge platform plugin for local Insteon control
Other
76 stars 26 forks source link

Open/Close Sensor Heartbeat Registering as Open #314

Open panzer343 opened 5 months ago

panzer343 commented 5 months ago

I’ve been getting false door open status updates from my Insteon open/close sensors every day. I'm using 0.5.11 but this has been happening on all prior versions.

It appears to be related to a “heartbeat” status that the sensors seem to send every day. The heartbeat is registered as an “open” status, but the heartbeat code the sensor sends doesn’t seem intended to indicate an open or closed status.

To fix the issue I edited the “Door.js” file in the “home-controller” code folder so that the status registers as “alive” rather than “open." I narrowed the open command to 11 01 and heartbeat to 11 04 to reflect what I was seeing being emitted in the logs from my sensors. I’ve copied the code I edited on my install below, with the edited code in bold. There's probably a better way to fix this, but this seemed to resolve my issue. I’m not sure if all Insteon Open/Close Sensors send the same heartbeat signals. My open/close sensors are model 2843-222 Revision 3.0 4718.

case 1: if(cmd1 === '11' && cmd2 === '01') { this.emit('opened'); } else if(cmd1 === '13') { this.emit('closed'); } else { debug('No event for command - %s, group - %s', cmd1, group); } break; case 2: this.emit('closed'); break; case 4: this.emit('heartbeat'); if(cmd1 === '11' && cmd2 === '04') { this.emit('alive'); } else if(cmd1 === '13') { this.emit('closed'); } else {

kuestess commented 4 months ago

@panzer343 Thanks for the thorough investigation! Can you run homebridge in debug mode homebridge -D and post the output when one of your sensors sends a heartbeat? I don't have any sensors, but that will help me confirm the proper command.

panzer343 commented 3 months ago

Here are the Insteon log outputs (with the edited door.js) that happen when a heartbeat is registered from (1) a closed sensor (Front Door), (2) an open sensor (TestOpenSensor), and (3) a closed sensor (Garage Door) that sends a different set of commands with the heartbeat. The log from three consecutive days is attached. Both Garage and Front Door are model 2843-222 Revision 3.0 4718, but TestOpenSensor is Rev. 3.0 2419.

(1) Front Door (Sensor was closed during heartbeat) 17/03/2024, 03:05:22] [InsteonLocal] Heartbeat from Front Door [17/03/2024, 03:05:22] [InsteonLocal] Received command for 51E210 [17/03/2024, 03:05:22] [InsteonLocal] Message is from keypad, filtering non-keypad devices. [17/03/2024, 03:05:22] [InsteonLocal] Found 0 accessories matching 51E210 [17/03/2024, 03:05:22] [InsteonLocal] Hub command: {"standard":{"type":"50","id":"51E210","gatewayId":"000004","extended":false,"messageType":6,"hopsLeft":3,"maxHops":3,"command1":"11","command2":"04","raw":"025051E210000004CF1104"}} [17/03/2024, 03:05:22] [InsteonLocal] Received command for 51E210 [17/03/2024, 03:05:22] [InsteonLocal] Message is from keypad, filtering non-keypad devices. [17/03/2024, 03:05:22] [InsteonLocal] Found 0 accessories matching 51E210 [17/03/2024, 03:05:22] [InsteonLocal] Hub command: {"standard":{"type":"50","id":"51E210","gatewayId":"000004","extended":false,"messageType":6,"hopsLeft":3,"maxHops":3,"command1":"11","command2":"04","raw":"025051E210000004CF1104"}} [17/03/2024, 03:05:22] [InsteonLocal] Received command for 51E210 [17/03/2024, 03:05:22] [InsteonLocal] Message is from keypad, filtering non-keypad devices. [17/03/2024, 03:05:22] [InsteonLocal] Found 0 accessories matching 51E210 [17/03/2024, 03:05:22] [InsteonLocal] Hub command: {"standard":{"type":"50","id":"51E210","gatewayId":"3B63C2","extended":false,"messageType":2,"hopsLeft":1,"maxHops":1,"command1":"11","command2":"04","raw":"025051E2103B63C2451104"}} [17/03/2024, 03:05:22] [InsteonLocal] Received command for 51E210 [17/03/2024, 03:05:22] [InsteonLocal] Message is from keypad, filtering non-keypad devices. [17/03/2024, 03:05:22] [InsteonLocal] Found 0 accessories matching 51E210 [17/03/2024, 03:05:22] [InsteonLocal] Hub command: {"standard":{"type":"50","id":"51E210","gatewayId":"110104","extended":false,"messageType":6,"hopsLeft":3,"maxHops":3,"command1":"06","command2":"00","raw":"025051E210110104CF0600"}} [17/03/2024, 03:05:22] [InsteonLocal] Received command for 51E210 [17/03/2024, 03:05:22] [InsteonLocal] Message is from keypad, filtering non-keypad devices. [17/03/2024, 03:05:22] [InsteonLocal] Found 0 accessories matching 51E210 [17/03/2024, 03:05:22] [InsteonLocal] Hub command: {"standard":{"type":"50","id":"51E210","gatewayId":"110104","extended":false,"messageType":6,"hopsLeft":3,"maxHops":3,"command1":"06","command2":"00","raw":"025051E210110104CF0600"}}

(2) TestOpenSensor (Sensor was open during heartbeat) 16/03/2024, 17:44:33] [InsteonLocal] Heartbeat from TestOpenSensor [16/03/2024, 17:44:33] [InsteonLocal] Received command for 551469 [16/03/2024, 17:44:33] [InsteonLocal] Message is from keypad, filtering non-keypad devices. [16/03/2024, 17:44:33] [InsteonLocal] Found 0 accessories matching 551469 [16/03/2024, 17:44:33] [InsteonLocal] Hub command: {"standard":{"type":"50","id":"551469","gatewayId":"000004","extended":false,"messageType":6,"hopsLeft":3,"maxHops":3,"command1":"11","command2":"04","raw":"0250551469000004CF1104"}} [16/03/2024, 17:44:33] [InsteonLocal] Received command for 551469 [16/03/2024, 17:44:33] [InsteonLocal] Message is from keypad, filtering non-keypad devices. [16/03/2024, 17:44:33] [InsteonLocal] Found 0 accessories matching 551469 [16/03/2024, 17:44:33] [InsteonLocal] Hub command: {"standard":{"type":"50","id":"551469","gatewayId":"000004","extended":false,"messageType":6,"hopsLeft":3,"maxHops":3,"command1":"11","command2":"04","raw":"0250551469000004CF1104"}} [16/03/2024, 17:44:33] [InsteonLocal] Received command for 551469 [16/03/2024, 17:44:33] [InsteonLocal] Message is from keypad, filtering non-keypad devices. [16/03/2024, 17:44:33] [InsteonLocal] Found 0 accessories matching 551469 [16/03/2024, 17:44:33] [InsteonLocal] Hub command: {"standard":{"type":"50","id":"551469","gatewayId":"3B63C2","extended":false,"messageType":2,"hopsLeft":1,"maxHops":1,"command1":"11","command2":"04","raw":"02505514693B63C2451104"}} [16/03/2024, 17:44:33] [InsteonLocal] Received command for 551469 [16/03/2024, 17:44:33] [InsteonLocal] Message is from keypad, filtering non-keypad devices. [16/03/2024, 17:44:33] [InsteonLocal] Found 0 accessories matching 551469 [16/03/2024, 17:44:33] [InsteonLocal] Hub command: {"standard":{"type":"50","id":"551469","gatewayId":"3B63C2","extended":false,"messageType":2,"hopsLeft":1,"maxHops":1,"command1":"11","command2":"04","raw":"02505514693B63C2451104"}} [16/03/2024, 17:44:38] [InsteonLocal] Received command for 551469 [16/03/2024, 17:44:38] [InsteonLocal] Message is from keypad, filtering non-keypad devices. [16/03/2024, 17:44:38] [InsteonLocal] Found 0 accessories matching 551469 [16/03/2024, 17:44:38] [InsteonLocal] Hub command: {"standard":{"type":"50","id":"551469","gatewayId":"110204","extended":false,"messageType":6,"hopsLeft":3,"maxHops":3,"command1":"06","command2":"00","raw":"0250551469110204CF0600"}} [16/03/2024, 17:44:38] [InsteonLocal] Received command for 551469 [16/03/2024, 17:44:38] [InsteonLocal] Message is from keypad, filtering non-keypad devices. [16/03/2024, 17:44:38] [InsteonLocal] Found 0 accessories matching 551469 [16/03/2024, 17:44:38] [InsteonLocal] Hub command: {"standard":{"type":"50","id":"551469","gatewayId":"110204","extended":false,"messageType":6,"hopsLeft":3,"maxHops":3,"command1":"06","command2":"00","raw":"0250551469110204CF0600"}}

(3) Garage Door Sensor, closed sensor that sends other commands with heartbeat 16/03/2024, 19:02:33] [InsteonLocal] Heartbeat from Garage Door [16/03/2024, 19:02:33] [InsteonLocal] Garage Door is closed [16/03/2024, 19:02:33] [InsteonLocal] Invert sensor: false [16/03/2024, 19:02:33] [InsteonLocal] Received command for 51D835 [16/03/2024, 19:02:33] [InsteonLocal] Message is from keypad, filtering non-keypad devices. [16/03/2024, 19:02:33] [InsteonLocal] Found 0 accessories matching 51D835 [16/03/2024, 19:02:33] [InsteonLocal] Hub command: {"standard":{"type":"50","id":"51D835","gatewayId":"000004","extended":false,"messageType":6,"hopsLeft":3,"maxHops":3,"command1":"13","command2":"04","raw":"025051D835000004CF1304"}} [16/03/2024, 19:02:33] [InsteonLocal] Received command for 51D835 [16/03/2024, 19:02:33] [InsteonLocal] Message is from keypad, filtering non-keypad devices. [16/03/2024, 19:02:33] [InsteonLocal] Found 0 accessories matching 51D835 [16/03/2024, 19:02:33] [InsteonLocal] Hub command: {"standard":{"type":"50","id":"51D835","gatewayId":"000004","extended":false,"messageType":6,"hopsLeft":3,"maxHops":3,"command1":"13","command2":"04","raw":"025051D835000004CF1304"}} [16/03/2024, 19:02:33] [InsteonLocal] Received command for 51D835 [16/03/2024, 19:02:33] [InsteonLocal] Message is from keypad, filtering non-keypad devices. [16/03/2024, 19:02:33] [InsteonLocal] Found 0 accessories matching 51D835 [16/03/2024, 19:02:33] [InsteonLocal] Hub command: {"standard":{"type":"50","id":"51D835","gatewayId":"130004","extended":false,"messageType":6,"hopsLeft":3,"maxHops":3,"command1":"06","command2":"00","raw":"025051D835130004CF0600"}} [16/03/2024, 19:02:33] [InsteonLocal] Received command for 51D835 [16/03/2024, 19:02:34] [InsteonLocal] Message is from keypad, filtering non-keypad devices. [16/03/2024, 19:02:34] [InsteonLocal] Found 0 accessories matching 51D835 [16/03/2024, 19:02:34] [InsteonLocal] Hub command: {"standard":{"type":"50","id":"51D835","gatewayId":"130004","extended":false,"messageType":6,"hopsLeft":2,"maxHops":3,"command1":"06","command2":"00","raw":"025051D835130004CB0600"}} [16/03/2024, 19:23:27] [InsteonLocal] Received command for 52927C [16/03/2024, 19:23:27] [InsteonLocal] Message is from keypad, filtering non-keypad devices. [16/03/2024, 19:23:27] [InsteonLocal] Found 0 accessories matching 52927C [16/03/2024, 19:23:27] [InsteonLocal] Hub command: {"standard":{"type":"50","id":"52927C","gatewayId":"3B63C2","extended":false,"messageType":1,"hopsLeft":0,"maxHops":0,"command1":"00","command2":"00","raw":"025052927C3B63C2200000"}}

kuestess commented 3 months ago

@panzer343 Really appreciate the detail! The home-controller code does line up with what the developer notes say for the open/close sensor....however, as I've often found out the developer notes don't match reality. Clearly from what you provided, the heartbeat message (ending in 04) does not contain the status of the sensor (which is what the developer notes say). Is your Garage Door sensor above also an open/close sensor, or is that the sensor on an IOLinc? That sensor behavior doesn't seem to jive with the Front Door Sensor above.

panzer343 commented 2 months ago

Thanks for looking into it! Strangely enough it’s just another standard open/close door sensor, same type and model as the other two. So I’m stumped on why it’s sending a different message following the heartbeat.