fdegier / homebridge-jablotron-alarm

Homebridge plugin for connecting Jablotron JA-100 alarm systems to Homekit.
The Unlicense
26 stars 5 forks source link

Helper doesn't work #36

Closed maaraneasi closed 5 years ago

maaraneasi commented 5 years ago

Hi!

Thanks for the plugin! I tried to set it up according to your readme but I hit an issue when using the helper:

/homebridge/node_modules/homebridge-jablotron # node config-helper.js user@emailsomething.com somepassword
/homebridge/node_modules/homebridge-jablotron/config-helper.js:38
                for (let i = 0; i < services.length; i++) {
                                             ^

TypeError: Cannot read property 'length' of undefined
    at /homebridge/node_modules/homebridge-jablotron/config-helper.js:38:46
    at /homebridge/node_modules/homebridge-jablotron/lib/jablotron-client.js:20:17
    at IncomingMessage.<anonymous> (/homebridge/node_modules/homebridge-jablotron/lib/jablotron-client.js:56:17)
    at IncomingMessage.emit (events.js:215:7)
    at endReadableNT (_stream_readable.js:1183:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
/homebridge/node_modules/homebridge-jablotron #

Any idea what went wrong?

Thanks!!!

fdegier commented 5 years ago

Will look into it and report back.

fdegier commented 5 years ago

I just checked it and it works fine, which version of node are you using?

maaraneasi commented 5 years ago

I am running the docker image https://github.com/oznu/docker-homebridge The version of node is 12.13.0 /homebridge/node_modules/homebridge-jablotron # node --version v12.13.0

fdegier commented 5 years ago

Tried it with your node version, works here. Do you have internet connectivity? Running in docker?

maaraneasi commented 5 years ago

Yeah I am running directly in docker. The connectivity is fine and I can reach the jablotron's api from within the container: /homebridge/node_modules/homebridge-jablotron # ping api.jablonet.net PING api.jablonet.net (194.169.224.30) 56(84) bytes of data. 64 bytes from 194.169.224.30 (194.169.224.30): icmp_seq=1 ttl=54 time=2.98 ms 64 bytes from 194.169.224.30 (194.169.224.30): icmp_seq=2 ttl=54 time=2.97 ms 64 bytes from 194.169.224.30 (194.169.224.30): icmp_seq=3 ttl=54 time=2.76 ms ^C --- api.jablonet.net ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 3ms rtt min/avg/max/mdev = 2.761/2.904/2.982/0.101 ms

I tried from a regular os install (non-docker) a few weeks ago and ended up with the same error.

maaraneasi commented 5 years ago

actually, let me try one more thing.... EDIT: nope... doesn't work :(

fdegier commented 5 years ago

Maybe its failing on a special character not being escaped properly?

fdegier commented 5 years ago

Are you using this account also on your phone? It might be that if you just created this account you still need to verify it via the app / website.

maaraneasi commented 5 years ago

Yeah you are absolutely correct! I created the account only for this propose and it was waiting for the first login and for my agreement with the TOS. Thanks for your help - its much appreciated!

misncz commented 5 years ago

The helper should be able to handle this without stacktrace and provide more meaningful msg to the users. We will provide a change that accomodates this fix

fdegier commented 5 years ago

Someone else also reported this problem earlier, the code itself also crashes on it, so yes the helper but also the actual program should both detect this issue and log it.

fdegier commented 5 years ago

Confighelper has been updated.