gawindx / homebridge-risco-platform

RiscoAlarm Platform for Homebridge - Originally based on the 'szlaskidaniel / homebridge-risco-alarm' project
5 stars 1 forks source link

Dectectors not found #44

Closed reinierkops closed 3 years ago

reinierkops commented 3 years ago

I have a few sensors, but get the following error:

[3/21/2021, 3:34:52 PM] [Risco Alarm] Accessories Init Phase Started [3/21/2021, 3:34:52 PM] [Risco Alarm] Discovering Phase Started [3/21/2021, 3:34:53 PM] [Risco Alarm] Cloud Authentication Successfull [3/21/2021, 3:34:53 PM] [Risco Alarm] Retrieving Cloud Session: Ok [3/21/2021, 3:34:53 PM] [Risco Alarm] Error on Discovery Detector: TypeError: Cannot read property 'replace' of null at /homebridge/node_modules/homebridge-risco-platform/Risco.js:570:38 at /homebridge/node_modules/homebridge-risco-platform/Risco.js:604:31 at Array.forEach (<anonymous>) at /homebridge/node_modules/homebridge-risco-platform/Risco.js:563:22 at RiscoPanelSession.DiscoverDetectors (/homebridge/node_modules/homebridge-risco-platform/Risco.js:656:19) at RiscoPanelPlatform.DiscoverAccessoriesFromRiscoCloud (/homebridge/node_modules/homebridge-risco-platform/app.js:439:78) at processTicksAndRejections (internal/process/task_queues.js:93:5) at Timeout._onTimeout (/homebridge/node_modules/homebridge-risco-platform/app.js:109:17) [3/21/2021, 3:34:53 PM] [Risco Alarm] Discovering Phase Ended [3/21/2021, 3:34:53 PM] [Risco Alarm] PreConf Phase Started [3/21/2021, 3:34:53 PM] [Risco Alarm] Add Accessory => Add Detectors [3/21/2021, 3:34:53 PM] [Risco Alarm] PreConf Phase Ended [3/21/2021, 3:34:53 PM] [Risco Alarm] Create Accessory Phase Started [3/21/2021, 3:34:53 PM] [Risco Alarm] Accessories Init Phase Ended

Version: homebridge-risco-platform v1.2.5

This is when I set "Partition":"all" [3/21/2021, 3:45:37 PM] [Risco Alarm] Accessories Init Phase Started [3/21/2021, 3:45:37 PM] [Risco Alarm] Discovering Phase Started [3/21/2021, 3:45:37 PM] [Risco Alarm] Cloud Authentication Successfull [3/21/2021, 3:45:37 PM] [Risco Alarm] Retrieving Cloud Session: Ok [3/21/2021, 3:45:37 PM] [Risco Alarm] Partinfo : all [3/21/2021, 3:45:37 PM] [Risco Alarm] Discovered 0 Partitions [3/21/2021, 3:45:37 PM] [Risco Alarm] Discovering Phase Ended [3/21/2021, 3:45:37 PM] [Risco Alarm] PreConf Phase Started [3/21/2021, 3:45:37 PM] [Risco Alarm] PreConf Accessory => Add Partitions [3/21/2021, 3:45:37 PM] [Risco Alarm] PreConf Phase Ended [3/21/2021, 3:45:37 PM] [Risco Alarm] Create Accessory Phase Started [3/21/2021, 3:45:37 PM] [Risco Alarm] Accessories Init Phase Ended

gawindx commented 3 years ago

I have just published v1.2.7 which allows to activate an option to log the responses of RiscoCloud. This will allow you to better understand the problem you are having.

Update to the new version and activate the option in your config file (logRCResponse to true). Once done, retrieve the logs with the error and the corresponding informations.

Be careful, if you have cameras, and even if the plugin does not support them yet, the information is still retrieved and information such as external IP/port and login/password of the cameras may appear.

This information is located after the line "getCPStates Cameras RC_Response" I will recommend that you erase this information first (I will improve this later to automatically offend them).

gawindx commented 3 years ago

Have you been able to update and retrieve the logs so that I can analyze this? it seems that in your configuration, some information is not contained in the response of the RiscoCloud (in any case that's what lets me think the place where the error is located).

So, either as I think there is something missing, or there is another problem. Without your logs, I can't analyze and fix it.

reinierkops commented 3 years ago

This is the response i get from riscocloud: getCPStates Panel RC_Response : { "result": 0, "validationErrors": null, "errorText": null, "errorTextCodeID": "0", "status": 200, "response": { "classVersion": 0, "id": [HIDDEN], "cpid": "[HIDDEN]", "isAcomEnabled": false, "state": { "classVersion": 0, "isOnline": true, "type": 2, "media": 2, "lastConnectedTime": "2021-03-22T19:04:25.2524372Z", "lastLogUpdate": "2021-03-21T14:50:26.62Z", "lastStatusUpdate": "2021-03-22T19:04:25.2443254Z", "lastEvReported": "2021-03-21T14:48:03.8212669Z", "features": null, "status": { "classVersion": 0, "partitions": null, "systemStatus": 0, "systemReady": true, "trouble": true, "bellStatus": 0, "alarmPending": true, "batteryLow": true, "acLost": false, "haEnabled": false, "bellOn": false, "zones": [ { "zoneID": 0, "zoneName": "[HIDDEN]", "zoneType": 1, "status": 0, "trouble": false, "part": 0, "regDevSN": "[HIDDEN]", "pirCam": null, "partAssocMask": null, "presenceMuted": 2 }, { "zoneID": 1, "zoneName": "[HIDDEN]", "zoneType": 2, "status": 0, "trouble": true, "part": 0, "regDevSN": "[HIDDEN]", "pirCam": null, "partAssocMask": null, "presenceMuted": 2 }, { "zoneID": 2, "zoneName": "[HIDDEN]", "zoneType": 2, "status": 0, "trouble": false, "part": 0, "regDevSN": "[HIDDEN]", "pirCam": null, "partAssocMask": null, "presenceMuted": 2 }, { "zoneID": 3, "zoneName": "[HIDDEN]", "zoneType": 1, "status": 0, "trouble": false, "part": 0, "regDevSN": "[HIDDEN]", "pirCam": null, "partAssocMask": null, "presenceMuted": 2 }, { "zoneID": 9, "zoneName": "[HIDDEN]", "zoneType": 6, "status": 0, "trouble": false, "part": 0, "regDevSN": "[HIDDEN]", "pirCam": null, "partAssocMask": null, "presenceMuted": 2 }, { "zoneID": 10, "zoneName": "[HIDDEN]", "zoneType": 6, "status": 0, "trouble": false, "part": 0, "regDevSN": "[HIDDEN]", "pirCam": null, "partAssocMask": null, "presenceMuted": 2 }, { "zoneID": 11, "zoneName": "[HIDDEN]", "zoneType": 6, "status": 0, "trouble": false, "part": 0, "regDevSN": "[HIDDEN]", "pirCam": null, "partAssocMask": null, "presenceMuted": 2 }, { "zoneID": 12, "zoneName": "[HIDDEN]", "zoneType": 6, "status": 0, "trouble": false, "part": 0, "regDevSN": "[HIDDEN]", "pirCam": null, "partAssocMask": null, "presenceMuted": 2 }, { "zoneID": 13, "zoneName": "[HIDDEN]", "zoneType": 6, "status": 0, "trouble": false, "part": 0, "regDevSN": "[HIDDEN]", "pirCam": null, "partAssocMask": null, "presenceMuted": 2 }, { "zoneID": 14, "zoneName": "[HIDDEN]", "zoneType": 6, "status": 0, "trouble": false, "part": 0, "regDevSN": "[HIDDEN]", "pirCam": null, "partAssocMask": null, "presenceMuted": 2 }, { "zoneID": 19, "zoneName": "[HIDDEN]", "zoneType": 2, "status": 0, "trouble": false, "part": 0, "regDevSN": "[HIDDEN]", "pirCam": { "compression": 0, "resolution": 2, "color": true, "disableFlash": true, "totalPictures": 3, "diffPictures": 0, "snapshotDelay": 45 }, "partAssocMask": null, "presenceMuted": 2 }, { "zoneID": 20, "zoneName": "[HIDDEN]", "zoneType": 1, "status": 0, "trouble": true, "part": 0, "regDevSN": "[HIDDEN]", "pirCam": { "compression": 0, "resolution": 2, "color": true, "disableFlash": true, "totalPictures": 3, "diffPictures": 0, "snapshotDelay": 45 }, "partAssocMask": null, "presenceMuted": 2 }, { "zoneID": 21, "zoneName": "[HIDDEN]", "zoneType": 2, "status": 0, "trouble": false, "part": 0, "regDevSN": "[HIDDEN]", "pirCam": { "compression": 0, "resolution": 2, "color": true, "disableFlash": true, "totalPictures": 3, "diffPictures": 0, "snapshotDelay": 45 }, "partAssocMask": null, "presenceMuted": 2 }, { "zoneID": 22, "zoneName": "[HIDDEN]", "zoneType": 1, "status": 0, "trouble": false, "part": 0, "regDevSN": "[HIDDEN]", "pirCam": { "compression": 0, "resolution": 2, "color": true, "disableFlash": true, "totalPictures": 3, "diffPictures": 0, "snapshotDelay": 45 }, "partAssocMask": null, "presenceMuted": 2 } ], "haDevices": [[HIDDEN]], "users": [[HIDDEN]], "devCollection": [], "exitDelayTimeout": 0, "armNotAllowed": false, "disarmNotAllowed": false, "cpTime": "2021-03-22T20:03:00", "partReadySupported": false, "partFullReady": false, "part1Ready": false, "part2Ready": false, "type": 2 }, "cpDescEncName": "windows-1252" } } }

gawindx commented 3 years ago

without being too mistaken, I would say that your panel is either an Agility or perhaps a Wicomm (I will bet more on this model)

what amazes me is:

these values explain the errors encountered.

you should tell me a little more about your panel:

For now, the plugin is valid for agility and lightsys, if it's a wicomm, I can't guarantee you perfect support without having access to a panel of this type.

reinierkops commented 3 years ago
gawindx commented 3 years ago

This one I don't know.

As for partition and zone detection, this shouldn't be too much of a problem to implement.

On the other hand, where it risks getting stuck is that, not having this model of control unit available, I cannot make a test and the API which is used to activate / deactivate the partition ( and maybe one or two other infos - I do not have all the code in mind) uses the numbers of the partition.

This means that the activation / deactivation may not be functional at first.

Could you give me the first 3 digits of your PanelID (number used to register the unit on RiscoCloud). If it works like with other Panel, these first 3 digits should identify the Panel model and therefore allow me to detect and set some variables when discovering devices.

reinierkops commented 3 years ago

PanelId is 060000 + (5 extra digits)

gawindx commented 3 years ago

okay

time to adapt the code for this type of panel and I will get back to you.

subsidiary question, do you have sufficient knowledge to manually update the plugin or not? if so, I could provide you with the updated code for testing before publication. Otherwise, I will release a version and you can test if it works for this model.

reinierkops commented 3 years ago

i can do it manually, no problem

reinierkops commented 3 years ago

Any updates from your side? Can I also do a small test?

gawindx commented 3 years ago

Hi, I'm working on it, don't worry. it's just that a few pro and personal unforeseen events from the last few days hardly left me time to work on it.

I should be able to get you a test version by the end of the week if time permits.

gawindx commented 3 years ago

The first version of the code is available here ("special-panel-type" branch). Only the "app.js" and "Risco.js" files need to be modified.

I hope not to have lacked discernment on the elements to modify. For some, such as the state of the system, I am not sure of the result you will get, in this case it will be advisable to provide me with the logs corresponding to each state of the system so that I can extract the logic that goes well.

Regarding the arming / disarming, I have no certainty about the result of actions via homekit, the problem being that if it does not work, it will be necessary to do a little reverse engineering to retrieve the information to be transmitted to the Cloud for then 'adapt to code.

By the way, I also reviewed the function allowing to enter the responses of RiscoCloud in the logs, they should therefore now be entered in a more anonymized way (I have, however, kept the entry of the detector names in clear in the case of or some special characters could be responsible for error in the code - I am thinking in particular of Asian characters or badly supported encoding).

For the test procedure, I will tend to do the following:

In the event that I will have to guess the right information at the first attempt (not sure but I think I have understood the logic since time), we could move on to the second phase of testing, namely:

And finally, the last step:

If during these various tests, the state or the commands are not correctly carried out / reported, retrieve the responses from the RiscoCloud by clearly identifying each one for analysis.

If it comes to retro engineering, we can discuss the 2 possible methods for this (everything will depend on your confidence in me for the first, for the second, I think you have the necessary skills).

gawindx commented 3 years ago

a little feedback on how it works?

gawindx commented 3 years ago

This issue is closed due to the stop of the development of the plugin. For more information, see here