node-alarm-dot-com / homebridge-node-alarm-dot-com

Alarm.com plugin for Homebridge using Node.js
MIT License
61 stars 23 forks source link

Alarm.com (FrontPoint) Light Control #40

Closed tomiy1 closed 4 years ago

tomiy1 commented 4 years ago

Describe the bug Added the plugin into homebridge and added the light dimmer switches to my system, but when trying to turn on the lights via Homekit, I get the following error in the HB UI log:

[5/20/2020, 14:49:52] [Security System] Changing light (91028770-1225, false light level 100) [5/20/2020, 14:49:53] [Security System] Error: Failed to change light state: Error: POST https://www.alarm.com/web/api/devices/lights/91028770-1225/turnOff failed: 403 at /usr/local/lib/node_modules/homebridge-node-alarm-dot-com/node_modules/node-alarm-dot-com/index.js:491:13 at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:97:5) (node:2514) UnhandledPromiseRejectionWarning: Error: This callback function has already been called by someone else; it can only be called one time. at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:6:13 at /usr/local/lib/node_modules/homebridge-node-alarm-dot-com/index.js:675:9 at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:97:5) (node:2514) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

To Reproduce Please see above...

Expected behavior Lights turn on/off

Screenshots If applicable, add screenshots to help explain your problem.

Homebridge System (please complete the following information):

Additional context N/A

mkormendy commented 4 years ago

This is the exact same issue already reported in issue #27. If you're using npm to install the homebridge plugin - lights will not work, yet.

If you attempt to install from github, you can access the latest updated working code for lights, but the implementation only partially works.

I have not updated this project on npm because the lights do not update their status in homekit/homebridge when they are controlled manually from the switches on your walls.

If you don't care about the status, or want to test the updated code regardless, there are plenty of tutorials online on how to install using the code from github, however just remember that the latest node-alarm-dot-com sub-package will have to be installed as well as a dependency of the root plugin package.

tomiy1 commented 4 years ago

Thanks for the explanation. Makes sense! I wasn’t aware lighting was not supported. Thanks again for your hard work :)

On Wed, May 20, 2020 at 8:30 PM Mike Kormendy notifications@github.com wrote:

If you're using npm to install the homebridge plugin - lights will not work, yet.

If you attempt to install from github, you can access the latest updated working code for lights, but only partially.

I have not updated this project on npm because the lights do not update their status in homekit/homebridge when they are controlled manually from the switches on your walls.

If you don't care about the status, or want to test the updated code regardless, there are plenty of tutorials online on how to install using the code from github, however just remember that the latest node-alarm-dot-com sub-package will have to be installed as well.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mkormendy/homebridge-node-alarm-dot-com/issues/40#issuecomment-631857744, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDLEADRWBPTJ4ADJHKMFGDRSSN4PANCNFSM4NGK2OLA .

tomiy1 commented 4 years ago

Quick follow up regarding the lock control... I noticed that often times the 2 door locks I have show up as open/unlocked when in fact theyre locked. Only way to get the proper "locked" status is usually when i exit Home macOS app and restart it. Suggestions? thanks!

mkormendy commented 4 years ago

The same issue with the light status, is the same for the locks as well.

At this point we cannot reliably determine the state of devices/accessories. This is a limitation with the Alarm.com exposed API calls presently. There may be another way around it but I haven't had time to research lately.

tomiy1 commented 4 years ago

Ok, thank you for the info :)