EHylands / homebridge-qolsys

Homebridge Qolsys IQ Panel plugin
MIT License
15 stars 1 forks source link

I'm Helping.... #4

Closed CodyRWhite closed 1 year ago

CodyRWhite commented 1 year ago

Awesome work, I have been following for a week or 2 and the jump in progress has been amazing!

I have a IQ2+ I just wanted to make a few notes. In your documentation you need to enable 6 digits pins to enabled 3rd party access, once you have the API Key you can revert back to 4digit pins if you want. 6 digit is not required once connected.

You can see below my configuration and I wanted to make a quick note on Zone9. The IQ Panel is wireless but all of my sensors are wired. When they upgraded my panel they installed a Hardwire Translator to connect all the wired devices wirelessly. This devices shows up as a zone for tamper protection. It would be nice if this could be added as a standard contact to detect tamper alerts. I am not sure if this has been discussed in other threads.

I have not tested arming or disarming yet but everything looks good in Homebridge right now. About to set it up as a child bridge and connect it to HomeKit to see what shakes loose.

[12/27/2022, 4:38:23 PM] [QolsysPanel] -----------------------------------------
[12/27/2022, 4:38:23 PM] [QolsysPanel] Qolsys Panel Information
[12/27/2022, 4:38:23 PM] [QolsysPanel] -----------------------------------------
[12/27/2022, 4:38:23 PM] [QolsysPanel] Partition0: partition1
[12/27/2022, 4:38:23 PM] [QolsysPanel]   Zone1: Front Door
[12/27/2022, 4:38:23 PM] [QolsysPanel]   Zone2: Garage Door
[12/27/2022, 4:38:23 PM] [QolsysPanel]   Zone3: Back Door
[12/27/2022, 4:38:23 PM] [QolsysPanel]   Zone4: Hallway Motion Detector
[12/27/2022, 4:38:23 PM] [QolsysPanel]   Zone5: Family Room Motion
[12/27/2022, 4:38:23 PM] [QolsysPanel]   Zone6: Basement Window
[12/27/2022, 4:38:23 PM] [QolsysPanel]   Zone7: Upstairs Smoke Detector
[12/27/2022, 4:38:23 PM] [QolsysPanel]   Zone8: Downstairs CO Detector
[12/27/2022, 4:38:23 PM] [QolsysPanel]   Zone9: Hardwire Translator
[12/27/2022, 4:38:23 PM] [QolsysPanel] -----------------------------------------
[12/27/2022, 4:38:23 PM] [QolsysPanel] Configuring Homebridge plugin accessories
[12/27/2022, 4:38:23 PM] [QolsysPanel] -----------------------------------------
[12/27/2022, 4:38:23 PM] [QolsysPanel] Partition0(Security System): partition1
[12/27/2022, 4:38:23 PM] [QolsysPanel] Zone1 (ContactSensor): Front Door
[12/27/2022, 4:38:23 PM] [QolsysPanel] Zone2 (ContactSensor): Garage Door
[12/27/2022, 4:38:23 PM] [QolsysPanel] Zone3 (ContactSensor): Back Door
[12/27/2022, 4:38:23 PM] [QolsysPanel] Zone4 (MotionSensor): Hallway Motion Detector
[12/27/2022, 4:38:23 PM] [QolsysPanel] Zone5 (MotionSensor): Family Room Motion
[12/27/2022, 4:38:23 PM] [QolsysPanel] Zone6 (ContactSensor): Basement Window
[12/27/2022, 4:38:23 PM] [QolsysPanel] Zone7: No HomeKit plugin available - Unknow
[12/27/2022, 4:38:23 PM] [QolsysPanel] Zone8 (COSensor): Downstairs CO Detector
[12/27/2022, 4:38:23 PM] [QolsysPanel] Zone9: No HomeKit plugin available - TakeoverModule
[12/27/2022, 4:38:23 PM] [QolsysPanel] -----------------------------------------
[12/27/2022, 4:38:23 PM] [QolsysPanel] Starting Controller Operation
[12/27/2022, 4:38:23 PM] [QolsysPanel] -----------------------------------------

Keep up the awesome works!! Thanks a millions let me know how I can assist.

EHylands commented 1 year ago

Hi, Thank you for helping out !

I was aware that you could revert to a 4 digit pin once the 3rd party integration was enable. Will point it out in documentation.

Could you post your log file with homebridge running in debug mode ?

CodyRWhite commented 1 year ago

So the CO detector is wireless, the Smoke is Wired, not sure if there is any reason why that is different. I am also having issues arming and disarming. Its stuck in Home but the alarm panel is in a disarmed state.

I will get those debug logs for you shortly.

CodyRWhite commented 1 year ago

Ahh it looks like your code is requiring Six Digit?

[12/27/2022, 4:59:26 PM] [homebridge-qolsys] Qolsys Panel Error (Error received(usercode):Please Enable Six Digit User Code or KeyPad is already Locked)
CodyRWhite commented 1 year ago
{
  "event": "INFO",
  "info_type": "SUMMARY",
  "partition_list": [
    {
      "partition_id": 0,
      "name": "partition1",
      "status": "DISARM",
      "secure_arm": false,
      "zone_list": [
        {
          "id": "D6A18B",
          "type": "Door_Window",
          "name": "Front Door",
          "group": "entryexitdelay",
          "status": "Closed",
          "state": "0",
          "zone_id": 1,
          "zone_physical_type": 1,
          "zone_alarm_type": 3,
          "zone_type": 1,
          "partition_id": 0
        },
        {
          "id": "D6A18C",
          "type": "Door_Window",
          "name": "Garage Door",
          "group": "entryexitdelay",
          "status": "Closed",
          "state": "0",
          "zone_id": 2,
          "zone_physical_type": 1,
          "zone_alarm_type": 3,
          "zone_type": 1,
          "partition_id": 0
        },
        {
          "id": "D6A18D",
          "type": "Door_Window",
          "name": "Back Door",
          "group": "entryexitdelay",
          "status": "Closed",
          "state": "0",
          "zone_id": 3,
          "zone_physical_type": 1,
          "zone_alarm_type": 3,
          "zone_type": 1,
          "partition_id": 0
        },
        {
          "id": "D6A18E",
          "type": "Motion",
          "name": "Hallway Motion Detector",
          "group": "awayinstantmotion",
          "status": "Closed",
          "state": "0",
          "zone_id": 4,
          "zone_physical_type": 2,
          "zone_alarm_type": 3,
          "zone_type": 2,
          "partition_id": 0
        },
        {
          "id": "D6A18F",
          "type": "Motion",
          "name": "Family Room Motion",
          "group": "awayinstantmotion",
          "status": "Closed",
          "state": "0",
          "zone_id": 5,
          "zone_physical_type": 2,
          "zone_alarm_type": 3,
          "zone_type": 2,
          "partition_id": 0
        },
        {
          "id": "D6A280",
          "type": "Door_Window",
          "name": "Basement Window",
          "group": "instantperimeter",
          "status": "Closed",
          "state": "0",
          "zone_id": 6,
          "zone_physical_type": 1,
          "zone_alarm_type": 3,
          "zone_type": 1,
          "partition_id": 0
        },
        {
          "id": "201-3462",
          "type": "Smoke_M",
          "name": "Upstairs Smoke Detector",
          "group": "smoke_heat",
          "status": "Closed",
          "state": "0",
          "zone_id": 7,
          "zone_physical_type": 1,
          "zone_alarm_type": 9,
          "zone_type": 111,
          "partition_id": 0
        },
        {
          "id": "8E8283",
          "type": "CODetector",
          "name": "Downstairs CO Detector",
          "group": "co",
          "status": "Closed",
          "state": "0",
          "zone_id": 8,
          "zone_physical_type": 7,
          "zone_alarm_type": 11,
          "zone_type": 6,
          "partition_id": 0
        },
        {
          "id": "D6A18A",
          "type": "TakeoverModule",
          "name": "Hardwire Translator",
          "group": "takeovermodule",
          "status": "Closed",
          "state": "0",
          "zone_id": 9,
          "zone_physical_type": 13,
          "zone_alarm_type": 0,
          "zone_type": 18,
          "partition_id": 0
        }
      ]
    }
  ],
  "nonce": "",
  "requestID": "b2f113cc-35c4-48b5-9f7b-7220eccf003f"
}
CodyRWhite commented 1 year ago

Ahh it looks like your code is requiring Six Digit?

The interesting part about this error is that I was using the habitat plugin and I was not receiving any errors... I can install it again and test it out.

EHylands commented 1 year ago

Please try version 0.0.11

Arming and Disarming partitions is still a work in progress. Please send log file content with sent command strings if possible.

I still don't own a IQ panel. My IQ2+ panel is in the mail. Once received, the debuging process will be much easier !

CodyRWhite commented 1 year ago

Aces yeah I just saw version .10 before your post here. Just tested it out. Everything looks normal ish except for arming. My guess and I am not sure what I am talking about but curious. Since the Smoke_M sensor provides a smoke and a heat sensor. Homekit only supports Smoke. So there will be no trigger for heat if such an even occurs (in HomeKit)

So I have a new error in arming/disarming.

[12/27/2022, 5:53:58 PM] [homebridge-qolsys] This plugin threw an error from the characteristic 'Security System Target State': Unhandled error thrown inside write handler for characteristic: Cannot read property 'toString' of undefined. See https://homebridge.io/w/JtMGR for more info.

My logs are super noisy with some secrets available I think. Is there a way to dump or filter logs to your plugin? Also just saw 0.11 is up trying that now.

CodyRWhite commented 1 year ago

0.11 back to same error

[12/27/2022, 5:59:40 PM] [homebridge-qolsys] Qolsys Panel Error ((usercode):Please Enable Six Digit User Code or KeyPad is already Locked)
EHylands commented 1 year ago

You are too fast for me ! Had a small error in 0.0.10 so did a fast upgrade to 0.0.11.

CodyRWhite commented 1 year ago

Ok enabled 6 digit.

Arm Home - Sets panel to "ARM_STAY" :white_check_mark: Arm Night - Sets panel to "ARM_STAY" :white_check_mark: Disarm - No change on Panel - No Error Away - I received an alert from Alarm.com that the panel was set to Away, but panel was still green disarmed. - No Error

Let me know if there is an easy way to get your logs and I will send them. I have a unifi camera system and just a few seconds in debug creates a HUGE file.

CodyRWhite commented 1 year ago

You are too fast for me ! Had a small error in 0.0.10 so did a fast upgrade to 0.0.11.

  • HomeKit smoke sensor will trigger for any condition that trips your Qolsys binary sensor
  • Theorically, you panel accessory should also trigger in case of fire or smoke detection

No I was curious if it would show in HomeKit which sensor was triggered Smoke vs Heat. Yeah this is just an overlay on top of our alarm all triggers will occur as normal I get that. I was just wondering incase Alarm.com was signed out would I get an alert from HomeKit before a call from the Alarm Company if Heat vs Smoke was triggered. I guess I was wondering if HomeKit offered capabilities for Smoke vs Heat, rather than just triggering the detector for both events. Obviously not super important but like I said curious :D

EHylands commented 1 year ago

You are too fast for me ! Had a small error in 0.0.10 so did a fast upgrade to 0.0.11.

  • HomeKit smoke sensor will trigger for any condition that trips your Qolsys binary sensor
  • Theorically, you panel accessory should also trigger in case of fire or smoke detection

No I was curious if it would show in HomeKit which sensor was triggered Smoke vs Heat. Yeah this is just an overlay on top of our alarm all triggers will occur as normal I get that. I was just wondering incase Alarm.com was signed out would I get an alert from HomeKit before a call from the Alarm Company if Heat vs Smoke was triggered. I guess I was wondering if HomeKit offered capabilities for Smoke vs Heat, rather than just triggering the detector for both events. Obviously not super important but like I said curious :D

Question is valid ! Was looking in combined smoke + co sensor myself. The sensor would be connected to 2 zones on my panel to allow for discrimination between smoke and carbon monoxde events.

Bosch panels will allow for multiple events detection on same zone (event, tamper, fault) with 2 end of line resistors, but I didn't see that option with qolsys panels.

Will check into arming commands ! I was taking for granted that the panel would pushed an update status after being armed away or disarmed, but maybe the update needs to be force. Will check again with Habitat plugin.

CodyRWhite commented 1 year ago

Disabled my other plugins.

Here is the log with a few arming attempts for each type. Same behavior as described before [removed]

CodyRWhite commented 1 year ago

Another note, not sure if you want to sanitize some of the debug logging to hash out secrets or something. I did not sanitize this, but I can reset codes easily after testing.

EHylands commented 1 year ago

Went through Hubitat plugin again. The only thing I can see for the moment is that your partition is configured with SecureArm = false. User_code is not needed in that situation for arming (ARM_STAY and ARM_AWAY) User_code is only needed to disarm partition No delay and bypass parameters are needed to disarm partition

Modified the following commands:

DISARM: {"version":1,"source":"C4","action":"ARMING","nonce":"","token":"*","user_code":"*","partition_id":0,"arming_type":"DISARM"}

ARM_STAY {"version":1,"source":"C4","action":"ARMING","nonce":"","token":"*","partition_id":0,"arming_type":"ARM_STAY","delay":60,"bypass":"true"}

ARM_AWAY {"version":1,"source":"C4","action":"ARMING","nonce":"","token":"*","partition_id":0,"arming_type":"ARM_AWAY","delay":60,"bypass":"true"}

User_code is now only added to arming command string if partition is configured with secure arm = true.

Also added an option in Homebridge-ui to show debug log without running homebridge in debug mode ! (temporary)

CodyRWhite commented 1 year ago

Ok soo interesting :)

Disarm still did not work. Night and Home working no change. Away worked.... but set it to Stay after the 60 second timer.

[removed]

EHylands commented 1 year ago

Away worked.... but set it to Stay after the 60 second timer.

Strange, but exactly what is happenning on the panel ! I not familiar with qolsys inner working yet. Is it possible that activity on zone5 while panel is in exit delay changes the arming mode from ARM_AWAY to AWAY_STAY ? You can test with a 0 sec exit delay and see if ARM_AWAY mode is set.

ARM_AWAY at 9:39:36 [12/27/2022, 9:39:36 PM] [homebridge-qolsys] Sending: {"version":1,"source":"C4","action":"ARMING","nonce":"","token":"*","partition_id":0,"arming_type":"ARM_AWAY","delay":60,"bypass":"true"}

EXIT_DELAY at 9:39:36 [12/27/2022, 9:39:36 PM] [homebridge-qolsys] Received: {"event":"ARMING","arming_type":"EXIT_DELAY","delay":60,"partition_id":0,"version":1,"requestID":"4ee23e97-f842-4b05-9d01-8e6fa4704500"} [12/27/2022, 9:39:36 PM] [homebridge-qolsys] Partition0(partition1): EXIT_DELAY

ARM_STAY ad 9:40:37, 60 sec later! [12/27/2022, 9:40:37 PM] [homebridge-qolsys] Received: {"event":"ARMING","arming_type":"ARM_STAY","partition_id":0,"version":1,"requestID":"fe85a6de-ced0-4eaa-9459-8c12d3c57648"} [12/27/2022, 9:40:37 PM] [homebridge-qolsys] Partition0(partition1): ARM_STAY

CodyRWhite commented 1 year ago

It's been so long lol I don't remember. I think I have to open and close a door actually... trying now.

CodyRWhite commented 1 year ago

Confirmed. soo what arm away is only useful when exiting. Typically if I would set away via HomeKit I have already left. There is a way to do this but I'll have to look it up again.

CodyRWhite commented 1 year ago

I have a feeling it's a arm away with no exit delay.

CodyRWhite commented 1 year ago

Confirmed again. So recap Arm away with exit delay if no one exits it arms stay.

Arm away with a 0 delay arms away instant and you cannot exit without a disarm..

EHylands commented 1 year ago

Confirmed again. So recap Arm away with exit delay if no one exits it arms stay.

Arm away with a 0 delay arms away instant and you cannot exit without a disarm..

Thank you for your debugging! Will try to read to see if that's a local configuration on your panel or if that applies to all IQ panel.

With Homekit, instant Arm Away with a 0 sec delay probably makes more sense in my own opinion.

CodyRWhite commented 1 year ago

With Homekit, instant Arm Away with a 0 sec delay probably makes more sense in my own opinion.

I agree.

As for the setting its in Settings -> Advanced -> (DealerCode) -> Installation -> Security and Alarm The installed asked me a bunch of questions, so I am not sure what is default and what he changed.

image

CodyRWhite commented 1 year ago

However disarm is still not working, oh and still in 6-digit codes.

EHylands commented 1 year ago

However disarm is still not working, oh and still in 6-digit codes.

Home assistant plugin is using version 0 command 4 interface.

DEFAULT_DATA = { 'nonce': 'qolsys', 'source': 'C4', 'version': 0, }

Will check with them to see if version 0 or version 1 changes anything!

EHylands commented 1 year ago

Had a typo in Security System accessory Disarm state handling. Could you try again Disarm command throught HomeKit with version 0.0.13 ? Tnx !

CodyRWhite commented 1 year ago

Tried it last night, disarm is still not working. No response json after the ACK.

[12/29/2022, 10:05:30 AM] [homebridge-qolsys] Sending: {"version":1,"source":"C4","action":"ARMING","nonce":"","token":"xxxxx","partition_id":0,"arming_type":"ARM_STAY","delay":0,"bypass":"true"}
[12/29/2022, 10:05:30 AM] [homebridge-qolsys] Received: ACK
[12/29/2022, 10:05:31 AM] [homebridge-qolsys] JSON OK
[12/29/2022, 10:05:31 AM] [homebridge-qolsys] Received: {"event":"ARMING","arming_type":"ARM_STAY","partition_id":0,"version":1,"requestID":"88dcbd54-edb8-4793-86ba-d3d6463081a7"}
[12/29/2022, 10:05:31 AM] [homebridge-qolsys] Partition0(partition1): ARM_STAY
[12/29/2022, 10:05:35 AM] [homebridge-qolsys] Sending: {"version":1,"source":"C4","action":"ARMING","nonce":"","token":"xxxx","user_code":"xxxx","partition_id":0,"arming_type":"DISARM"}
[12/29/2022, 10:05:35 AM] [homebridge-qolsys] Received: ACK
CodyRWhite commented 1 year ago

I did notice something weird in the Hubitat code. QolSysIQ-Panel.groovy Lines 236-250

def command = '{ "version": 1, "source": "C4", "action": "ARMING", "nonce": "", "token": "' + accessToken + '", "partition_id":' + partition_id.toString() + '", "arming_type": "' + arming_type + '", ' ;

Look at the partition_id it starts with a conversion to string but ends with a " but I don't see an opening ".. that would be malformed JSON. Does the partition id need to be encapsulated with ""?

ifeign commented 1 year ago

However disarm is still not working, oh and still in 6-digit codes.

Home assistant plugin is using version 0 command 4 interface.

DEFAULT_DATA = { 'nonce': 'qolsys', 'source': 'C4', 'version': 0, }

Will check with them to see if version 0 or version 1 changes anything!

Just wanted to add something since you're talking about HASS: If you are using the HASS Appdaemon integration, you have to disable it in order for this plugin to work. Worth noting in the readme, but minor enough to not require an entire new issue.

Unfortunately disarming isn't working for me. I'm using a 4 digit code, because I'm using firmware 2.6.1 which was the last version before 6 digits were required. Disarming worked fine with the HASS integration

EHylands commented 1 year ago

Typo fixed in 0.0.14: Probably why error was only occuring while disarming since secure arm is set to false ... user_code: this.UserPinCode to usercode: this.UserPinCode

ifeign commented 1 year ago

Typo fixed in 0.0.14: Probably why error was only occuring while disarming since secure arm is set to false ... user_code: this.UserPinCode to usercode: this.UserPinCode

you rock, disarming works! Go figure you did this after I just fought with XaF's QolsysGW HASS integration and got it working lmao (I was running the oooold version of the HASS integration by Roopesh). I much, much prefer Homebridge, so THANK YOU!

EHylands commented 1 year ago

However disarm is still not working, oh and still in 6-digit codes.

Home assistant plugin is using version 0 command 4 interface. DEFAULT_DATA = { 'nonce': 'qolsys', 'source': 'C4', 'version': 0, } Will check with them to see if version 0 or version 1 changes anything!

Just wanted to add something since you're talking about HASS: If you are using the HASS Appdaemon integration, you have to disable it in order for this plugin to work. Worth noting in the readme, but minor enough to not require an entire new issue.

Unfortunately disarming isn't working for me. I'm using a 4 digit code, because I'm using firmware 2.6.1 which was the last version before 6 digits were required. Disarming worked fine with the HASS integration

Panel is probably limiting simultaneous active connections to 12345 port. Will try running multiple Homebride instances to 12345 port once I receive my panel !

EHylands commented 1 year ago

Typo fixed in 0.0.14: Probably why error was only occuring while disarming since secure arm is set to false ... user_code: this.UserPinCode to usercode: this.UserPinCode

you rock, disarming works! Go figure you did this after I just fought with XaF's QolsysGW HASS integration and got it working lmao (I was running the oooold version of the HASS integration by Roopesh). I much, much prefer Homebridge, so THANK YOU!

Amazing ! Feels good to have almost everything working now !

I've been working on my Homebridge Bosch alarm system plugin for the last year and a half and it as been rock stable. Rewrote this plugin with the same code template since both panels are providing pushed notifications for on board events. Will be happy to make any changes as needed. Tnx a lot for helping out with beta versions !

ifeign commented 1 year ago

However disarm is still not working, oh and still in 6-digit codes.

Home assistant plugin is using version 0 command 4 interface. DEFAULT_DATA = { 'nonce': 'qolsys', 'source': 'C4', 'version': 0, } Will check with them to see if version 0 or version 1 changes anything!

Just wanted to add something since you're talking about HASS: If you are using the HASS Appdaemon integration, you have to disable it in order for this plugin to work. Worth noting in the readme, but minor enough to not require an entire new issue. Unfortunately disarming isn't working for me. I'm using a 4 digit code, because I'm using firmware 2.6.1 which was the last version before 6 digits were required. Disarming worked fine with the HASS integration

Panel is probably limiting simultaneous active connections to 12345 port. Will try running multiple Homebride instances to 12345 port once I receive my panel !

Oh wow, you think I could actually run both this AND the HASS plugin? That would be great, because I eventually do want to setup a HASS touchscreen dashboard

EHylands commented 1 year ago

However disarm is still not working, oh and still in 6-digit codes.

Home assistant plugin is using version 0 command 4 interface. DEFAULT_DATA = { 'nonce': 'qolsys', 'source': 'C4', 'version': 0, } Will check with them to see if version 0 or version 1 changes anything!

Just wanted to add something since you're talking about HASS: If you are using the HASS Appdaemon integration, you have to disable it in order for this plugin to work. Worth noting in the readme, but minor enough to not require an entire new issue. Unfortunately disarming isn't working for me. I'm using a 4 digit code, because I'm using firmware 2.6.1 which was the last version before 6 digits were required. Disarming worked fine with the HASS integration

Panel is probably limiting simultaneous active connections to 12345 port. Will try running multiple Homebride instances to 12345 port once I receive my panel !

Oh wow, you think I could actually run both this AND the HASS plugin? That would be great, because I eventually do want to setup a HASS touchscreen dashboard

This is undocumented territory. If Qolsys panel allows for 2 simultaneous active connections on port 12345, Homebridge plugin could run at the same time than HASS plugin. I think I've read on HASS support forum that Qolsys was not playing nice with simultaneous connections though.

Will test and report back !

CodyRWhite commented 1 year ago

Typo fixed in 0.0.14: Probably why error was only occuring while disarming since secure arm is set to false ... user_code: this.UserPinCode to usercode: this.UserPinCode

So updated and everything is working perfectly now. Thanks so much!

I tried reverting back to 4 digit again to see. Still have the same error of 6 digit required or something.

I'm on version 2.6.2 I guess if I was on a slightly older version both would be allowed based on what was said above. No way to test that now ;)

CodyRWhite commented 1 year ago

Let me know if you need me to test anything else otherwise I think this issue can be closed.