rainlake / homebridge-platform-lightify

MIT License
13 stars 5 forks source link

Control Lightify Groups #5

Closed dmckillican closed 7 years ago

dmckillican commented 7 years ago

Hi again Rainlake,

I have a request, if possible - it's a feature request rather than a bug fix I think.

I have been playing around with the API and have found it is possible to control groups (as defined in the Osram IOS/Android app.

The problem I have with the way HomeKit and this plugin is working with my lights is that it will only control one light at a time, rather than the group. I notice that the node-lightify does gather information about groups.

Is it at all possible to create a variant of this plugin that would expose groups to Homebridge rather than lights? This would enable me to better configure HomeKit and control lights in unison, a better overall experience and much less load on HomeKit itself.

Anyway, I appreciate you must have other things to do than indulge my home automation needs! but if it's possible, and you're willing, I would be grateful

Thank you, Drew

rainlake commented 7 years ago

Hi, Drew I prefer create groups in HomeKit, I don't want list both groups and lights in it. I could enable this feature but add a flag in settings file. Thank you as always Rainlake

dmckillican commented 7 years ago

If it is at all possible I would be grateful. I would be happy with only exposing groups, not Lights, as I can define a group with a single light if need be. This also pushes the load from home bridge to the Osram gateway to handle which might have a positive effect?

As I say, because my entire home is now Osram I have some issue with lights coming on one by one.

If it was possible to switch between group or light, rather than both at one, via the settings i think that would be really awesome!

Thank you again!

apexad commented 7 years ago

Create the light groups as scenes in HomeKit. That way you can control the individual lights, but also control them as a group via the scene.

apexad commented 7 years ago

You could also use a fake switch: https://www.npmjs.com/package/homebridge-fakeswitchfs

Then setup automation for when it turns on and off to turn off your light groups.

dmckillican commented 7 years ago

Thanks for the tips, as I mentioned before, using the individual light method is fine for table lamps and the odd light here or there, but not for an entire home where all lighting is lightify, including ceiling recessed GU10s.

Using individual lights with homekit causes problems. The lights turn on/off and dim one at a time. My open plan living room/kitchen has 8 GU10s recessed in the ceiling, and 2 down pendant lights over the kitchen island. Turning these on with home bridge takes about 1.5 seconds per light, 10 lights = 15 seconds with lights coming on at random. It's fine for coming home or leaving, but in an evening, setting a scene etc is a horrid experience.

I've tried every alternative, including Alexa which now words natively with Lightify, but again will only control one light at a time, but with a huge lag (5 to 10 seconds per light).

Also, I'm in Australia where these products are significantly more expensive, meaning that I can't just dump them and start again with Hue (which I should have done in the first place), at almost $3,000 for the lights and gateway, I'm stuck and really quite frustrated with it.

Rainlakes plugin is the only thing that comes close to solving the problem and has proven to be very successful. The use of groups would be the icing on the cake!

apexad commented 7 years ago

The only thing is, this plugin works directly with the lightify hub, rather than the lightify API which the app uses through the internet.

I assume the lightify groups are setup on the lightify server, not saved in the local hub, meaning there is no way this plugin could pull the groups.

apexad commented 7 years ago

https://github.com/kundk-ckret/homebridge-lightify-api communicates with the lightify server (instead of with your local hub like this plugin does), and might be able to get groups added.

Try that plugin and see if works just as good minus the groups and make an issue there.

dmckillican commented 7 years ago

Groups work with the lightify hub as well as through the API - the Groups themselves are made available via node-lightify, which i believe homebridge-platform-lightify uses. I've managed to pull the code apart to find these references and have been able to directly query the hub to access the groups - alas, I lack Rainlakes awesome coding talent and don't know how to bring this into home bridge (and also, I don't want to alter Rainlake's code as the moral rights are not mine).

As I said, it's clearly not a bug - it's a feature request that would be insanely awesome.

I have tried the homebridge-lightify-api - it's quite laggy and will only control one light at a time. I have managed to control groups directly by posting to the API directly and it's reasonably responsive but relies on a constant active internet connection and requires re-authorisation after 15 minutes of inactivity. Again, it's workable, but not even close to as effective as homebridge-platform-lightify if supporting groups.

rainlake commented 7 years ago

I'm working on this issue, sorry for the delay. my son got strep last few days.

dmckillican commented 7 years ago

Of course, I completely understand and am sorry to hear about your son. I hope he gets well soon!

rainlake commented 7 years ago

I have pushed changes to npm, you have to set "showGroups": true to enable this feature. and "hideNodes" to hide your lights if you want.

I've tested with only one group for last 2 days without issue. please open another if you have any issues. I will close this issue for now.

dmckillican commented 7 years ago

Hi rainlake

thank you so much for doing this and sorry for the delay, I was away from home until today.

I presume you mean I should put the above in the config.json file? I have done so as follows:

{ "platform": "Lightify", "bridge_ip": "192.168.0.3", "name": "Lightify", "showGroups": true, "hideNodes": true }

Doing this stops home bridge from launching and I notice that I get a statement saying "[Lightify] Discovered failed timeout"

I have attached the debug code below

perhaps I simply have the wrong config? I removed the showGroups setting which launched homebridge with the hideNodes: true working. It was only showGrops that caused the issue.

Any ideas?

thank you again!

Homes-Mac-mini:~ homeauto$ homebridge -D [3/16/2017, 7:16:10 PM] Loaded plugin: homebridge-camera-ffmpeg [3/16/2017, 7:16:10 PM] Registering platform 'homebridge-camera-ffmpeg.Camera-ffmpeg' [3/16/2017, 7:16:10 PM] --- [3/16/2017, 7:16:10 PM] Loaded plugin: homebridge-efergy [3/16/2017, 7:16:10 PM] Registering accessory 'homebridge-efergy.Efergy' [3/16/2017, 7:16:10 PM] --- [3/16/2017, 7:16:10 PM] Loaded plugin: homebridge-homeassistant [3/16/2017, 7:16:10 PM] Registering platform 'homebridge-homeassistant.HomeAssistant' [3/16/2017, 7:16:10 PM] --- [3/16/2017, 7:16:10 PM] Loaded plugin: homebridge-ip-camera [3/16/2017, 7:16:10 PM] Registering platform 'homebridge-ip-camera.Camera-IP' [3/16/2017, 7:16:10 PM] --- [3/16/2017, 7:16:10 PM] Loaded plugin: homebridge-platform-lightify [3/16/2017, 7:16:10 PM] Registering platform 'homebridge-platform-lightify.Lightify' [3/16/2017, 7:16:10 PM] --- [3/16/2017, 7:16:11 PM] Loaded plugin: homebridge-platform-orvibo [3/16/2017, 7:16:11 PM] Registering platform 'homebridge-platform-orvibo.Orvibo' [3/16/2017, 7:16:11 PM] --- [3/16/2017, 7:16:11 PM] Loaded plugin: homebridge-platform-wemo [3/16/2017, 7:16:11 PM] Registering platform 'homebridge-platform-wemo.BelkinWeMo' [3/16/2017, 7:16:11 PM] --- [3/16/2017, 7:16:11 PM] Loaded plugin: homebridge-server [3/16/2017, 7:16:11 PM] Registering platform 'homebridge-server.Server' [3/16/2017, 7:16:11 PM] --- [3/16/2017, 7:16:11 PM] Loaded config.json with 1 accessories and 4 platforms. [3/16/2017, 7:16:11 PM] --- [3/16/2017, 7:16:11 PM] Loading 4 platforms... [3/16/2017, 7:16:11 PM] Initializing Orvibo platform... [3/16/2017, 7:16:11 PM] [Lightify] Initializing Lightify platform... [3/16/2017, 7:16:11 PM] [WeMo Platform] Initializing BelkinWeMo platform... [3/16/2017, 7:16:11 PM] Initializing Camera-IP platform... [3/16/2017, 7:16:11 PM] Loading 1 accessories... [3/16/2017, 7:16:11 PM] [Efergy] Initializing Efergy accessory... Load homebridge-camera-ffmpeg.Camera-ffmpeg [3/16/2017, 7:16:11 PM] GardenCam is running on port 56393. [3/16/2017, 7:16:11 PM] [Lightify] Connected to Lightify Bridge [3/16/2017, 7:16:11 PM] [Lightify] command sent [1][070000130100000001] [3/16/2017, 7:16:11 PM] [Lightify] socket data: [6f08011301000000002b004310af9d010000261884020102040702080000648e0a010000ff426564203100000000000000000000000000000000000000ad68108b010000261884020102040702200001648e0a010000ff4775657374203300000000000000000000000000000000000b2e8289010000261884020102040702200001648e0a010000ff47756573742032000000000000000000000000000000000064a4c2b2010000261884020102040702200001648e0a010000ff477565737420310000000000000000000000000000000000e7426b9e010000261884020102040002000001648e0a010000ff4775657374204c20320000000000000000000000000000000ca4438b010000261884020102040002400000648e0a990000ff4f666669636520446f6f7200000000000000000000000000dea6638e010000261884020102040702080000648e0a010000ff426564203200000000000000000000000000000000000000a1acc3d7d90000261884020102049202800000328e0a010000ff4c61756e647279204c616d70000000000000000000000000d07e449b010000261884020102040702010201648e0a010000ff4c6f756e676520536f6661203100000000000000000000001aa3068f010000261884020102040002010201648e0a010000ff4c6f756e67652043656e7472652031000000000000000000a240419d010000261884020102040002010201648e0a010000ff4c6f756e6765204d616e74656c20320000000000000000001ad1b289010000261884020102040702010201648e0a010000ff4c6f756e6765204d616e74656c20310000000000000000003a11168e010000261884020102040002400000648e0a010000ff4f6666696365204465736b20520000000000000000000000bffcf9b2010000261884020102040002000000648e0a010000ff43696e656d61203200000000000000000000000000000000a849ba76cb00002618840a010204010220000014ac0affffffff4775657374204c616d70000000000000000000000000000074fec69c010000261884020102040002020000648e0a010000ff42616c636f6e792042656400000000000000000000000000ea58de57000000261884020102040002020000648e0a010000ff42616c636f6e79205461626c6500000000000000000000008ae02eb6010000261884020102040002020000648e0a010000ff42616c636f6e792042425100000000000000000000000000536b6fd4ca00002618840a0102040102100000648e0affffffff456e7472616e636500000000000000000000000000000000df706689010000261884020102040002100000648e0a010000ff48616c6c2042656420446f6f720000000000000000000000d6a25a8e010000261884020102040002100000648e0a010000ff48616c6c20446f6f7200000000000000000000000000000094015889010000261884020102040002080000648e0a010000ff42656420446f6f720000000000000000000000000000000023cae4af010000261884020102040002400000648e0a990000ff4f6666696365205069616e6f0000000000000000000000004845cbb1010000261884020102040702080000648e0a010000ff42656420436c6f7365740000000000000100000000000000ffffee9c010000261884000102040700000101648e0a010000ff47617264656e2050616c6d2031000000030000000000000065083e9b010000261884020102040702080000648e0a010000ff426564204d6972726f7200000000000000000000000000008264ff8e010000261884020102040702010201648e0a010000ff4c6f756e676520536f66612032000000000000000000000054f8128a010000261884020102040702010201648e0a010000ff4c6f756e67652043656e747261] [3/16/2017, 7:16:11 PM] [Lightify] Expected len [2161] [3/16/2017, 7:16:11 PM] [Lightify] len = [1400] [3/16/2017, 7:16:11 PM] [WeMo Platform] Online: Front Garden Irrigation [94103E32C180] [3/16/2017, 7:16:11 PM] [Lightify] socket data: [6c00000000000000000000b754b07cc90000261884020102049202040200648e0a010000ff4b69746368656e2042656e63682031000000000000000000c7dcd0130100002618840a0102040102080000648e0affffffff426564204c616d70000000000000000000000000000000007f52938a010000261884020102040002040200648e0a010000ff4b69746368656e2052000000000000000000000000000000754ba48e010000261884020102040002400000648e0a010000ff4f6666696365204465736b204c0000000000000000000000ca57478b010000261884020102040000000000648e0a010000ff43696e656d612031000000000000000000000000000000000d04add3d90000261884020102040702040200648e0a010000ff4b69746368656e2042656e636820320000000000000000002b86008f010000261884020102040002040200648e0a010000ff4b69746368656e204c0000000000000000000000000000009616b890010000261884020102040002000001648e0a010000ff4775657374204c20310000000000000000000000000000002782668b010000261884020102040002000000648e0a010000ff43696e656d61203300000000000000000000000000000000d136c79c010000261884020102040002000000648e0a010000ff43696e656d612034000000000000000000000000000000001e0416b4010000261884020102040702000101648e0a010000ff4465636b204c6f756e67650000000000010000000000000008075d9e010000261884020102040702000101648e0a010000ff47617264656e2050616c6d00000000000000000000000000ffff068b010000261884000102040700000101648e0a010000ff4465636b20446f6f720000000000000003000000000000006a35449d0100002618840201020400020000001c8e0a010000ff46726f6e7420446f6f720000000000000000000000000000b6fc0791010000261884020102040702000000648e0a010000ff47617264656e2043617220506f7274000000000000000000] [3/16/2017, 7:16:11 PM] [Lightify] Expected len [2161] [3/16/2017, 7:16:11 PM] [Lightify] len = [2161] [3/16/2017, 7:16:11 PM] [Lightify] got response for seq [1][6f08011301000000002b004310af9d010000261884020102040702080000648e0a010000ff426564203100000000000000000000000000000000000000ad68108b010000261884020102040702200001648e0a010000ff4775657374203300000000000000000000000000000000000b2e8289010000261884020102040702200001648e0a010000ff47756573742032000000000000000000000000000000000064a4c2b2010000261884020102040702200001648e0a010000ff477565737420310000000000000000000000000000000000e7426b9e010000261884020102040002000001648e0a010000ff4775657374204c20320000000000000000000000000000000ca4438b010000261884020102040002400000648e0a990000ff4f666669636520446f6f7200000000000000000000000000dea6638e010000261884020102040702080000648e0a010000ff426564203200000000000000000000000000000000000000a1acc3d7d90000261884020102049202800000328e0a010000ff4c61756e647279204c616d70000000000000000000000000d07e449b010000261884020102040702010201648e0a010000ff4c6f756e676520536f6661203100000000000000000000001aa3068f010000261884020102040002010201648e0a010000ff4c6f756e67652043656e7472652031000000000000000000a240419d010000261884020102040002010201648e0a010000ff4c6f756e6765204d616e74656c20320000000000000000001ad1b289010000261884020102040702010201648e0a010000ff4c6f756e6765204d616e74656c20310000000000000000003a11168e010000261884020102040002400000648e0a010000ff4f6666696365204465736b20520000000000000000000000bffcf9b2010000261884020102040002000000648e0a010000ff43696e656d61203200000000000000000000000000000000a849ba76cb00002618840a010204010220000014ac0affffffff4775657374204c616d70000000000000000000000000000074fec69c010000261884020102040002020000648e0a010000ff42616c636f6e792042656400000000000000000000000000ea58de57000000261884020102040002020000648e0a010000ff42616c636f6e79205461626c6500000000000000000000008ae02eb6010000261884020102040002020000648e0a010000ff42616c636f6e792042425100000000000000000000000000536b6fd4ca00002618840a0102040102100000648e0affffffff456e7472616e636500000000000000000000000000000000df706689010000261884020102040002100000648e0a010000ff48616c6c2042656420446f6f720000000000000000000000d6a25a8e010000261884020102040002100000648e0a010000ff48616c6c20446f6f7200000000000000000000000000000094015889010000261884020102040002080000648e0a010000ff42656420446f6f720000000000000000000000000000000023cae4af010000261884020102040002400000648e0a990000ff4f6666696365205069616e6f0000000000000000000000004845cbb1010000261884020102040702080000648e0a010000ff42656420436c6f7365740000000000000100000000000000ffffee9c010000261884000102040700000101648e0a010000ff47617264656e2050616c6d2031000000030000000000000065083e9b010000261884020102040702080000648e0a010000ff426564204d6972726f7200000000000000000000000000008264ff8e010000261884020102040702010201648e0a010000ff4c6f756e676520536f66612032000000000000000000000054f8128a010000261884020102040702010201648e0a010000ff4c6f756e67652043656e7472616c00000000000000000000b754b07cc90000261884020102049202040200648e0a010000ff4b69746368656e2042656e63682031000000000000000000c7dcd0130100002618840a0102040102080000648e0affffffff426564204c616d70000000000000000000000000000000007f52938a010000261884020102040002040200648e0a010000ff4b69746368656e2052000000000000000000000000000000754ba48e010000261884020102040002400000648e0a010000ff4f6666696365204465736b204c0000000000000000000000ca57478b010000261884020102040000000000648e0a010000ff43696e656d612031000000000000000000000000000000000d04add3d90000261884020102040702040200648e0a010000ff4b69746368656e2042656e636820320000000000000000002b86008f010000261884020102040002040200648e0a010000ff4b69746368656e204c0000000000000000000000000000009616b890010000261884020102040002000001648e0a010000ff4775657374204c20310000000000000000000000000000002782668b010000261884020102040002000000648e0a010000ff43696e656d61203300000000000000000000000000000000d136c79c010000261884020102040002000000648e0a010000ff43696e656d612034000000000000000000000000000000001e0416b4010000261884020102040702000101648e0a010000ff4465636b204c6f756e67650000000000010000000000000008075d9e010000261884020102040702000101648e0a010000ff47617264656e2050616c6d00000000000000000000000000ffff068b010000261884000102040700000101648e0a010000ff4465636b20446f6f720000000000000003000000000000006a35449d0100002618840201020400020000001c8e0a010000ff46726f6e7420446f6f720000000000000000000000000000b6fc0791010000261884020102040702000000648e0a010000ff47617264656e2043617220506f7274000000000000000000] [3/16/2017, 7:16:11 PM] [Lightify] found request [3/16/2017, 7:16:11 PM] [Lightify] command sent [2][0700021e0200000000] [3/16/2017, 7:16:11 PM] [WeMo Platform] Online: Lawn Irrigation [94103E32EDDC] [3/16/2017, 7:16:11 PM] [Lightify] socket data: [bd00031e02000000000a0001004c6f756e676500000000000000000000020042616c636f6e7900000000000000000003004b69746368656e0000000000000000000400426564726f6f6d000000000000000000050048616c6c0000000000000000000000000600477565737420526f6f6d00000000000007004f66666963650000000000000000000008004c61756e647279000000000000000000090047617264656e000000000000000000000a004c6976696e6720526f6f6d0000000000] [3/16/2017, 7:16:11 PM] [Lightify] Expected len [191] [3/16/2017, 7:16:11 PM] [Lightify] len = [191] [3/16/2017, 7:16:11 PM] [Lightify] got response for seq [2][bd00031e02000000000a0001004c6f756e676500000000000000000000020042616c636f6e7900000000000000000003004b69746368656e0000000000000000000400426564726f6f6d000000000000000000050048616c6c0000000000000000000000000600477565737420526f6f6d00000000000007004f66666963650000000000000000000008004c61756e647279000000000000000000090047617264656e000000000000000000000a004c6976696e6720526f6f6d0000000000] [3/16/2017, 7:16:11 PM] [Lightify] found request [3/16/2017, 7:16:11 PM] [Lightify] command sent [3][08000226030000000100] [3/16/2017, 7:16:11 PM] [Lightify] command sent [4][08000226040000000200] [3/16/2017, 7:16:11 PM] [Lightify] command sent [5][08000226050000000300] [3/16/2017, 7:16:11 PM] [Lightify] command sent [6][08000226060000000400] [3/16/2017, 7:16:11 PM] [Lightify] command sent [7][08000226070000000500] [3/16/2017, 7:16:11 PM] [Lightify] command sent [8][08000226080000000600] [3/16/2017, 7:16:11 PM] [Lightify] command sent [9][08000226090000000700] [3/16/2017, 7:16:11 PM] [Lightify] command sent [10][080002260a0000000800] [3/16/2017, 7:16:11 PM] [Lightify] command sent [11][080002260b0000000900] [3/16/2017, 7:16:11 PM] [Lightify] command sent [12][080002260c0000000a00] [3/16/2017, 7:16:11 PM] [Lightify] socket data: [4a000326030000000001004c6f756e67650000000000000000000006449b010000261884068f010000261884419d010000261884b289010000261884ff8e010000261884128a010000261884] [3/16/2017, 7:16:11 PM] [Lightify] Expected len [76] [3/16/2017, 7:16:11 PM] [Lightify] len = [76] [3/16/2017, 7:16:11 PM] [Lightify] got response for seq [3][4a000326030000000001004c6f756e67650000000000000000000006449b010000261884068f010000261884419d010000261884b289010000261884ff8e010000261884128a010000261884] [3/16/2017, 7:16:11 PM] [Lightify] found request [3/16/2017, 7:16:12 PM] [Lightify] send command timeout [4][08000226040000000200] [3/16/2017, 7:16:12 PM] [Lightify] send command timeout [5][08000226050000000300] [3/16/2017, 7:16:12 PM] [Lightify] send command timeout [6][08000226060000000400] [3/16/2017, 7:16:12 PM] [Lightify] send command timeout [7][08000226070000000500] [3/16/2017, 7:16:12 PM] [Lightify] Discovered failed timeout [3/16/2017, 7:16:12 PM] [Lightify] send command timeout [8][08000226080000000600] [3/16/2017, 7:16:12 PM] [Lightify] send command timeout [9][08000226090000000700] [3/16/2017, 7:16:12 PM] [Lightify] send command timeout [10][080002260a0000000800] [3/16/2017, 7:16:12 PM] [Lightify] send command timeout [11][080002260b0000000900] [3/16/2017, 7:16:12 PM] [Lightify] send command timeout [12][080002260c0000000a00] [3/16/2017, 7:16:16 PM] New Orvibo found: Socket [accf2348f2f6] [3/16/2017, 7:16:16 PM] New Orvibo found: Socket [accf2348ef44] [3/16/2017, 7:16:17 PM] Subscription to accf2348ef44 successful! [3/16/2017, 7:16:17 PM] Subscription to accf2348f2f6 successful! [3/16/2017, 7:16:18 PM] A device has been queried. Name (if set): Garden [3/16/2017, 7:16:18 PM] Orvibo Online: Garden [accf2348ef44] [3/16/2017, 7:16:18 PM] Configuring: Garden [3/16/2017, 7:16:18 PM] A device has been queried. Name (if set): Pond Pump [3/16/2017, 7:16:18 PM] Orvibo Online: Pond Pump [accf2348f2f6] [3/16/2017, 7:16:18 PM] Configuring: Pond Pump