aficustree / homebridge-alarmdecoder-platform

Homebridge plugin for the AlarmDecoder interface for Honeywell and DSC Alarm Systems. Exposes the security system and all zones (via Contact Sensors and Motion Sensors) to Apple's Homekit. Control your alarm through Siri.
Apache License 2.0
18 stars 11 forks source link

Smoke Detectors load as Contact Sensors #5

Closed adammoyer16 closed 4 years ago

adammoyer16 commented 5 years ago

Tried adding "Smoke" or "smoke" to the name of my smoke detector, but it will only show up as a contact sensor. I have a DSC alarm panel, am on the latest version of AlarmDecoder and latest version of the homebridge-alarmdecoder-platform. I've tried adding it as many ways as I could think, but ended up adding "Motion" to the name so it'd come in as a Motion Sensor (which works for me) in the meantime.

This issue is more trivial than my other one I'm about to post (has to do with arming/disarming DSC not working correctly). But I also wanted to express my gratitude for creating this plugin! I really appreciate the work you put in and am looking to donate :)

aficustree commented 5 years ago

I fixed a small typo and bumped the new version on npm. Let me know if that fixes it. Ref the arming/disarming. I actually have a Honeywell so I did the DSC work based on what I could gather from the manual. The arm logic is supposedly a touch different so I'd be happy to sanity check if you walk me through the keypress sequences you have to do on the alarm decoder webUI for it to work.

adammoyer16 commented 5 years ago

Updated to the new version and the smoke detector added correctly! Thanks for the quick fix!

As for the arming/disarming DSC through the Alarm Decoder Keypad, there are a few options:

  1. Simply input a user code (no extra digits). This triggers the Exit delay and arms the system in Away mode.
  2. Click "Special Buttons", choose mode (Stay/Away), confirm that you really want to do that from a popup. This triggers the Exit delay and arms the system in the mode specified.

Disarming the system is always done by simply inputting the user code.

Night Mode on DSC is strange. Apparently you have to arm it in Stay Mode and then press either ( then 1) or ( then *) to get it into Night Mode. I read that there's a way to program one of the function keys to go straight into Night Mode without first having to arm into Stay, but I haven't found how to do that yet.

Anyway, let me know if there's more I can tell you! I'm always willing to test anything and provide feedback! It'd be awesome to get the Stay/Away/Night buttons working flawlessly. I can open this as a separate issue if you'd like just for documentation sake, your call on that one.

aficustree commented 5 years ago

Thanks, I think I misunderstood the logic when I wrote it but it sounds easy to fix. I’ll putz around with it tomorrow.


From: adammoyer16 notifications@github.com Sent: Saturday, August 17, 2019 22:34 To: aficustree/homebridge-alarmdecoder-platform Cc: aficustree; Comment Subject: Re: [aficustree/homebridge-alarmdecoder-platform] Smoke Detectors load as Contact Sensors (#5)

Updated to the new version and the smoke detector added correctly! Thanks for the quick fix!

As for the arming/disarming DSC through the Alarm Decoder Keypad, there are a few options:

  1. Simply input a user code (no extra digits). This triggers the Exit delay and arms the system in Away mode.
  2. Click "Special Buttons", choose mode (Stay/Away), confirm that you really want to do that from a popup. This triggers the Exit delay and arms the system in the mode specified.

Disarming the system is always done by simply inputting the user code.

Night Mode on DSC is strange. Apparently you have to arm it in Stay Mode and then press either ( then 1) or ( then *) to get it into Night Mode. I read that there's a way to program one of the function keys to go straight into Night Mode without first having to arm into Stay, but I haven't found how to do that yet.

Anyway, let me know if there's more I can tell you! I'm always willing to test anything and provide feedback! It'd be awesome to get the Stay/Away/Night buttons working flawlessly. I can open this as a separate issue if you'd like just for documentation sake, your call on that one.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/aficustree/homebridge-alarmdecoder-platform/issues/5?email_source=notifications&email_token=ADCAHKCGFXI4IZFKOESI67DQFC7L3A5CNFSM4IMQP6K2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4QXWEA#issuecomment-522287888, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADCAHKC73HINXOJ352J5XNLQFC7L3ANCNFSM4IMQP6KQ.

aficustree commented 5 years ago

okay, I changed a couple things in the #development branch. Do you know how to install from a branch vs. NPM? in your install.sh in Homebridge, call

npm install -g git+https://github.com/aficustree/homebridge-alarmdecoder-platform#development

I fixed so disarming is just done by sending the setPIN again for panels with

"DSCorHoneywell" : "DSC" or "platformType" : "DSC"

If all you do to kick it in away mode is re-enter the pin then in your config.json change "DSCAway" : "<S5>", to "DSCAway" : "1234", (where 1234 is your PIN)

I changed "night" to be DSCStay + "1*" but getting Stay to work seems odd. According to the documentation <F4> is Stay but for your explanation is sounds like it might be <S4> instead. Try updating your DSCStay variable to <S4> in your config.json and let me back. I'm not sure that's the problem as <S5> (away) should have worked then.

I also think Chime is actually <S9> in a DSC so I updated that too. You can see the example in the example DSC config.

Let me know

adammoyer16 commented 5 years ago

Okay, I tested it and I'm still seeing the same issues. For reference, I'm using the default config to test.

Here's what I've seen: If I press "Home" on the Alarm System (in the Home App) it will instantly switch to "Away" beep, switch to "Off" beep, switch to "Away" beep, switch to "Off" and this continues for forever. When watching my keypad, it will have "Invalid Access Code" warning after switching to "Away" and before switching to "Off". I need to press "Off" at the correct time to get it out of the infinite loop.

If I press "Away", the exit delay works, but then at the end, it switches to "Home" and notifies me that it was armed for "Stay". A second later it switches the alarm off for some reason.

If I press "Night", nothing happens.

I tried putting in my user code ("1234") into the config for Away and Stay. Saw the same behavior described above, nothing changed. Then tried S4 for Stay and still saw the same issues.

Pretty peculiar.

aficustree commented 5 years ago

That is odd. Okay, will have another look. For the avoidance of doubt, you’ve uninstalled the old one using npm uninstall before the dev version? Can you pass along the alarm-decoder config.json snippit (removing your PIN)?

From: adammoyer16 notifications@github.com Reply-To: aficustree/homebridge-alarmdecoder-platform reply@reply.github.com Date: Sunday, August 18, 2019 at 6:10 PM To: aficustree/homebridge-alarmdecoder-platform homebridge-alarmdecoder-platform@noreply.github.com Cc: Shaun Baker shaun@sjbaker.us, Assign assign@noreply.github.com Subject: Re: [aficustree/homebridge-alarmdecoder-platform] Smoke Detectors load as Contact Sensors (#5)

Okay, I tested it and I'm still seeing the same issues. For reference, I'm using the default config to test.

Here's what I've seen: If I press "Home" on the Alarm System it will instantly switch to "Away" beep, switch to "Off" beep, switch to "Away" beep, switch to "Off" and this continues for forever. When watching my keypad, it will have "Invalid Access Code" warning after switching to "Away" and before switching to "Off". I need to press "Off" at the correct time to get it out of the infinite loop.

If I press "Away", the exit delay works, but then at the end, it switches to "Home" and notifies me that it was armed for "Stay". A second later it switches the alarm off for some reason.

If I press "Night", nothing happens.

I tried putting in my user code ("1234") into the config for Away and Stay. Saw the same behavior described above, nothing changed. Then tried for Stay and still saw the same issues.

Pretty peculiar.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or mute the thread.

aficustree commented 5 years ago

Okay, I think I have an idea….

“Off” is the default state if the code can’t parse the request emitted back from the panel message. I’m guessing the DSC panel behaves a bit differently with its status message than the Honeywell. So when you use the iphone to trigger a state change, it sends the alarm the proper message. That makes the alarm emit a ‘state’ message. The code can’t find what it’s looking for in the state message and changes the status to ‘off’. Since the in the DSC, on/off is the same, it ends up cycling.

I really need to see the status object.

Can you provide a snippit of the homebridge log file

You should see entries that look like this:

[8/19/2019, 12:02:03 AM] [Alarm] {"last_message_received":"[10000001100000003A--],008,[f70200ff1008001c28020000000000],\" DISARMED CHIME   Ready to Arm  \"","panel_alarming":false,"panel_armed":false,"panel_armed_stay":false,"panel_bypassed":{},"panel_fire_detected":false,"panel_on_battery":false,"panel_panicked":false,"panel_powered":true,"panel_ready":true,"panel_relay_status":[],"panel_type":"ADEMCO","panel_zones_faulted":[]}

That’ll help me know what I’m looking for. The sequence of object messages must be different for DSC and thus confusing the code.

Shaun

From: adammoyer16 notifications@github.com Reply-To: aficustree/homebridge-alarmdecoder-platform reply@reply.github.com Date: Sunday, August 18, 2019 at 6:10 PM To: aficustree/homebridge-alarmdecoder-platform homebridge-alarmdecoder-platform@noreply.github.com Cc: Shaun Baker shaun@sjbaker.us, Assign assign@noreply.github.com Subject: Re: [aficustree/homebridge-alarmdecoder-platform] Smoke Detectors load as Contact Sensors (#5)

Okay, I tested it and I'm still seeing the same issues. For reference, I'm using the default config to test.

Here's what I've seen: If I press "Home" on the Alarm System it will instantly switch to "Away" beep, switch to "Off" beep, switch to "Away" beep, switch to "Off" and this continues for forever. When watching my keypad, it will have "Invalid Access Code" warning after switching to "Away" and before switching to "Off". I need to press "Off" at the correct time to get it out of the infinite loop.

If I press "Away", the exit delay works, but then at the end, it switches to "Home" and notifies me that it was armed for "Stay". A second later it switches the alarm off for some reason.

If I press "Night", nothing happens.

I tried putting in my user code ("1234") into the config for Away and Stay. Saw the same behavior described above, nothing changed. Then tried for Stay and still saw the same issues.

Pretty peculiar.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or mute the thread.

adammoyer16 commented 5 years ago

Here's the logs when it was cycling the way I described:

[8/18/2019, 8:09:36 PM] [Alarm System] {"last_message_received":"[10010c11000000100D--],03e,[000200000000000000000000000000],\"System is Unavailable \"","panel_alarming":false,"panel_armed":false,"panel_armed_stay":false,"panel_battery_trouble":false,"panel_bypassed":{"null":true},"panel_chime":false,"panel_entry_delay_off":false,"panel_exit":false,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":true,"panel_relay_status":[],"panel_type":"DSC","panel_zones_faulted":[]}

[8/18/2019, 8:09:38 PM] [Alarm System] {"last_message_received":"[01010c11000000100D--],008,[000200000000000000000000000000],\"Exit Delay In Progress \"","panel_alarming":false,"panel_armed":true,"panel_armed_stay":false,"panel_battery_trouble":false,"panel_bypassed":{"null":true},"panel_chime":false,"panel_entry_delay_off":false,"panel_exit":true,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":false,"panel_relay_status":[],"panel_type":"DSC","panel_zones_faulted":[]}

[8/18/2019, 8:09:40 PM] [Alarm System] {"last_message_received":"[10010c11000000100D--],03e,[000200000000000000000000000000],\"System is Unavailable \"","panel_alarming":false,"panel_armed":false,"panel_armed_stay":false,"panel_battery_trouble":false,"panel_bypassed":{"null":true},"panel_chime":false,"panel_entry_delay_off":false,"panel_exit":false,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":true,"panel_relay_status":[],"panel_type":"DSC","panel_zones_faulted":[]}

[8/18/2019, 8:09:42 PM] [Alarm System] {"last_message_received":"[01010c11000000100D--],008,[000200000000000000000000000000],\"Exit Delay In Progress \"","panel_alarming":false,"panel_armed":true,"panel_armed_stay":false,"panel_battery_trouble":false,"panel_bypassed":{"null":true},"panel_chime":false,"panel_entry_delay_off":false,"panel_exit":true,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":false,"panel_relay_status":[],"panel_type":"DSC","panel_zones_faulted":[]}

[8/18/2019, 8:09:45 PM] [Alarm System] {"last_message_received":"[10010c11000000100D--],03e,[000200000000000000000000000000],\"System is Unavailable \"","panel_alarming":false,"panel_armed":false,"panel_armed_stay":false,"panel_battery_trouble":false,"panel_bypassed":{"null":true},"panel_chime":false,"panel_entry_delay_off":false,"panel_exit":false,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":true,"panel_relay_status":[],"panel_type":"DSC","panel_zones_faulted":[]}

[8/18/2019, 8:09:47 PM] [Alarm System] {"last_message_received":"[01010c11000000100D--],008,[000200000000000000000000000000],\"Exit Delay In Progress \"","panel_alarming":false,"panel_armed":true,"panel_armed_stay":false,"panel_battery_trouble":false,"panel_bypassed":{"null":true},"panel_chime":false,"panel_entry_delay_off":false,"panel_exit":true,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":false,"panel_relay_status":[],"panel_type":"DSC","panel_zones_faulted":[]}

[8/18/2019, 8:09:49 PM] [Alarm System] {"last_message_received":"[10010c11000000100D--],03e,[000200000000000000000000000000],\"System is Unavailable \"","panel_alarming":false,"panel_armed":false,"panel_armed_stay":false,"panel_battery_trouble":false,"panel_bypassed":{"null":true},"panel_chime":false,"panel_entry_delay_off":false,"panel_exit":false,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":true,"panel_relay_status":[],"panel_type":"DSC","panel_zones_faulted":[]}

[8/18/2019, 8:09:52 PM] [Alarm System] {"last_message_received":"[01010c11000000100D--],008,[000200000000000000000000000000],\"Exit Delay In Progress \"","panel_alarming":false,"panel_armed":true,"panel_armed_stay":false,"panel_battery_trouble":false,"panel_bypassed":{"null":true},"panel_chime":false,"panel_entry_delay_off":false,"panel_exit":true,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":false,"panel_relay_status":[],"panel_type":"DSC","panel_zones_faulted":[]}

[8/18/2019, 8:09:54 PM] [Alarm System] {"last_message_received":"[10010c11000000100D--],03e,[000200000000000000000000000000],\"System is Unavailable \"","panel_alarming":false,"panel_armed":false,"panel_armed_stay":false,"panel_battery_trouble":false,"panel_bypassed":{"null":true},"panel_chime":false,"panel_entry_delay_off":false,"panel_exit":false,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":true,"panel_relay_status":[],"panel_type":"DSC","panel_zones_faulted":[]}

[8/18/2019, 8:09:56 PM] [Alarm System] {"last_message_received":"[01010c11000000100D--],008,[000200000000000000000000000000],\"Exit Delay In Progress \"","panel_alarming":false,"panel_armed":true,"panel_armed_stay":false,"panel_battery_trouble":false,"panel_bypassed":{"null":true},"panel_chime":false,"panel_entry_delay_off":false,"panel_exit":true,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":false,"panel_relay_status":[],"panel_type":"DSC","panel_zones_faulted":[]}

[8/18/2019, 8:09:58 PM] [Alarm System] {"last_message_received":"[10010c11000000100D--],03e,[000200000000000000000000000000],\"System is Unavailable \"","panel_alarming":false,"panel_armed":false,"panel_armed_stay":false,"panel_battery_trouble":false,"panel_bypassed":{"null":true},"panel_chime":false,"panel_entry_delay_off":false,"panel_exit":false,"panel_fire_detected":false,"panel_panicked":false,"panel_perimeter_only":false,"panel_powered":true,"panel_ready":true,"panel_relay_status":[],"panel_type":"DSC","panel_zones_faulted":[]}

Here is my config without my pin: (I switched over to "platformType" just a minute ago)

{ "platform": "alarmdecoder-platform", "name": "Alarm System", "port": "9090", "key": "THISISNOTAREALKEY", "stateURL": "http://192.168.86.124/api/v1/alarmdecoder", "zoneURL": "http://192.168.86.124/api/v1/zones", "setURL": "http://192.168.86.124/api/v1/alarmdecoder/send", "useSwitches": [ "panic", "chime", "away", "stay", "night" ], "panicKey": "<S1>", "setPIN": "1234", "platformType": "DSC", "chimeKey": "<S9>", "DSCStay": "<S4>", "DSCAway": "<S5>", "DSCReset": "<S7>", "DSCExit": "<S8>" }

aficustree commented 5 years ago

so I think it's something to do with the DSC arm/disarm using the same keys and the system in a confused state. I don't know why that would cause it to loop but I've added a bunch of resync steps before ever issuing a set command and a specific exemption to ensure DSC panels never resend a state it's already in. I just pushed it to dev. Try again.

if it still errors I'll need the full debug capture to figure out the logic failure. you'd need to run home bridge with DEBUG=* homebridge -D.. Apologies hard to do this blind when I only have a Honeywell panel.

adammoyer16 commented 5 years ago

Hey, sorry, busy day. I tried it again and am still seeing the looping. Trying to run Homebridge in debug. I run mine through systemd though, so it's a little less straight forward for me to know how to do that (I really don't use Linux distros too often). I'll poke around and see if I can launch it in debug easily. I don't want to completely destroy my Homekit setup in the process, so I'm being a little cautious.

adammoyer16 commented 5 years ago

Also, forgive me if what I'm telling you is irrelevant, but I noticed on the Alarm Decoder site that there's a Protocol page, particularly the "Special Keys" section seems to address DSC special key functions directly. It talks about the codes that need to be sent and that they need to be sent 3x in a row to get them to trigger. Again, you might already be doing this or what I'm saying might be irrelevant for some reason, I haven't been able to dig into the code and really see what's going on, but I thought it'd be worth pointing out at the very least since you've said that DSC wasn't really your focus when first setting this up. Here's the link: https://www.alarmdecoder.com/wiki/index.php/Protocol#Special_Keys

The special keys seem to work every time from the Alarm Decoder Keypad, so I'm just hoping we can somehow replicate that directly.

aficustree commented 5 years ago

Yes, that’s built into the API that the homebridge plugin calls. I’m just posting to the REST API with ASCII “S4” and then it translates that to the triple char. What I don’t understand is why it’s looping. Even in the case where it gets a message back from the alarm that doesn’t match the state, the plugin won’t resend the keys but somehow (clearly) the keys are being sent. Two things:

If you can, turn off your use of the switches in case the switches are ending up in a do-loop. I’ve noticed that on the Honeywell. Even if the switch is off, it will still send another ‘off’ which might be turning it on again. I added logic to catch that and not resend but maybe I missed something. Remove the switches from your config.json, purge your cache and try again. Let me know if that helps. It would be super helpful if I could get the debug logs as that’ll tell me what’s looping

From: adammoyer16 notifications@github.com Reply-To: aficustree/homebridge-alarmdecoder-platform reply@reply.github.com Date: Monday, August 19, 2019 at 9:05 PM To: aficustree/homebridge-alarmdecoder-platform homebridge-alarmdecoder-platform@noreply.github.com Cc: Shaun Baker shaun@sjbaker.us, Assign assign@noreply.github.com Subject: Re: [aficustree/homebridge-alarmdecoder-platform] Smoke Detectors load as Contact Sensors (#5)

Also, forgive me if what I'm telling you is irrelevant, but I noticed on the Alarm Decoder site that there's a Protocol page, particularly the "Special Keys" section seems to address DSC special key functions directly. It talks about the codes that need to be sent and that they need to be sent 3x in a row to get them to trigger. Again, you might already be doing this or what I'm saying might be irrelevant for some reason, I haven't been able to dig into the code and really see what's going on, but I thought it'd be worth pointing out at the very least since you've said that DSC wasn't really your focus when first setting this up. Here's the link: https://www.alarmdecoder.com/wiki/index.php/Protocol#Special_Keys

The special keys seem to work every time from the Alarm Decoder Keypad, so I'm just hoping we can somehow replicate that directly.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or mute the thread.

aficustree commented 4 years ago

closing as no follow-up