sean9keenan / homebridge-bigAssFans

A Homebridge plugin for Big Ass Fans
MIT License
28 stars 15 forks source link

Fan lights not detected #15

Open shashchatter opened 7 years ago

shashchatter commented 7 years ago

I have two Haiku fans, both with fan lights, and lights are detected and controllable by either the iPhone app or the wall controller. I have recently updated the homebridge plugins with npm (npm upgrade; npm update -g), and feel dumb to not have recorded the prior versions of node.js, or homebridge, or the plugins! Prior to the update, homebridge used to detect.control lights on the fans just fine. Now, the lights are not detected, please see the tail end of the log at http://pastebin.com/4BrKDq4k.

Fan FW: v2.2.41 Wall Controller: v2.2.43 Node.js version 7.7.2 homebridge version: 0.4.16 /usr/lib \u251c\u2500\u2500 homebridge@0.4.16 \u251c\u2500\u2500 homebridge-bigAssFans@1.1.2 \u251c\u2500\u2500 homebridge-denon@0.2.1 \u251c\u2500\u2500 homebridge-directv@0.0.7 \u251c\u2500\u2500 homebridge-nest@1.1.2 \u2514\u2500\u2500 npm@4.1.2

Node running on Ubuntu: Distributor ID: Ubuntu Description: Ubuntu 16.04.2 LTS Release: 16.04 Codename: xenial Linux chattersrv 4.4.0-64-generic #85-Ubuntu SMP Mon Feb 20 11:50:30 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

pponce commented 7 years ago

For now you can try installing my fork where i reverted recent changes (adding occupancy sensors and light checks) that broke things for me. pponce/homebridge-bigAssFans

shashchatter commented 7 years ago

Sounds good, thanks a bunch for the reply. I am occupied this week, but hopefully next week I'll learn how to install from a branch, instead of using npm, and report back.

Shash

On Mar 14, 2017, at 10:17 AM, pponce notifications@github.com wrote:

For now you can try installing my fork where i reverted recent changes (adding occupancy sensors and light checks) that broke things for me. pponce/homebridge-bigAssFans

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

pponce commented 7 years ago

Here you go: npm install -g pponce/homebridge-bigAssFans

shashchatter commented 7 years ago

Thanks a bunch! That worked like a charm, lights are now detected and controllable via the Home App.

Thanks again!

Shash

-----Original Message----- From: pponce notifications@github.com To: sean9keenan/homebridge-bigAssFans homebridge-bigAssFans@noreply.github.com Cc: shashchatter ShashChatterjee@netscape.net; Author author@noreply.github.com Sent: Tue, Mar 14, 2017 6:29 pm Subject: Re: [sean9keenan/homebridge-bigAssFans] Fan lights not detected (#15)

Here you go: npm install -g pponce/homebridge-bigAssFans — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

sean9keenan commented 7 years ago

Hey @pponce - what's the error that you're getting? and what type of model fan do you have?

If people are seeing issues I do want to fix it 😅

sean9keenan commented 7 years ago

Specifically - do you know if it's an issue in the homebridge-bigAssFans repo or the bigassfanAPI? Or what exact revert allowed you to fix it. From the logs it's not exactly clear to me what might have caused the issue, and I saw that you reverted both of those repos in trying to fix this issue @pponce

pponce commented 7 years ago

I'm not really sure. I reverted back to before the recent changes that were pushed 16 days ago. The only recent change I kept was the "hack" to fix the home-bridge crashing issue with the call back being called twice.

The light issue happened after this commit reference in this comment: https://github.com/sean9keenan/homebridge-bigAssFans/issues/7#issuecomment-282898038

Also the occupancy detection does not seem to work. Always seems to show occupancy detected for me regardless of actual occupancy. But that looks to be a known open issue https://github.com/sean9keenan/homebridge-bigAssFans/issues/3

I'll test things by pointing to your current bigassfanAPI and see if I only really needed to revert homebridge-bigassfans.

pponce commented 7 years ago

Ok I re-installed my fork but made it depend on your bigassfansAPI master branch. Lights work. So it seems to be related to recent changes to homebridge-bigAssFans. I think it's related to this variable not getting set properly. this.myBigAss.light.exists Shot in the dark guess. That variable is not present in the reverted changes to homebridge-bigAssFans and it seems to kick start the logic for lights in the current master. Link to update i think caused the issue: https://github.com/sean9keenan/homebridge-bigAssFans/commit/1f28ab7bfae906f1759d87009da61acc9f084c8e

Also i was not getting an error per say. I was getting an incorrect "no light" message for each fan. So the detection of the existing light for both my fans was not working properly. Same problem was confirmed to be happening to @davidvanvo

Oh and I have two haiku senseme fans. They were early models. When they just came out. The official app calls them "Haiku with SenseMe". Not sure how i can get the exact model number for you.

pponce commented 7 years ago

My current guess is that this line in bigassfansAPI is not setting the property value correctly. I'm not sure how to fix though.

this.light.createGetField('exists', ['DEVICE', 'LIGHT'], false, undefined, "PRESENT"); // Unknown false string.. WAY too lazy to unplug from fan

pponce commented 7 years ago

I reset my fork to match your current master. I made it so that this.myBigAss.light.exists variable does not get checked, so that the light found code always gets executed for me (since i have lights on all my fans). I also added a log message for troubleshooting and seeing what the value is of this.myBigAss.light.exist. For me it appears as undefined which is why the light code gets skipped. I'm not sure why this is not getting set properly in the bigAssFansApi code. I'll create an issue to track that in the bigAssFansAPI repo.

[3/19/2017, 10:56:15 AM] [Big Ass Fan] this.myBigAss.light.exists= undefined, Found a light for: Haiku Fan Light [3/19/2017, 10:56:15 AM] [Big Ass Fan] this.myBigAss.light.exists= undefined, Found a light for: KidsHaiku Fan Light

djfatal commented 7 years ago

I'm experiencing a weird issue with the light. I can turn on/off the light within the home app. However if I use the wall control to turn on the light or fan, the home app does not recognize the light or fan as being on.

edit: using pponce's branch the light and fan does show on/off if I use the wall control however it only seems to report correctly if the home app is forced closed and open. It does not update the on/off status in real time for some reason.

sean9keenan commented 7 years ago

@pponce - first off, I'm sorry that I've been so MIA on this repo, the info and debugging you did is really great and useful.

Regarding the line below:

this.light.createGetField('exists', ['DEVICE', 'LIGHT'], false, undefined, "PRESENT"); 

I'm betting you're right, that this is the issue. If you're interested I can help you understand / get the info needed to help get this working + change it yourself if you're so inclined.

In particular what I'm going to suggest is changing the line in the BigAssAPI to turn logging on. Once you do this if you run any of the examples you'll see a barrage of all of the messages that are coming off of the fan I ran this:

var bigAssApi = require("../BigAssApi");

var myMaster = new bigAssApi.FanMaster(1); // Expect only one fan in my setup

myMaster.onFanFullyUpdated = function(myBigAss){
    console.log("Found a new fan with name '" + myBigAss.name + "'")
    console.log("and identifier: '" + myBigAss.id + "'\n")
    console.log("and lightExists: '" + myBigAss.light.exists + "'\n")
}

Afterwards I see the output: and lightExists: 'true' but I also see an earlier statement:

server got: (Sean's Room;DEVICE;LIGHT;PRESENT) from 192.168.7.59:31415

That's the raw message from the fan itself - it's likely that you see a different message somewhere in there that has LIGHT and some identifier that the light exists. Either way this line is what the createGetField is monitoring - the second argument matches the N parameters at the beginning after the fan name, while the last parameter is what it should be if that field is true, (and the parameter after that is where false should be).

Given this I see two solutions for the library as a whole:

Again sorry for me being MIA and leaving this broken all the while :/

@djfatal - I believe this is because the fan no longer broadcasts it's updates as a multicast UDP packet, and instead only sends this to the person requesting the update. This is an unfortunate change because this means that we'll have to constantly be polling the fan for updates. This isn't a terribly involved change, but it's definitely non-trivial, and probably should be implemented as a feature / option inside of BigAssFansAPI instead of inside of the homebridge plugin. I probably don't have the bandwidth to do this anytime soon, but I'd be more than welcome to accept any PR's. For anyone interested just let me know if you start so I don't accidentally start it before you get it back to me 👍

pponce commented 7 years ago

@sean9keenan No problem on any delay here. I was able to just bypass the check in the mean time to get things to work.

So the plot thickens: have a look at my fork. i made the changes to turn on logging and added your comments suggested console.log messages. Links to the changes: https://github.com/pponce/homebridge-bigAssFans/blob/master/index.js#L2 https://github.com/pponce/homebridge-bigAssFans/blob/master/index.js#L33-L35 https://github.com/pponce/homebridge-bigAssFans/blob/master/index.js#L254 https://github.com/pponce/BigAssFansAPI/blob/master/BigAssApi.js#L408

Here is the output. for some reasons "and lightExists: 'true'" when i turn on logging and i made the small changes.
see output in comment https://github.com/sean9keenan/homebridge-bigAssFans/issues/15#issuecomment-290958895

sean9keenan commented 7 years ago

Awesome, thanks!

Hmm, I see that lightExists: 'true' gets printed, but I don't see

this.log("Found a light for: " + this.homekitLightName);

get printed from this line. You said that the light is working properly though? O.o

I'm a bit confused as to why this would be the case :|

pponce commented 7 years ago

@sean9keenan my bad. i accidently deleted this key line that kickstarts most of the logic in the code. :) platform.addAccessory(myBigAss); The lights did not work when i ran pponce/homebridge-bigAssFans earlier. I was just surprised by the "and lightExists: 'true'" log message and assumed that it meant that the lights were also found. Bad assumption. Here is the output now with the fixed code and one more console message that i added. https://github.com/pponce/homebridge-bigAssFans/blob/master/index.js#L254 You can now see the "no light exists for" message and my lights do not work. It's strange that this.myBigAss.light.exists = undefined but is set when running the console.log command outside of the platform.addAccessory logic.

[4/1/2017, 6:39:50 PM] [Big Ass Fan] Initializing BigAssFans platform... [4/1/2017, 6:39:50 PM] [Big Ass Fan] Big Ass Fans Platform Init [4/1/2017, 6:39:50 PM] Loading 10 accessories... [4/1/2017, 6:39:50 PM] [Big Ass Fan] KidsHaiku Configure Accessory 6a738ad4-804e-4447-869c-b15af4702353 [4/1/2017, 6:39:50 PM] [Big Ass Fan] Haiku Configure Accessory 86df6446-5c5e-497b-acf5-ef681688c068 [4/1/2017, 6:39:50 PM] [Big Ass Fan] DidFinishLaunching (node:3161) DeprecationWarning: sys is deprecated. Use util instead. Sending: <ALL;DEVICE;ID;GET> [4/1/2017, 6:39:50 PM] FrontDoorIPCam is running on port 44883. server got: <ALL;DEVICE;ID;GET> from 192.168.1.99:31415 server got: (KidsHaiku;DEVICE;ID;20:F8:5E:AA:33:A7;FAN,HAIKU,SENSEME) from 192.168.1.202:31415 Sending: <20:F8:5E:AA:33:A7;FAN;PWR;GET> Sending: <20:F8:5E:AA:33:A7;FAN;SPD;GET;ACTUAL> Sending: <20:F8:5E:AA:33:A7;FAN;SPD;GET;MIN> Sending: <20:F8:5E:AA:33:A7;FAN;SPD;GET;MAX> Sending: <20:F8:5E:AA:33:A7;FAN;AUTO;GET> Sending: <20:F8:5E:AA:33:A7;FAN;WHOOSH;GET;STATUS> Sending: <20:F8:5E:AA:33:A7;FAN;DIR;GET> Sending: <20:F8:5E:AA:33:A7;LIGHT;LEVEL;GET;ACTUAL> Sending: <20:F8:5E:AA:33:A7;LIGHT;LEVEL;GET;MIN> Sending: <20:F8:5E:AA:33:A7;LIGHT;LEVEL;GET;MAX> Sending: <20:F8:5E:AA:33:A7;LIGHT;AUTO;GET> Sending: <20:F8:5E:AA:33:A7;DEVICE;LIGHT;GET> Sending: <20:F8:5E:AA:33:A7;SNSROCC;STATUS;GET> Sending: <20:F8:5E:AA:33:A7;SNSROCC;TIMEOUT;GET;MIN> Sending: <20:F8:5E:AA:33:A7;SNSROCC;TIMEOUT;GET;MAX> Sending: <20:F8:5E:AA:33:A7;SNSROCC;TIMEOUT;GET;CURR> Sending: <20:F8:5E:AA:33:A7;SMARTMODE;ACTUAL;GET> Sending: <20:F8:5E:AA:33:A7;SMARTMODE;STATE;GET> Sending: <20:F8:5E:AA:33:A7;LEARN;STATE;GET> Sending: <20:F8:5E:AA:33:A7;LEARN;MINSPEED;GET> Sending: <20:F8:5E:AA:33:A7;LEARN;MAXSPEED;GET> Sending: <20:F8:5E:AA:33:A7;LEARN;ZEROTEMP;GET> Sending: <20:F8:5E:AA:33:A7;SLEEP;STATE;GET> Sending: <20:F8:5E:AA:33:A7;SMARTSLEEP;IDEALTEMP;GET> Sending: <20:F8:5E:AA:33:A7;SMARTSLEEP;MINSPEED;GET> Sending: <20:F8:5E:AA:33:A7;SMARTSLEEP;MAXSPEED;GET> Sending: <20:F8:5E:AA:33:A7;DEVICE;BEEPER;GET> Sending: <20:F8:5E:AA:33:A7;DEVICE;INDICATORS;GET> Sending: <20:F8:5E:AA:33:A7;WINTERMODE;STATE;GET> Sending: <20:F8:5E:AA:33:A7;WINTERMODE;HEIGHT;GET> Sending: <20:F8:5E:AA:33:A7;NW;TOKEN;GET> Sending: <20:F8:5E:AA:33:A7;NW;DHCP;GET> Sending: <20:F8:5E:AA:33:A7;FW;FW000003;GET> Sending: <20:F8:5E:AA:33:A7;NW;SSID;GET> Sending: <20:F8:5E:AA:33:A7;NW;AP;GET;STATUS> server got: (Kids Room Wall Controller;DEVICE;ID;20:F8:5E:D9:F6:71;SWITCH,SENSEME) from 192.168.1.126:31415 Skipping wall control - TODO : Add support for wall control server got: (KidsHaiku;FAN;PWR;OFF) from 192.168.1.202:31415 [4/1/2017, 6:39:50 PM] [Philips Hue 1] Philips hue: BSB002 bridge, api v1.17.0 [4/1/2017, 6:39:50 PM] [Philips Hue 2] Philips hue: BSB002 bridge, api v1.15.0 server got: (KidsHaiku;FAN;SPD;ACTUAL;0) from 192.168.1.202:31415 server got: (KidsHaiku;FAN;SPD;MIN;1) from 192.168.1.202:31415 server got: (KidsHaiku;FAN;SPD;MAX;7) from 192.168.1.202:31415 server got: (KidsHaiku;FAN;AUTO;OFF) from 192.168.1.202:31415 server got: (KidsHaiku;FAN;WHOOSH;STATUS;OFF) from 192.168.1.202:31415 server got: (KidsHaiku;FAN;DIR;FWD) from 192.168.1.202:31415 server got: (KidsHaiku;LIGHT;LEVEL;ACTUAL;0) from 192.168.1.202:31415 server got: (KidsHaiku;LIGHT;LEVEL;MIN;1) from 192.168.1.202:31415 server got: (KidsHaiku;LIGHT;LEVEL;MAX;16) from 192.168.1.202:31415 server got: (KidsHaiku;LIGHT;AUTO;OFF) from 192.168.1.202:31415 server got: (KidsHaiku;DEVICE;LIGHT;PRESENT) from 192.168.1.202:31415 server got: (KidsHaiku;SNSROCC;STATUS;OCCUPIED) from 192.168.1.202:31415 server got: (KidsHaiku;SNSROCC;TIMEOUT;MIN;60000) from 192.168.1.202:31415 server got: (KidsHaiku;SNSROCC;TIMEOUT;MAX;86400000) from 192.168.1.202:31415 server got: (KidsHaiku;SNSROCC;TIMEOUT;CURR;1800000) from 192.168.1.202:31415 server got: (KidsHaiku;SMARTMODE;ACTUAL;OFF) from 192.168.1.202:31415 server got: (KidsHaiku;SMARTMODE;STATE;OFF) from 192.168.1.202:31415 server got: (KidsHaiku;LEARN;STATE;OFF) from 192.168.1.202:31415 server got: (KidsHaiku;LEARN;MINSPEED;0) from 192.168.1.202:31415 server got: (KidsHaiku;LEARN;MAXSPEED;7) from 192.168.1.202:31415 server got: (KidsHaiku;LEARN;ZEROTEMP;2222) from 192.168.1.202:31415 server got: (KidsHaiku;SLEEP;STATE;OFF) from 192.168.1.202:31415 server got: (KidsHaiku;SMARTSLEEP;IDEALTEMP;2111) from 192.168.1.202:31415 server got: (KidsHaiku;SMARTSLEEP;MINSPEED;0) from 192.168.1.202:31415 Failed - retrying : 1 Sending: <20:F8:5E:AA:33:A7;SMARTSLEEP;MAXSPEED;GET> Failed - retrying : 1 Sending: <20:F8:5E:AA:33:A7;DEVICE;BEEPER;GET> Failed - retrying : 1 Sending: <20:F8:5E:AA:33:A7;DEVICE;INDICATORS;GET> Failed - retrying : 1 Sending: <20:F8:5E:AA:33:A7;WINTERMODE;STATE;GET> Failed - retrying : 1 Sending: <20:F8:5E:AA:33:A7;WINTERMODE;HEIGHT;GET> Failed - retrying : 1 Sending: <20:F8:5E:AA:33:A7;NW;TOKEN;GET> Failed - retrying : 1 Sending: <20:F8:5E:AA:33:A7;NW;DHCP;GET> Failed - retrying : 1 Sending: <20:F8:5E:AA:33:A7;FW;FW000003;GET> Failed - retrying : 1 Sending: <20:F8:5E:AA:33:A7;NW;SSID;GET> Failed - retrying : 1 Sending: <20:F8:5E:AA:33:A7;NW;AP;GET;STATUS> server got: (KidsHaiku;SMARTSLEEP;MAXSPEED;6) from 192.168.1.202:31415 server got: (KidsHaiku;DEVICE;BEEPER;OFF) from 192.168.1.202:31415 server got: (KidsHaiku;DEVICE;INDICATORS;ON) from 192.168.1.202:31415 server got: (KidsHaiku;WINTERMODE;STATE;OFF) from 192.168.1.202:31415 server got: (KidsHaiku;WINTERMODE;HEIGHT;244) from 192.168.1.202:31415 server got: (KidsHaiku;NW;TOKEN;c24ec29f-4be4-4a36-887f-1b87c62f1e67) from 192.168.1.202:31415 server got: (KidsHaiku;NW;DHCP;OFF) from 192.168.1.202:31415 server got: (KidsHaiku;FW;FW000003;2.2.40) from 192.168.1.202:31415 server got: (KidsHaiku;NW;SSID;Sancho24) from 192.168.1.202:31415 server got: (KidsHaiku;NW;AP;STATUS;OFF) from 192.168.1.202:31415 var this.myBigAss.light.exists = undefined [4/1/2017, 6:39:51 PM] [Big Ass Fan] No light exists for: KidsHaiku Fan Light Found a new fan with name 'KidsHaiku' and identifier: '20:F8:5E:AA:33:A7'

and lightExists: 'true'

server got: (KidsHaiku;SMARTSLEEP;MAXSPEED;6) from 192.168.1.202:31415 server got: (KidsHaiku;DEVICE;BEEPER;OFF) from 192.168.1.202:31415 server got: (KidsHaiku;DEVICE;INDICATORS;ON) from 192.168.1.202:31415 server got: (KidsHaiku;WINTERMODE;STATE;OFF) from 192.168.1.202:31415 server got: (KidsHaiku;WINTERMODE;HEIGHT;244) from 192.168.1.202:31415 server got: (KidsHaiku;NW;TOKEN;c24ec29f-4be4-4a36-887f-1b87c62f1e67) from 192.168.1.202:31415 server got: (KidsHaiku;NW;DHCP;OFF) from 192.168.1.202:31415 server got: (KidsHaiku;FW;FW000003;2.2.40) from 192.168.1.202:31415 server got: (KidsHaiku;NW;SSID;Sancho24) from 192.168.1.202:31415 server got: (Haiku;DEVICE;ID;20:F8:5E:AA:3A:1C;FAN,HAIKU,SENSEME) from 192.168.1.145:31415 Sending: <20:F8:5E:AA:3A:1C;FAN;PWR;GET> Sending: <20:F8:5E:AA:3A:1C;FAN;SPD;GET;ACTUAL> Sending: <20:F8:5E:AA:3A:1C;FAN;SPD;GET;MIN> Sending: <20:F8:5E:AA:3A:1C;FAN;SPD;GET;MAX> Sending: <20:F8:5E:AA:3A:1C;FAN;AUTO;GET> Sending: <20:F8:5E:AA:3A:1C;FAN;WHOOSH;GET;STATUS> Sending: <20:F8:5E:AA:3A:1C;FAN;DIR;GET> Sending: <20:F8:5E:AA:3A:1C;LIGHT;LEVEL;GET;ACTUAL> Sending: <20:F8:5E:AA:3A:1C;LIGHT;LEVEL;GET;MIN> Sending: <20:F8:5E:AA:3A:1C;LIGHT;LEVEL;GET;MAX> Sending: <20:F8:5E:AA:3A:1C;LIGHT;AUTO;GET> Sending: <20:F8:5E:AA:3A:1C;DEVICE;LIGHT;GET> Sending: <20:F8:5E:AA:3A:1C;SNSROCC;STATUS;GET> Sending: <20:F8:5E:AA:3A:1C;SNSROCC;TIMEOUT;GET;MIN> Sending: <20:F8:5E:AA:3A:1C;SNSROCC;TIMEOUT;GET;MAX> Sending: <20:F8:5E:AA:3A:1C;SNSROCC;TIMEOUT;GET;CURR> Sending: <20:F8:5E:AA:3A:1C;SMARTMODE;ACTUAL;GET> Sending: <20:F8:5E:AA:3A:1C;SMARTMODE;STATE;GET> Sending: <20:F8:5E:AA:3A:1C;LEARN;STATE;GET> Sending: <20:F8:5E:AA:3A:1C;LEARN;MINSPEED;GET> Sending: <20:F8:5E:AA:3A:1C;LEARN;MAXSPEED;GET> Sending: <20:F8:5E:AA:3A:1C;LEARN;ZEROTEMP;GET> Sending: <20:F8:5E:AA:3A:1C;SLEEP;STATE;GET> Sending: <20:F8:5E:AA:3A:1C;SMARTSLEEP;IDEALTEMP;GET> Sending: <20:F8:5E:AA:3A:1C;SMARTSLEEP;MINSPEED;GET> Sending: <20:F8:5E:AA:3A:1C;SMARTSLEEP;MAXSPEED;GET> Sending: <20:F8:5E:AA:3A:1C;DEVICE;BEEPER;GET> Sending: <20:F8:5E:AA:3A:1C;DEVICE;INDICATORS;GET> Sending: <20:F8:5E:AA:3A:1C;WINTERMODE;STATE;GET> Sending: <20:F8:5E:AA:3A:1C;WINTERMODE;HEIGHT;GET> Sending: <20:F8:5E:AA:3A:1C;NW;TOKEN;GET> Sending: <20:F8:5E:AA:3A:1C;NW;DHCP;GET> Sending: <20:F8:5E:AA:3A:1C;FW;FW000003;GET> Sending: <20:F8:5E:AA:3A:1C;NW;SSID;GET> Sending: <20:F8:5E:AA:3A:1C;NW;AP;GET;STATUS> server got: (KidsHaiku;NW;AP;STATUS;OFF) from 192.168.1.202:31415 server got: (Haiku;FAN;PWR;ON) from 192.168.1.145:31415 server got: (Haiku;FAN;SPD;ACTUAL;1) from 192.168.1.145:31415 server got: (Haiku;FAN;SPD;MIN;1) from 192.168.1.145:31415 server got: (Haiku;FAN;SPD;MAX;7) from 192.168.1.145:31415 server got: (Haiku;FAN;AUTO;ON) from 192.168.1.145:31415 server got: (Haiku;FAN;WHOOSH;STATUS;OFF) from 192.168.1.145:31415 server got: (Haiku;FAN;DIR;FWD) from 192.168.1.145:31415 server got: (Haiku;LIGHT;LEVEL;ACTUAL;0) from 192.168.1.145:31415 server got: (Haiku;LIGHT;LEVEL;MIN;1) from 192.168.1.145:31415 server got: (Haiku;LIGHT;LEVEL;MAX;16) from 192.168.1.145:31415 server got: (Haiku;LIGHT;AUTO;OFF) from 192.168.1.145:31415 server got: (Haiku;DEVICE;LIGHT;PRESENT) from 192.168.1.145:31415 server got: (Haiku;SNSROCC;STATUS;OCCUPIED) from 192.168.1.145:31415 server got: (Haiku;SNSROCC;TIMEOUT;MIN;60000) from 192.168.1.145:31415 server got: (Haiku;SNSROCC;TIMEOUT;MAX;86400000) from 192.168.1.145:31415 server got: (Haiku;SNSROCC;TIMEOUT;CURR;1200000) from 192.168.1.145:31415 server got: (Haiku;SMARTMODE;ACTUAL;HEATING) from 192.168.1.145:31415 server got: (Haiku;SMARTMODE;STATE;FOLLOWTSTAT) from 192.168.1.145:31415 server got: (Haiku;LEARN;STATE;OFF) from 192.168.1.145:31415 server got: (Haiku;LEARN;MINSPEED;0) from 192.168.1.145:31415 server got: (Haiku;LEARN;MAXSPEED;7) from 192.168.1.145:31415 server got: (Haiku;LEARN;ZEROTEMP;2333) from 192.168.1.145:31415 server got: (Haiku;SLEEP;STATE;OFF) from 192.168.1.145:31415 server got: (Haiku;SMARTSLEEP;IDEALTEMP;2111) from 192.168.1.145:31415 server got: (Haiku;SMARTSLEEP;MINSPEED;0) from 192.168.1.145:31415 server got: (Haiku;SMARTSLEEP;MAXSPEED;6) from 192.168.1.145:31415 Failed - retrying : 1 Sending: <20:F8:5E:AA:3A:1C;DEVICE;BEEPER;GET> Failed - retrying : 1 Sending: <20:F8:5E:AA:3A:1C;DEVICE;INDICATORS;GET> Failed - retrying : 1 Sending: <20:F8:5E:AA:3A:1C;WINTERMODE;STATE;GET> Failed - retrying : 1 Sending: <20:F8:5E:AA:3A:1C;WINTERMODE;HEIGHT;GET> Failed - retrying : 1 Sending: <20:F8:5E:AA:3A:1C;NW;TOKEN;GET> Failed - retrying : 1 Sending: <20:F8:5E:AA:3A:1C;NW;DHCP;GET> Failed - retrying : 1 Sending: <20:F8:5E:AA:3A:1C;FW;FW000003;GET> Failed - retrying : 1 Sending: <20:F8:5E:AA:3A:1C;NW;SSID;GET> Failed - retrying : 1 Sending: <20:F8:5E:AA:3A:1C;NW;AP;GET;STATUS> server got: (Haiku;DEVICE;BEEPER;ON) from 192.168.1.145:31415 server got: (Haiku;DEVICE;INDICATORS;ON) from 192.168.1.145:31415 server got: (Haiku;WINTERMODE;STATE;ON) from 192.168.1.145:31415 server got: (Haiku;WINTERMODE;HEIGHT;244) from 192.168.1.145:31415 server got: (Haiku;NW;TOKEN;1680609e-53af-43d9-a0ec-f80ef917d0a5) from 192.168.1.145:31415 server got: (Haiku;NW;DHCP;OFF) from 192.168.1.145:31415 server got: (Haiku;FW;FW000003;2.2.40) from 192.168.1.145:31415 server got: (Haiku;NW;SSID;Sancho24) from 192.168.1.145:31415 server got: (Haiku;NW;AP;STATUS;OFF) from 192.168.1.145:31415 var this.myBigAss.light.exists = undefined [4/1/2017, 6:39:51 PM] [Big Ass Fan] No light exists for: Haiku Fan Light Found a new fan with name 'Haiku' and identifier: '20:F8:5E:AA:3A:1C'

and lightExists: 'true'

server got: (Haiku;DEVICE;BEEPER;ON) from 192.168.1.145:31415 server got: (Haiku;DEVICE;INDICATORS;ON) from 192.168.1.145:31415 server got: (Haiku;WINTERMODE;STATE;ON) from 192.168.1.145:31415 server got: (Haiku;WINTERMODE;HEIGHT;244) from 192.168.1.145:31415 server got: (Haiku;NW;TOKEN;1680609e-53af-43d9-a0ec-f80ef917d0a5) from 192.168.1.145:31415 server got: (Haiku;NW;DHCP;OFF) from 192.168.1.145:31415 server got: (Haiku;FW;FW000003;2.2.40) from 192.168.1.145:31415 server got: (Haiku;NW;SSID;Sancho24) from 192.168.1.145:31415 server got: (Haiku;NW;AP;STATUS;OFF) from 192.168.1.145:31415

pponce commented 7 years ago

@sean9keenan For the polling update/enhancement in the future you may want to look at this project: https://github.com/ebaauw/homebridge-lib

The author maintains homebridge-hue and it's rock solid. Sounds like it might help here.

pponce commented 7 years ago

@sean9keenan I created a fix that works. At least for me and i think should work generally. Can you let me know if this is an acceptable approach.
I essentially created another config variable, added it to the doctored config vars and have a check based on that var. The variable is configured automatically using light.exists and has a default setting of "false".
https://github.com/pponce/homebridge-bigAssFans/blob/master/index.js#L79 https://github.com/pponce/homebridge-bigAssFans/blob/master/index.js#L130 https://github.com/pponce/homebridge-bigAssFans/blob/master/index.js#L145 https://github.com/pponce/homebridge-bigAssFans/blob/master/index.js#L260

If you think this is an acceptable solution for this issue, i submitted a PR.

pponce commented 7 years ago

I've been running my fix for a couple weeks now with no issues with detecting lights. If others want to install this version to test as well you just need to run: npm install -g pponce/homebridge-bigAssFans#pponceLightFix

The only issue i have remaining now is that the occupancy sensors always show triggered in the home app.

djfatal commented 7 years ago

Awesome, I am going to try it out now. I hope the occupancy sensor can work in the future. :)

davidvanvo commented 7 years ago

installed this version last night. working great thus far. thanks @pponce

pedroserano commented 7 years ago

+1 working

pponce commented 7 years ago

@sean9keenan Just checking in. PR look good?

davidvanvo commented 7 years ago

This has been workin great for me thus far.

Does anyone know if the BigAssFan API support Haiku Lights too? I have those as well and this current plugin doesn't detect them.

sean9keenan commented 7 years ago

Thanks for pinging me again @pponce, and thank you for both creating the fix and getting the Pull Request in 😄

I've gone ahead and merged your changes in and updated the npm package so that it's easier for people to pull the changes.

Thanks again @pponce, and sorry for the delay!

pponce commented 7 years ago

No problem. Was fun to learn a bit and figure this out. Have you taken a look at this project by ebaauw? https://github.com/ebaauw/homebridge-lib He's implemented a polling feature that might come in handy for updating bigAssFans to poll since you mentioned bigAssFans changed the way the fans communicate.

sean9keenan commented 7 years ago

I'm glad it was fun and that you learned something!

That library does look quite interesting. We might also need to do a bit more sleuthing to confirm that it actually requires polling, or if you need to just fall back to polling in the case your network is blocking broadcast UDP traffic.

On Tue, May 23, 2017 at 8:45 AM, pponce notifications@github.com wrote:

No problem. Was fun to learn a bit and figure this out. Have you taken a look at this project by ebaauw? https://github.com/ebaauw/homebridge-lib He's implemented a polling feature that might come in handy for updating bigAssFans to poll since you mentioned bigAssFans changed the way the fans communicate.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sean9keenan/homebridge-bigAssFans/issues/15#issuecomment-303440802, or mute the thread https://github.com/notifications/unsubscribe-auth/ACAn3LhAPtVk3-QSLcl3YnI0gkVvDazCks5r8v8agaJpZM4Maj1h .

djfatal commented 7 years ago

Any progress with the occupancy sensor? :)

pedroserano commented 7 years ago

Or could we use this as a model for setting up a longpoll for each fan?

https://github.com/tekuonline/homebridge-assurelink2/blob/master/index.js

// Method for state periodic update
AssureLinkPlatform.prototype.statePolling = function (delay) {
  var self = this;
  var refresh = this.longPoll + delay;

  // Clear polling
  clearTimeout(this.tout);

  // Determine polling interval
  if (this.count  < this.maxCount) {
    this.count++;
    refresh = this.shortPoll + delay;
  }

  // Setup periodic update with polling interval
  this.tout = setTimeout(function () {
    self.updateState(function (error) {
      if (!error) {
        // Update states for all HomeKit accessories
        for (var deviceID in self.accessories) {
          var accessory = self.accessories[deviceID];
          self.updateDoorStates(accessory);
        }
      } else {
        // Re-login after short polling interval if error occurs
        self.count = self.maxCount - 1;
      }

      // Setup next polling
      self.statePolling(0);
    });
  }, refresh * 1000);
}
djfatal commented 7 years ago

For some reason the light stopped working again.

edit: n/m got it working again after I uninstalled and reinstalled the homebridge.

djfatal commented 7 years ago

Is any progress still being made on this?

djfatal commented 6 years ago

For some reason I started experiencing "No lights exists" again. I am trying the fork from @pponce and it is having this problem too.

edit: looks like my setup got corrupted somehow. I got things working again once I setup on a different raspberry pi.