Lights require 2 commands to turn on
Closed this issue · 26 comments
Lights require me to turn them on 2x, before they come on. Turning off works consistent.
@Stugatza Are you using a hardware lighting device (like a jasco zwave) or a cloud integration (lutron)?
I have one zwave lighting device also connected to a my Qolsys panel. I don't t use the lightning functionality (only a z wave range extender to reach my garage) but I can't get mine to turn on at all. I can turn it off though.
likely not the best way to fix this, but i modified index.js (/usr/local/lib/node_modules/homebridge-node-alarm-dot-com)
Insert "brightness = true" to line to line 819 above "method = nodeADC.setLightOn"
Restart homebridge
this now works consistently for me... Perhaps others can test?
I believe @chase9 wrote the light implementation and it was only meant for dimmers if I recall correctly.
I had thought this was fixed by adding a method overload for basic lights but I will go back and run through it.
likely not the best way to fix this, but i modified index.js (/usr/local/lib/node_modules/homebridge-node-alarm-dot-com)
Insert "brightness = true" to line to line 819 above "method = nodeADC.setLightOn"
Restart homebridge
this now works consistently for me... Perhaps others can test?
Where can I find this path? I tried finding it on my raspberry pi but directory cannot be found. I have homebridge installed on Raspberian and I am completely knew to it, just set it up today and have a couple plugins working but running into the lighting issue with this plugin. Thanks
Edit: I have found the file under /usr/lib/... had to remove /local/ but unable to modify file due to level of permissions. I can’t seem to change the permissions to allow write access but will play with it some more.
Edit 2: Figured out the permissions situation and updated the file. I am now able to turn the lights on but no longer able to turn them back off. Tapping the icon will toggle off but quickly back on and light status doesn’t change.
There are two characteristics we care about when looking at lights, "brightness" and "on". I believe where we're getting stuck is that homekit likes to modify both values at once, whereas alarm.com expects any modifications to a light to happen in one API call.
I just rewrote some of the light implementation on the typescript branch and things seem to be working well! I'm unable to get my light into "not responding" state, and it accepts all commands in a timely fashion. If you could try the latest code out and let me know how it's working for you, that would be great!
There are two characteristics we care about when looking at lights, "brightness" and "on". I believe where we're getting stuck is that homekit likes to modify both values at once, whereas alarm.com expects any modifications to a light to happen in one API call.
I just rewrote some of the light implementation on the typescript branch and things seem to be working well! I'm unable to get my light into "not responding" state, and it accepts all commands in a timely fashion. If you could try the latest code out and let me know how it's working for you, that would be great!
Hey, I’m just getting time to play around with my homebridge setup and honestly, hopefully to not look like an idiot, I’m not too sure on how to install/use the updated code. I tried downloading the .zip file and overwriting the existing homebridge-node-alarm-dot-com folder and files with the typescript files from the zip. I also tried to mom install -g homebridge-node-alarm-dot-com-typescript and the same but used the https://github.com/node-alarm-dot-com/homebridge-node-alarm-dot-com.git from the typescript branch and still no joy. Sorry to be such a noob on this as I am, mind pointing me in a direction that i can read up on how to go about installing this code? Thanks
Hey @iBanks3. Please don't feel like a noob, It was hard to get started for me as well. I still don't understand NPM packaging, which is why I don't have a good way to get you the updated code!
I'll attach the updated index.js files for you to replace. The issue you ran into is that Typescript (.ts) files need to be transpiled into Javascript (.js) files before they can be used.
If you replace your files with the files I attached you should have the latest.
Hey @iBanks3. Please don't feel like a noob, It was hard to get started for me as well. I still don't understand NPM packaging, which is why I don't have a good way to get you the updated code!
I'll attach the updated index.js files for you to replace. The issue you ran into is that Typescript (.ts) files need to be transpiled into Javascript (.js) files before they can be used.
If you replace your files with the files I attached you should have the latest.
I was looking for the files to replace but not finding the file names you've attached in the folder /usr/lib/node_modules/homebridge-node-alarm-dot-com/node_modules/node-alarm-dot-com. Perhaps the wrong folder I am looking in? I also noticed the _MACOSX folder within the archive, could it also be that I am using Homebridge on a Raspberry Pi and not MacOS as to why I don't see these files?
Hey @iBanks3. Please don't feel like a noob, It was hard to get started for me as well. I still don't understand NPM packaging, which is why I don't have a good way to get you the updated code!
I'll attach the updated index.js files for you to replace. The issue you ran into is that Typescript (.ts) files need to be transpiled into Javascript (.js) files before they can be used.
next.zip
If you replace your files with the files I attached you should have the latest.I was looking for the files to replace but not finding the file names you've attached in the folder /usr/lib/node_modules/homebridge-node-alarm-dot-com/node_modules/node-alarm-dot-com. Perhaps the wrong folder I am looking in? I also noticed the _MACOSX folder within the archive, could it also be that I am using Homebridge on a Raspberry Pi and not MacOS as to why I don't see these files?
I am also having the same issue and am looking to replace the files but can't seem to find where to replace the files ? Sorry...
likely not the best way to fix this, but i modified index.js (/usr/local/lib/node_modules/homebridge-node-alarm-dot-com)
Insert "brightness = true" to line to line 819 above "method = nodeADC.setLightOn"
Restart homebridge
this now works consistently for me... Perhaps others can test?Where can I find this path? I tried finding it on my raspberry pi but directory cannot be found. I have homebridge installed on Raspberian and I am completely knew to it, just set it up today and have a couple plugins working but running into the lighting issue with this plugin. Thanks
Edit: I have found the file under /usr/lib/... had to remove /local/ but unable to modify file due to level of permissions. I can’t seem to change the permissions to allow write access but will play with it some more.
Edit 2: Figured out the permissions situation and updated the file. I am now able to turn the lights on but no longer able to turn them back off. Tapping the icon will toggle off but quickly back on and light status doesn’t change.
I did this above and seems to consistently work. My only question is, does this affect the ability to change the light level (dimming)?
I'm sorry, I'm having trouble understanding. With this configuration, do you see the dimming switch and all, but dimming doesn't do anything?
The project has been updated with changes making lights more reliable. Please let me know if you still have issues after updating!
The project has been updated with changes making lights more reliable. Please let me know if you still have issues after updating!
Update via plugin update via Homebridge UI or download files separately here?
The updated version of this plugin will be available via the UI shortly. I'm just cleaning some things up first.
Thanks! It's was just pushed up. You can ping me here or on the Discord if you find any problems.
Still getting errors on this:
[3/10/2021, 09:35:51] [Security System] Error: Failed to change light state: Error: POST https://www.alarm.com/web/api/devices/lights/94428553-1220/turnOn failed: 423
at /usr/local/lib/node_modules/homebridge-node-alarm-dot-com/node_modules/node-alarm-dot-com/dist/index.js:493:15
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:97:5)
I also have a Google Home module tied into HomeKit. That module puts all my switches into Google Home. They work fine there, but Apple Home is having issues. Even if i disable the Google Home Plugin, the issue persists.