luc-ass / homebridge-evohome

Homebridge plugin for Honeywell Evohome
29 stars 16 forks source link

Multiple Evohome Locations #13

Closed tim-payne closed 5 years ago

tim-payne commented 7 years ago

Is there any way within the homebridge-evohome plugin to pull multiple locations from Honeywells' servers? e.g. in the config.json file passing "location" = Unfortunately I have more than 12 zones so had to setup two locations. The devices in the first location are being pulled and I do get a message saying "You have 2 location(s). Only the first one will be used!"

thanks

luc-ass commented 7 years ago

Ha, I wondered when the first instance of this problem would occur... that's why this message exists. I'll have a look into it. In theory the initialization should be the place to start...

tim-payne commented 7 years ago

Hi Luc, did you manage to get a chance to have a look at whether this is possible?

luc-ass commented 6 years ago

actually my question would be: are you using two evohomes within one home? If those are two different locations then perhaps the second evohome should run in a separate instance of homebridge (so you can add it to a different home). This wouldn't be to complicated.

Let me know please.

tim-payne commented 6 years ago

Its two evohomes within one home

luc-ass commented 6 years ago

Okay. My proposed solution:

luc-ass commented 6 years ago

Ok, I created an up to date branch 'multiple-locations'. I've started to work on the multiple locations thing but it won't start for now. Have a look into it if you have the time.

luc-ass commented 6 years ago

@tim-payne : Next step done. Need your help to test it:

Please let me know how it went. If all goes wrong you can always revert to the latest npm package and revert your config.json.

tim-payne commented 6 years ago

@luc-ass Wow, Thanks! It seems to be working great for both locations. There is one device that the Home App is now saying isn't supported, (device 1 in location 0). I'll try rebooting everything and see if it settles down. Thanks so much for doing this. I'd given up hope on Honeywell ever announcing support.

luc-ass commented 6 years ago

Very happy to help out. Do those devices have the same name? Please check back here in a few days. If everything is working fine I'll add a standard value and merge it with the master branch.

luc-ass commented 6 years ago

Does it work sufficiently? Can I merge back?

tim-payne commented 6 years ago

Hi Luc, it seems to work great. The only problem I have is when a device is called 'Library'. The Comfort app is fine with that but somehow the Home app always says the device is unsupported. I've renamed the room as a workaround. So it works great, thanks!

luc-ass commented 6 years ago

Curious. This probably originates somewhere within the plugin or homebridge itself. "Library" is a commonly named item so it could cause a mixup.

I'll merge it back in the next days. Thank you for testing.

jwmaas commented 6 years ago

I am trying this fork as well. But it fails at installation with the following error; code 128 npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b multiple-locations https://github.com/luc-ass/homebridge-evohome.git /root/.npm/_cacache/tmp/git-clone-99b4571c npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-99b4571c': Permission denied

My .npm is located in the /home/pi directory. What can I change in the installation procedure to not install in /root ?

luc-ass commented 6 years ago

I am running all those plugins as global. I am not aware how to do this differently. I use npm install -g https://github.com/luc-ass/homebridge-evohome.git#multiple-locations

jwmaas commented 6 years ago

I have decide to just change the code in the index file. I replaced "locations[0]" by "locations[this.locationID]" throughout the code, ensuring its get read from the config file. Adding locationID to the config file, I can run it with location 0 or location 1. But I cannot run it with two entries in the config file in two separate Evohome platforms with two different names. It gives me error:

Evohome failed: Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: 2d440eea-9f3a-4bc2-8af7-939b2d5b409e

What other changes did you make in your index file in your multiple location fork? Would you be kind enough to give me a hint?

luc-ass commented 6 years ago

have a look at the index again. Perhaps you missed, that in some instances it needs to be that.locationID

jwmaas commented 6 years ago

I think you did not complete your comment. BTW why did you include appID in the config file? Appreciate your comments.

jwmaas commented 6 years ago

Apologies, overlooked subtle difference between this.locationID and that.locationID. Can you give me the logic where it needs to be that.locationID? I see a few locations where "this" and "that" are both being used.

luc-ass commented 6 years ago

I can. You need to look for that = this. After this line within the function it needs to be that. But if you can be a little patient I will commit an updated version over the weekend ;)

luc-ass commented 6 years ago

Okay. Updated it with locationIndex as an optional characteristic in config. Should be 0, 1, 2, 3, etc... Please install from github and let me know wether it works.

Version should be 0.3.2

Had to redo everything as there were so many features in the mean time.

luc-ass commented 6 years ago

v0.4.0 is out with even more features.

luc-ass commented 6 years ago

Just tested it and it seems to work pretty good.

mylesagray commented 6 years ago

This actually crashes with the second location in my install, with the duplicate UUID error, it’s caused by the “global” triggers for ECO, Away, etc all having the same name and properties across both locations, this could probably be resolved by letting Homebridge assign a UUID, or by having the UUID use the location name as part of the string in addition to the trigger name.

luc-ass commented 6 years ago

Okay. Let's look into that. I don't have two locations, so i can't test this. Perhaps someone else from this thread can help out?

mylesagray commented 6 years ago

I will fork and try to fix it on my install and file a PR.

luc-ass commented 6 years ago

Thanks! Sounds great!

luc-ass commented 5 years ago

Did it work?

luc-ass commented 5 years ago

This issue has been fixed as of version 0.6.0.