vivienne / homebridge-haiku-senseme

Apache License 2.0
5 stars 0 forks source link

Fans Added no light? #7

Open ramisanders opened 3 years ago

ramisanders commented 3 years ago

Thank you for this plugin, i added the fans but still can't control the lights.

vivienne commented 3 years ago

Hi Rami,

Standalone Haiku lights are supported but the light portion for fans with integrated lights is not yet. I'm still working on it, hopefully within the next few weeks I'll find some time to get this working.

ramisanders commented 3 years ago

Oh thank you so much for your response. Because I had it working with another plug-in then it stopped and I found yours. And yours works perfectly but just no lights. Are you accepting donations for your work. I’d love to send you some $$$. What do you think?

Sent from my iPhone

On Oct 26, 2020, at 2:24 PM, Vivian notifications@github.com wrote:

 Hi Rami,

Standalone Haiku lights are supported but the light portion for fans with integrated lights is not yet. I'm still working on it, hopefully within the next few weeks I'll find some time to get this working.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

vivienne commented 3 years ago

Money's great, but I feel bad accepting anything considering I haven't done anything yet! I don't have a ceiling fan to test out my changes on, could you enable your DEBUG flags to include haiku-senseme:* and dump a logfile for me from homebridge?

ramisanders commented 3 years ago

Id love that, but I have no idea how to do that, can you help me and send me instructions...

Rami Smidi Smidi Estate

B:  954-667-7278 m: 954-6 51-3862 e:  mailto:andie@vieleconsulting.comramismidi@me.com w:  http://www.vieleconsulting.com/www.thecpusquad.com

On Oct 26, 2020, at 4:23 PM, Vivian notifications@github.com wrote:

Money's great, but I feel bad accepting anything considering I haven't done anything yet! I don't have a ceiling fan to test out my changes on, could you enable your DEBUG flags to include haiku-senseme:* and dump a logfile for me from homebridge?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vivienne/homebridge-haiku-senseme/issues/7#issuecomment-716801170, or unsubscribe https://github.com/notifications/unsubscribe-auth/APWI3TVEANIVTG5T2KMMJG3SMXLDHANCNFSM4S6PSGKQ.

vivienne commented 3 years ago

If you have homebridge installed with homebridge-config-ui-x, you can add it under your Homebridge Settings menu. Go to the "..." button in the web interface, select "Homebridge Settings", enable "Homebridge Debug Mode" and add haiku-senseme:* in the DEBUG Environment Variables textbox, then restart the Homebridge server.

If you're running home bridge via command line only, call home bridge with: DEBUG=haiku-senseme:* homebridge -D

vivienne commented 3 years ago

Tagging @dsully and @sjschneider - can you give the v3.0.0-beta.0 version of the plugin a try? You can install it through homebridge-config-ui-x by selecting "Install Previous Version" from the plugins tab and choosing the beta build. I think this should work but am flying blind since I have no fan to test it on myself. I'm pushing it as a beta in case it breaks the existing fan functionality.

dsully commented 3 years ago

I'm having a discovery issue, but I believe it's related to my network and nothing to do with your change @vivienne

sjschneider commented 3 years ago

Thanks for making this change @vivienne -- I installed it but received an error, logs shown below:

[10/27/2020, 10:20:51] Homebridge is running on port 51084. [10/27/2020, 10:20:52] [Haiku] Found a device: Office Fan / FAN,HAIKU,HSERIES / 192.168.254.79 / 20:F8:5E:14:B2:F4 [10/27/2020, 10:20:53] [Haiku] Found a device: Adrian's Fan / FAN,LSERIES / 192.168.254.71 / 20:F8:5E:27:99:FD [10/27/2020, 10:20:53] TypeError: Cannot create property 'SERVER' on string 'LIGHT' at State.set (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/State.js:156:23) at Device._handleMessage (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/Device.js:211:22) at MessageSocket. (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/Device.js:91:20) at MessageSocket.emit (events.js:314:20) at addChunk (_stream_readable.js:298:12) at readableAddChunk (_stream_readable.js:273:9) at MessageSocket.Readable.push (_stream_readable.js:214:10) at /usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/message-socket/dist/index.js:170:26 at Array.forEach () at Socket. (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/message-socket/dist/index.js:168:22) [10/27/2020, 10:20:53] TypeError: Cannot create property 'SERVER' on string 'LIGHT' at State.set (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/State.js:156:23) at Device._handleMessage (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/Device.js:211:22) at MessageSocket. (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/Device.js:91:20) at MessageSocket.emit (events.js:314:20) at addChunk (_stream_readable.js:298:12) at readableAddChunk (_stream_readable.js:273:9) at MessageSocket.Readable.push (_stream_readable.js:214:10) at /usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/message-socket/dist/index.js:170:26 at Array.forEach () at Socket. (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/message-socket/dist/index.js:168:22) [10/27/2020, 10:20:54] [myQ] myQ API: Successfully connected to the myQ API. [10/27/2020, 10:20:54] TypeError: Cannot create property 'UVLIGHT' on string 'LIGHT' at State.set (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/State.js:156:23) at Device._handleMessage (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/Device.js:211:22) at MessageSocket. (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/Device.js:91:20) at MessageSocket.emit (events.js:314:20) at addChunk (_stream_readable.js:298:12) at readableAddChunk (_stream_readable.js:273:9) at MessageSocket.Readable.push (_stream_readable.js:214:10) at /usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/message-socket/dist/index.js:170:26 at Array.forEach () at Socket. (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/message-socket/dist/index.js:168:22) [10/27/2020, 10:20:54] TypeError: Cannot create property 'SERVER' on string 'LIGHT' at State.set (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/State.js:156:23) at Device._handleMessage (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/Device.js:211:22) at MessageSocket. (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/Device.js:91:20) at MessageSocket.emit (events.js:314:20) at addChunk (_stream_readable.js:298:12) at readableAddChunk (_stream_readable.js:273:9) at MessageSocket.Readable.push (_stream_readable.js:214:10) at /usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/message-socket/dist/index.js:170:26 at Array.forEach () at Socket. (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/message-socket/dist/index.js:168:22) [10/27/2020, 10:20:54] TypeError: Cannot create property 'SERVER' on string 'LIGHT' at State.set (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/State.js:156:23) at Device._handleMessage (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/Device.js:211:22) at MessageSocket. (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/Device.js:91:20) at MessageSocket.emit (events.js:314:20) at addChunk (_stream_readable.js:298:12) at readableAddChunk (_stream_readable.js:273:9) at MessageSocket.Readable.push (_stream_readable.js:214:10) at /usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/message-socket/dist/index.js:170:26 at Array.forEach () at Socket. (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/message-socket/dist/index.js:168:22) [10/27/2020, 10:20:54] Got SIGTERM, shutting down Homebridge... [10/27/2020, 10:20:59] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null [10/27/2020, 10:21:04] [HB Supervisor] Restarting Homebridge... [10/27/2020, 10:21:04] [HB Supervisor] Starting Homebridge with extra flags: -I [10/27/2020, 10:21:04] [HB Supervisor] Started Homebridge v1.1.6 with PID: 11878

vivienne commented 3 years ago

@sjschneider - could you enable haiku-senseme:* in your debug settings and show me the log file? I have a feeling it is because the light presence string for the fans is different than what the standalone lights put out. I'm looking for the message from the fans that starts with something like (Office Fan;DEVICE;LIGHT;PRESENT ...

sjschneider commented 3 years ago

For the L-Series (with the light):

[10/27/2020, 14:13:35] Homebridge is running on port 51084. 2020-10-27T18:13:36.329Z haiku-senseme:senseme Discovery request for IP: [system chosen] 2020-10-27T18:13:36.474Z haiku-senseme:senseme UDP Incoming: (Adrian's Fan;DEVICE;ID;20:F8:5E:27:99:FD;FAN,LSERIES) 2020-10-27T18:13:36.498Z haiku-senseme:device constructing a device: name: Adrian's Fan, id: 20:F8:5E:27:99:FD, type: FAN,LSERIES, ip: 192.168.254.71 2020-10-27T18:13:36.701Z haiku-senseme:device Sending message: GETALL,SNSROCC;STATUS;GET,NAME;VALUE;GET [10/27/2020, 14:13:36] [Haiku] Found a device: Adrian's Fan / FAN,LSERIES / 192.168.254.71 / 20:F8:5E:27:99:FD 2020-10-27T18:13:36.784Z haiku-senseme:device constructing a device: name: Adrian's Fan, id: 20:F8:5E:27:99:FD, type: FAN,LSERIES, ip: 192.168.254.71 2020-10-27T18:13:36.936Z haiku-senseme:device Sending message: GETALL,SNSROCC;STATUS;GET,NAME;VALUE;GET 2020-10-27T18:13:37.131Z haiku-senseme:device Incoming: (Adrian's Fan;DEVICE;BEEPER;OFF) 2020-10-27T18:13:37.146Z haiku-senseme:device Incoming: (Adrian's Fan;SNSROCC;STATUS;OCCUPIED) 2020-10-27T18:13:37.153Z haiku-senseme:device Incoming: (Adrian's Fan;NAME;VALUE;Adrian's Fan) 2020-10-27T18:13:37.159Z haiku-senseme:device Incoming: (Adrian's Fan;DEVICE;INDICATORS;OFF) 2020-10-27T18:13:37.173Z haiku-senseme:device Incoming: (Adrian's Fan;DEVICE;LIGHT;PRESENT) 2020-10-27T18:13:37.180Z haiku-senseme:device Incoming: (Adrian's Fan;DEVICE;SERVER;PRODUCTION) [10/27/2020, 14:13:37] TypeError: Cannot create property 'SERVER' on string 'LIGHT' at State.set (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/State.js:156:23) at Device._handleMessage (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/Device.js:211:22) at MessageSocket. (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/Device.js:91:20) at MessageSocket.emit (events.js:314:20) at addChunk (_stream_readable.js:298:12) at readableAddChunk (_stream_readable.js:273:9) at MessageSocket.Readable.push (_stream_readable.js:214:10) at /usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/message-socket/dist/index.js:170:26 at Array.forEach () at Socket. (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/message-socket/dist/index.js:168:22) 2020-10-27T18:13:37.412Z haiku-senseme:device Incoming: (Adrian's Fan;SNSROCC;STATUS;OCCUPIED) 2020-10-27T18:13:37.419Z haiku-senseme:device Incoming: (Adrian's Fan;NAME;VALUE;Adrian's Fan) 2020-10-27T18:13:37.459Z haiku-senseme:device Incoming: (Adrian's Fan;FAN;TIMER;MAX;7) 2020-10-27T18:13:37.467Z haiku-senseme:device Incoming: (Adrian's Fan;FAN;TIMER;MIN;1) 2020-10-27T18:13:37.480Z haiku-senseme:device Incoming: (Adrian's Fan;FAN;WHOOSH;STATUS;OFF) 2020-10-27T18:13:37.488Z haiku-senseme:device Incoming: (Adrian's Fan;FW;NAME;FW000005) 2020-10-27T18:13:37.496Z haiku-senseme:device Incoming: (Adrian's Fan;FW;FW000005;2.6.1) 2020-10-27T18:13:37.508Z haiku-senseme:device Incoming: (Adrian's Fan;GROUP;LIST;Adrian Bedroom) 2020-10-27T18:13:37.516Z haiku-senseme:device Incoming: (Adrian's Fan;DEVICE;OPTION;SENSORS;NOT PRESENT) [10/27/2020, 14:13:37] TypeError: Cannot create property 'OPTION' on string 'LIGHT' at /usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/State.js:40:33 at Array.reduce () at getParentAtPath (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/State.js:39:23) at State.set (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/State.js:147:31) at Device._handleMessage (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/Device.js:211:22) at MessageSocket. (/usr/local/lib/node_modules/homebridge-haiku-senseme/node_modules/@nightbird/haiku-senseme/dist/Device.js:91:20) at MessageSocket.emit (events.js:314:20) at addChunk (_stream_readable.js:298:12) at readableAddChunk (_stream_readable.js:273:9) at MessageSocket.Readable.push (_stream_readable.js:214:10)

And the H-Series (no light): 2020-10-27T18:12:50.679Z haiku-senseme:device Incoming: (Office Fan;SNSROCC;STATUS;OCCUPIED) 2020-10-27T18:12:50.692Z haiku-senseme:device Incoming: (Office Fan;NAME;VALUE;Office Fan) 2020-10-27T18:12:50.702Z haiku-senseme:device Incoming: (Office Fan;DEVICE;BEEPER;ON) 2020-10-27T18:12:50.711Z haiku-senseme:device Incoming: (Office Fan;DEVICE;INDICATORS;ON) 2020-10-27T18:12:50.725Z haiku-senseme:device Incoming: (Office Fan;DEVICE;LIGHT;NOT PRESENT) 2020-10-27T18:12:50.733Z haiku-senseme:device Incoming: (Office Fan;DEVICE;SERVER;PRODUCTION)

vivienne commented 3 years ago

Thanks! Indeed it is different from the standalone light. Can you give v3.0.1-beta.0 a try? I rolled back the change I made to the haiku-senseme API to match with the standalone light's presence string.

sjschneider commented 3 years ago

Hi @vivienne -- getting closer! The lights now show up in HomeKit, but they have a "No Response" label due to the error that you'll find in this log file. The error seems to occur after I open the Home app. homebridge.log.txt

vivienne commented 3 years ago

@sjschneider - thanks for the logfile. I'm not sure why that message is showing up, I have two hunches and tried to address both. Can you give 3.1.0-beta.0 a try?

sjschneider commented 3 years ago

@vivienne I gave this a try, but still failing. The error appears when I open the Home app:

[10/28/2020, 20:15:09] 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 HaikuPlatformFanAccessory.getOn (/usr/local/lib/node_modules/homebridge-haiku-senseme/src/fanAccessory.ts:206:5) at Characteristic.emit (events.js:326:22) at Characteristic.EventEmitter.emit (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/EventEmitter.ts:42:22) at Characteristic._this.getValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:489:12) at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1217:22 at Array.forEach () at Bridge.Accessory._this._handleGetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1145:10) at HAPServer.emit (events.js:314:20) at HAPServer.EventEmitter.emit (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/EventEmitter.ts:42:22)

If there is something else I can do to help you debug this, I'd be happy to try it, but would benefit from guidance on setting up an efficient development environment.

vivienne commented 3 years ago

@sjschneider - I think it might be something to do with the portion of the code that only adds the service for the lightbulb if it exists, though it will probably take some more iterations of testing to figure out how to get it to work.

Do you have homebridge running with debug mode on (-D)? Can you set your debug environment vars to this: HAP-NodeJS:Accessory HAP-NodeJS:Service haiku-senseme:* - I can see the debug messages coming from the platform plugin but don't see them in your logfile (I do see the haiku-senseme debug messages however). I'm looking for these kinds of debug messages:

[10/28/2020, 8:37:57 PM] [Haiku by Big Ass Fans] got updated has_light (Office Light): true

In your home app, do you see tiles for both fans and a single tile for the light (Adrian's Fan Light)? Or do you not see a tile for the light at all? Do you have a way to turn off each fan individually (ie. via wall switch) so that it doesn't get detected? I wonder if the plugin works with fan with the integrated light.

As far as a development environment I'm not that savvy either, but the instructions to get started with plugin development here: https://github.com/homebridge/homebridge-plugin-template were useful. This is my first attempt at writing typescript and a plugin too, so I'm just learning as I go..

vivienne commented 3 years ago

@sjschneider If you get a chance can you run with the debug flags enabled, along with homebridge-haiku-senseme:* and dump your log file?

I've also pushed 3.3.0-beta.0 that always will add the light accessory to the fan, can you give that a try?

Since I don't have a fan to test on myself, I tried locally adding a fan to my lights and couldn't reproduce your error. The latest beta won't check if your fan actually has a light on it, but if the error is coming from the code where it's checking if a light exists or not, this will help us get past that.

sjschneider commented 3 years ago

Hi @vivienne, sorry for slow reply. I've installed the latest beta and enabled these debug messages. I am no longer encountering the error and am able to control the lights and fan speeds. I turned various fans on and lights on and off, which you can observe in the log file attached. The fans are showing up as a single tile in the Home app. I can turn off the fans individually with a wall switch if you need me to test anything.

As you indicated, all fans are showing lights, including my Office Fan (H series), which does not have a light. It also shows up as a single tile. Changing the value does not seem to throw an error, but it obviously doesn't do anything.

homebridge-senseme-3.3.0-beta.0.log.txt

Ramias1 commented 3 years ago

Just found and installed this plugin tonight. Found this thread and loaded the latest beta (v3.3.0-beta.0) and lights and fans seem to be working fine. Thanks for doing this. If you need me to test anything please let me know.

vivienne commented 3 years ago

Thanks everyone! Sorry, I'm also sluggish on replies.

@sjschneider based on your latest log file it looks like you aren't clearing the accessories from the cache before trying out the plugin, is that right? I wonder if the error you had last time was because of that..

@Ramias1 thanks for testing and confirming it works for you too!

I plan to push the beta to be an official release, and try again with the original code (that differentiates between fans with/without lights) as a beta. Does that sound good?

Ramias1 commented 3 years ago

I am getting some strangeness controlling fan lights by voice (and the fan itself turns on).

I un-grouped them in the app.

From my perspective I will always view them as two different devices - the fan and the light. If the plug-in treats them that way from the start it could be helpful.

vivienne commented 3 years ago

I am getting some strangeness controlling fan lights by voice (and the fan itself turns on).

I un-grouped them in the app.

From my perspective I will always view them as two different devices - the fan and the light. If the plug-in treats them that way from the start it could be helpful.

Good catch - I thought I had taken care of this but it looks like I missed something. I'll try and push a new beta to try in the next day or two, I think I know what needs to be updated.

vivienne commented 3 years ago

@sjschneider @Ramias1 Okay, I've pushed the previous beta as official release 3.3.0.

I've also published a new beta 3.4.0-beta.0 that separates out the accessory names for fans with integrated lights (the new accessory name for the light will be whatever the fan name is, with "light" appended after it). I also added back the existence check in fans for lights, so a light accessory shouldn't get created if the fan doesn't have a light in it. When you try this, please clear out your accessories cache beforehand - I am hoping that was the problem and not something else. Let me know if it works for you, and thank you for your feedback and patience!

Ramias1 commented 3 years ago

@vivienne I removed the old plugin from homebridge-ui-x. Restarted. Checked Homebridge settings to "Remove Single Cached Accessories" and saw the list of all of my accessories (a lot; in groups in Homebridge UI) and there were now Haiku Big Ass Fans.

Added the new 3.4.0-beta.0. It detected my fans and lights and in Homebridge they show as separate devices. In the Home app in iOS they show as a single fan device (with the ability to control light and fan separately).

vivienne commented 3 years ago

@Ramias great - do you have fans with lights only, do you have any fans that don't have an integrated light that you're using as well?

@sjschneider if you can confirm the new beta works I'll push it as the official release, but I'm still holding off since I'm not sure if you are still getting the errors on startup since you have both types of fans.

Ramias1 commented 3 years ago

@ramias great - do you have fans with lights only, do you have any fans that don't have an integrated light that you're using as well?

All my fans have lights.