bryan-bartow / homebridge-alarm.com

Alarm.com plugin for Homebridge
ISC License
43 stars 11 forks source link

support z-wave lights? #21

Closed rcaslis closed 7 years ago

rcaslis commented 8 years ago

Any chance that support for z-wave lights through alarm.com can be added to this project? Thanks...

bryanbartow commented 8 years ago

@rcaslis I don't have any z-wave lights as part of my setup, but you're more than welcome to submit a pull request and I'll merge it in.

ghost commented 8 years ago

I have zwave switches with my alarm.com account. Not certain how to integrate them into this great project

bryanbartow commented 8 years ago

@jeremysmith214 You'd have to do what myself and @yungsters did: Use WrapAPI to create calls that perform the necessary functions on the Alarm.com site, then integrate those calls into the plugin.

ghost commented 8 years ago

I was able to successfully integrate zwave lights into wrap api. Now I need you guys help in how can it be integrated into homebridge

ghost commented 8 years ago

Please bare with my low level of expertise in these matters. I have only been playing with homebridge for about a month and a half

rcaslis commented 8 years ago

@jeremysmith214 I see that you added an 'alllightson' and 'alllightsoff' functions to wrapapi... could you try enumerating the lights similar to what the lock functions do?

I've got about 8 different lights on my system and it's fairly rare I'll want to turn on/off the porch lights at the same time as the living room lights. ;-)

I'll probably try my hand at some of these coding projects soon but I've got a few other, time-sensitive projects to complete first.

Oh... and thanks!

ghost commented 8 years ago

I only did a few lights. Its easy to do more zwave lights utilizing wrap api. I think its up to @bryanbartow to create something on the other end for this to possibly work with home bridge

rcaslis commented 8 years ago

@jeremysmith214 I only see functions you added for alarmdotcom for 'all lights on' and 'all lights off'. I better approach would be like is done for the locks function where one call gets a list of locks and other calls lock/unlock them.

I believe we could make changes to the repository to include the extra functions. Then @bryanbartow would just have to do a pull request.

rcaslis commented 8 years ago

@jeremysmith214 looking over your 'alllightson' and 'alllightsoff' APIs I don't think they will work. For starters, they appear to have a hard-coded session key. I'm not sure what your plans are for the cloned lock/unlock/locks APIs.

I've written an API 'lights' that provides a list of the lights in a given account similar to the way the 'locks' API works. It should be easier to create the corresponding 'lighton' and 'lightoff' APIs... hopefully I'll get to that in the next week or so.

After that, it will be changes to the plugin. That will be harder since I understand little nodejs or the HomeKit internals but maybe I'll get lucky.

ghost commented 8 years ago

Thanks. I was trying times thing different with my locks clone to see could j get that functionality to work but still no luck. Keep me posted on the lights functionality

rcaslis commented 8 years ago

I added working functions for 'lighton' and 'lightoff' to WrapAPI. Sadly the mobile alarm.com interface can only turn lights on or off... not support for dimmers.

So... the easy part is done. :-/

rcaslis commented 8 years ago

Well, it's really bad code but I have working lights with this plugin now. I've submitted a pull request.

ghost commented 8 years ago

This is awesome @rcaslis . I know this is off subject. Is there anything you did differently to get the wave locks to work. No luck on my end

rcaslis commented 8 years ago

@jeremysmith214 Thanks.

Do you mean you are having trouble with the locks & homebridge or locks in general? I've definitely found locks to be temperamental in my house (long before homebridge). Sometimes my system just forgets how to talk to the locks... even a rediscovery doesn't help. I've found power-cycling the security panel (and disconnecting the battery) restores it.

bryanbartow commented 8 years ago

I've merged @rcaslis PR. I think I'll close this issue within the next few days unless someone gives me a reason not to.

ghost commented 8 years ago

@rcaslis I think I found my issue. I think my issue maybe what type of app in using. I have tried two separate apps. One won't even recognize my security system. Do you mind me asking what type of iOS app you are using. The app that does show mty security system still isn't showing any locks or zwave lights.

ghost commented 8 years ago

Please bear with me guys. Im a complete beginner but enjoy your help. Do I have to do something to the wrap api once I bookmark it. Do I have to grab a website to paste into the session url. Where do I get that code. Sorry I just don't know.

rcaslis commented 8 years ago

@jeremysmith214 I've used several - all but 1 worked fine with lights, locks, & alarm. The one that didn't work only had problems with lights as it was sending a 0 or 1 instead of false or true. I'll probably update the code to account for that. Right now I've settled on 'MyTouchHome' and 'MyHome'.

As for WrapAPI, other than a bookmark you won't have to do anything there since the APIs are already written.

rcaslis commented 8 years ago

@bryanbartow Sounds good. I have no objections.

bryanbartow commented 8 years ago

@jeremysmith214 The plugin uses the init call in WrapAPI to get the session (when needed). All you have to do is clone the calls and supply the correct credentials and WrapAPI server key to the plugin config.

bryanbartow commented 8 years ago

@jeremysmith214 Sorry. Meant server key.

ghost commented 8 years ago

I have done everything imaginable and still can't find any lights or locks on my app. I have tried various apps to see which one will support lights or see lights and no luck. I cloned the wrapapi endpoints, I honestly don't know if Im just missing a final step but I have tried. Thanks for everything gentlemen.

bryanbartow commented 8 years ago

@ghost Did you create a server key on WrapAPI and add it to your homebridge config file, as per the plugin README?

rcaslis commented 8 years ago

@ghost Try logging into the mobile alarm.com site (https://m.alarm.com). Do you see lights and locks there?

bryanbartow commented 8 years ago

@ghost Any update on this? I'd like to close it.

bryanbartow commented 7 years ago

Closing this. I'll reopen if and when @ghost returns with an update.