tkleijkers / homebridge-visonic-powerlink3

MIT License
1 stars 3 forks source link

rest_api tycomonitor changed? #11

Closed damianfm closed 2 years ago

damianfm commented 2 years ago

Hi!

Today i was receiving a lot of errors from plugin.

[12/1/2022 16:16:38] SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse () at /usr/lib/node_modules/homebridge-visonic-powerlink3/node_modules/visonic-powerlink3/index.js:84:32 at Request._callback (/usr/lib/node_modules/homebridge-visonic-powerlink3/node_modules/visonic-powerlink3/index.js:309:4) at Request.self.callback (/usr/lib/node_modules/homebridge-visonic-powerlink3/node_modules/request/request.js:185:22) at Request.emit (node:events:390:28) at Request. (/usr/lib/node_modules/homebridge-visonic-powerlink3/node_modules/request/request.js:1154:10) at Request.emit (node:events:390:28) at IncomingMessage. (/usr/lib/node_modules/homebridge-visonic-powerlink3/node_modules/request/request.js:1076:12) at Object.onceWrapper (node:events:509:28) at IncomingMessage.emit (node:events:402:35) at endReadableNT (node:internal/streams/readable:1343:12) at processTicksAndRejections (node:internal/process/task_queues:83:21)

Debuging errors, i found that "https://visonic.tycomonitor.com/rest_api/8.0/panel/login" shows me a "404", and i tried to change to "https://visonic.tycomonitor.com/rest_api/9.0/panel/login" and it runs ok.

So, i decide to change "self.restVersion" from 8.0 to 9.0 in /usr/lib/node_modules/homebridge-visonic-powerlink3/node_modules/visonic-powerlink3/index.js and now it's running ok

Someone else with this error?

StuFull commented 2 years ago

I had the same problem.

The fix above works - Thanks.

damianfm commented 2 years ago

You're welcome. Please @tkleijkers could you please confirm this "patch"?. Thanks

witchdrash commented 2 years ago

Nice work around, let me give that a shot

tkleijkers commented 2 years ago

Nice work. Seems like Visonic updated the API. I updated the repository and will push an update to npm.

JSVarga commented 2 years ago

I'm frustratingly still on the old Visonic monitoring connection with a Panel Name and PIN. Any chance the previous version, possibly v1, could me made available to reinstall for backward compatibility. Keep hassling my alarm company but not much luck yet.

YecheT commented 2 years ago

The fix above works for me as well - Thanks.

nitaybz commented 2 years ago

@tkleijkers are you intending to push a fix for that? I saw you already made the fix (on Github only) for the visonic-powerlink3 lib. is it possible to push to npm and update current plugin to use that version?

tkleijkers commented 2 years ago

@nitaybz Update has been pushed to NPM