oogje / homebridge-i6-bigAssFans

A Homebridge plugin which allows you to control a Big Ass Fan.
MIT License
18 stars 3 forks source link

Feature Request: Add more light controllability #20

Closed aveach closed 1 year ago

aveach commented 1 year ago

Would be nice to have full on/off control and dimming capabilities of the main and up lights on both the i6 and Haikus.

Also, my i6s es6s have the “UV-C Clean Mode” so would be nice to be able to toggle that on and off as well.

Thanks for the amazing plugin!

oogje commented 1 year ago

If I understand correctly, the plugin should give full on/off control and dimming capabilities of the main and up lights on fans that have uplights. If the plugin recognizes the uplight is equipped it should present two lights that you can control independently. I'm guessing the plugin doesn't recognize that there's an uplight and we'll need to figure out why.

It should look something like this:

IMG_6450

What are you seeing?

As for the UV-C Clean mode, we should be able to add a switch for that. I'd need to see what messages get sent when the UV-C is turned on and off. We could do that after we resolve the issue with the uplights.

aveach commented 1 year ago

Oh very cool, must be an issue on my end then. Correct, I don't see any lighting controls at all. Here's a room with a Haiku in it, but it's the same for all 5 fans (2 i6 and 3 Haiku):

image

aveach commented 1 year ago

Ahh ok... Well looking at it a bit more, looks like the 2 fans aren't i6 they are es6, so I changed that in the config and I also went into the fan settings in HomeKit and selected "Show as Separate Tiles". I see the light controls now. Sorry for the churn there 🤦‍♂️.

However, looks like the light doesn't actually control the up light on the es6 (mine don't have a down light). The light control is working for the Haikus

oogje commented 1 year ago

The single vs separate tiles thing can be confusing.

I haven't dealt with a fan that only has an uplight but no downlight yet. Chances are the plugin is not recognizing your configuration correctly.

Do you want to add some debugging parameters to your config.json file that will output detailed logs of the messages your fan is sending? Then I can look at the logs and try to see what's going on. If so, I'll lay out what to do.

aveach commented 1 year ago

Yeah, of course. Let's do it!

oogje commented 1 year ago

Please add the following to the config for one of your es6 fans;

"debugLevels": [
  [ "network", 11 ]
]

Then restart homebridge with the -D option and email the logs from when it restarts until a couple minutes after that. Send the logs to turbo_titled_0w@icloud.com.

If you're using Homebridge-UI you can tell it to use the -D option when restarting homebridge: image

Thanks.

aveach commented 1 year ago

Logs sent!

oogje commented 1 year ago

Logs received! I reproduced the issue using them and now I'll try to see what to do about it. Thanks!

oogje commented 1 year ago

I've published homebridge-i6-bigassfans@0.5.4-beta3. The intent is to resolve the light issues for the es6 fans and provide a switch to control the UV light.

You'll probably need to clear your es6 caches for their downlights to go away.

aveach commented 1 year ago

UVC works great! Unfortunately, I'm still only seeing the "Fan Light" that doesn't work, even after removing the two es6s from the cache.

edit: after disabling the plugin and re-enabling. I was able to see the light come up as "Fan Uplight", but unfortunately the light control still doesn't work. UVC and fan control does continue to work well though.

oogje commented 1 year ago

Would you try homebridge-i6-bigassfans@0.5.4-beta4?

This version takes a guess why the light control doesn't work.

Also, I think it will fix the bogus "Fan Light" appearing sometimes after a restart.

aveach commented 1 year ago

Tried removing the fans from cache and disable/enabled the plugin and still no dice on the light control. Would collecting some more logs help?

oogje commented 1 year ago

If debugLevels for "network" is 7 or more you should see sending c0120712051a03900501c0 which tells the fan which light to use and "sending c0120712051a03a00401c0 for "on" and c0120712051a03a00400c0 for off. If you see those being sent when you try to turn the light on or off from the Home app, then the next thing to try would be to different possibilities for the "which light" value.

Tomorrow I can make a beta that lets you try different "which light" values or you can connect to your fan directly from the terminal and send the raw binary, for instance, if you have a unix-like system with something like:

echo c0120712051a03900501c0c0120712051a03a00401c0 | xxd -r -p | nc LivingRoomFan.local 31415 > /dev/null

The above would be useful just to verify that sequence (which the plugin should be sending now) doesn't work. Then try c0120712051a03900500c0c0120712051a03a00401c0 and c0120712051a03900502c0c0120712051a03a00401c0. If none of those turn the light on, then I think we need to sniff the wire when you control the light from the BAF app to see what it's sending.

I'm going to call it a night now.

aveach commented 1 year ago

Ok. By chance I noticed that the BAF remote wasn't working to control the light either (seems like it was locked up) so, I tried rebooting the fans and the light control is working now!

There is some funky-ness (HomeKit didn't seem to recognize the correct fan state after the reboot), but looks like I got it to work consistently now. I'll give the commands you sent over a go and we'll see what I can gather.

oogje commented 1 year ago

Do I understand correctly that the BAF remote can control the light now and the plugin still does not control the light?

aveach commented 1 year ago

No. Both the remote and the plugin can now control the light.

Seems there was an issue with the fan itself and it was "locked up" in the sense that I also couldn't turn on the light from the BAF remote. I rebooted the fan (powered completely off/on from wall switch) and then I was able to get the light to work via the plugin.

oogje commented 1 year ago

So, everything is good for now or are there still some issues?

aveach commented 1 year ago

There was some weirdness around the plug-in state after the reboot (light/fan was on, but plug-in saw it as off). But I think I can file those separately as I narrow them down if need be.

I'd say this one is solved. Great success! Thank you!

oogje commented 1 year ago

All your fan are belong to us😁. We'll leave this issue open for a while in case things revert back to the unstable state. But yes, please open new issues as new problems present themselves.

Thanks for your help.

aveach commented 1 year ago

Thank you! Appreciate the quick work!