Coder Social home page Coder Social logo

homebridge-bigassfans's Introduction

Homekit

A Homekit implementation for Big Ass Fans. Is heavily dependant on the unofficial Big Ass Fans API.

Installing

First install homebridge - instructions here

An example config.json is as follows:

    "platforms": [
        {
            "platform": "BigAssFans",
            "name": "Big Ass Fan",
            "fan_count": 1
        }
    ]

This config will automatically scan and add all fans that are on your local wifi network. However you should also always add the expected number of fans with the optional config parameter fan_count (by default this assumes 1). Otherwise homebridge will not always discover all the fans.

Install this package with

npm install -g homebridge-bigAssFans

Important note

All of the smarts in your fan will continue to operate - eg. If you set homekit and your fan's local settings set to turn the light on when occupancy is sensed, and then decide to turn it off via homekit the local settings will still turn the light on

Legacy

Legacy mode allows you to specify a single fan to control - and also allows more fine grained control regarding the settings of the single fan.

Legacy mode can not run at the same time as the new Platform mode. In addition this mode does not support running multiple big ass fans.

{
    "accessory": "BigAssFan",
    "name": "Sean's Big Ass Fan",
    "fan_name": "Sean's Room",
    "fan_id": "20:F8:5E:AA:7A:57"
}

In order to get the fan_id, run the example program getFanInfo.js from theBigAssFansAPI.

You must also set the fan_name to the name returned here.

About the legacy config

Field Required? Description
name Optional Overall Name to use for this accessory
fan_name Required Must get this from getFanInfo.js
fan_id Required Must get this from getFanInfo.js
fan_ip_address Optional IP address of fan, defaults to broadcast
light_exists Optional Has light? set to true - default false
light_on Optional What "On" means - default Max
fan_on Optional What "On" means - default 3/7
homekit_fan_name Optional Name to call the Fan in Homekit
homekit_light_name Optional Name to call the Light in Homekit

Future features

  • Getting motion sensors to work
  • Allowing all Legacy settings in the Platform mode

Testing

In order to test a local copy you can read here, or as a brief tldr:

/usr/local/bin/homebridge -D -P ./homebridge-bigAssFans/

(Or if homebridge is somewhere else, run which homebridge to find it's location)

Other issues:

  • If you can't add the bridge device try changing the `"username"`` in the config file, sometimes this needs to be changed to fix a caching issue on iOS

homebridge-bigassfans's People

Contributors

barkmadley avatar davidwkeith avatar gsxdsm avatar pedroserano avatar pponce avatar sean9keenan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homebridge-bigassfans's Issues

i6 Fan compatibility

I am having issues with seeing the i6 fan using this. I have set it to expect 5 fans, four Haiku and one i6. The Haiku's are found and working as expected, the i6 never shows up in homebridge. Can we get the i6 to be compatible in a future release? Thanks

Error: This callback function has already been called by someone else; it can only be called one time

Tried the new platform version, and got this error whenever the iOS Home app tried to identify one of my fans:

Sun, 18 Sep 2016 22:54:28 GMT Accessory [Family Room Fan] Identification request
[9/18/2016, 3:54:28 PM] [Haiku Fan] Family Room Fan Identify!!!
[9/18/2016, 3:54:28 PM] [Haiku Fan] Family Room Fan Identified fan (homekit setup)
/opt/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/once.js:11
throw new Error("This callback function has already been called by someone else; it can only be called one time.");
^

Error: This callback function has already been called by someone else; it can only be called one time.
at /opt/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/once.js:11:13
at PlatformAccessory. (/opt/local/lib/node_modules/homebridge-bigAssFans/index.js:101:5)
at emitTwo (events.js:92:20)
at PlatformAccessory.emit (events.js:172:7)
at PlatformAccessory. (/opt/local/lib/node_modules/homebridge/lib/platformAccessory.js:142:12)
at emitTwo (events.js:87:13)
at Accessory.emit (events.js:172:7)
at Accessory._identificationRequest (/opt/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:109:10)
at Accessory. (/opt/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:818:14)
at emitThree (events.js:97:13)

iOS 13 changed fan and light to one object

I am seeing two problems:

  1. the light isn’t responding at all to the homekit control, and
  2. there are two controls, one for fan and one for light; these used to be separate, but now both open the same panel showing a light, a fan, a direction, and The sensor status. It all appears to work except the light. Except that we now don’t need separate objects for three different things...

Thx.

Last fan speed and light level not saved

Platform: HOOBS

When using Siri or HomeKit control, turning on the fan will always set to level 3 instead of the last used speed. Turning on the light always sets to 100%. This also happens when using automations. Once the fan or light is on setting the manually setting levels works as expected.

Does not work with 2 Fans added as accessories

I just installed this home bridge plugin and it works fantastically for a single fan. It crashes when I add more than 1 fan as an accessory. Any progress on getting this to work with 2 fans?

Thanks!

expose fan smart mode as HomeKit thermostat

Rather than controlling my fan speeds directly, I'm perfectly happy to have my Haiku fans be in smart mode. What I would like to control about my fans is which temperature the smart mode is targeting.

Is it possible to read the fan's current temperature? If so, would it be possible to expose the fan's current temperature and ideal/smart set point as a thermostat in HomeKit instead of (or in addition to) a fan?

Fan lights not detected

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 [email protected]
\u251c\u2500\u2500 [email protected]
\u251c\u2500\u2500 [email protected]
\u251c\u2500\u2500 [email protected]
\u251c\u2500\u2500 [email protected]
\u2514\u2500\u2500 [email protected]

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

Homebridge fails to start port binding error:

Given:

      {
          "accessory": "BigAssFan",
          "name": "Master Bedroom Fan",
          "fan_name": "Master Bedroom Fan",
          "fan_id": "20:F8:5E:AB:32:56",
          "fan_ip_address": "192.168.0.134"
      }

Homebridge fails to start:

[6/28/2016, 6:38:05 AM] [Master Bedroom Fan] Initializing BigAssFan accessory...
events.js:154
      throw er; // Unhandled 'error' event
      ^

Error: bind EADDRINUSE 0.0.0.0:31415
    at Object.exports._errnoException (util.js:856:11)
    at exports._exceptionWithHostPort (util.js:879:20)
    at dgram.js:214:18
    at nextTickCallbackWith3Args (node.js:485:9)
    at process._tickCallback (node.js:391:17)
    at Function.Module.runMain (module.js:449:11)
    at startup (node.js:139:18)
    at node.js:999:3

There's nothing listening on 31415. Except for when the plugin code tries to bind:

    this.server.bind(this.fanPort, (function () {
        this.server.setBroadcast(true);
        this.connectionOpen = true;
        this.rescanUntilAllFans();
    }).bind(this));

Issue with homebridge >= 1.0.0

i'm having issues with homebridge >= 1.0.0.
Hopefully @sean9keenan or @davidwkeith can take a look. My issues started when i cleared my cachedAccessories file.
When i did that i could not install this plugin. Homebridge would crash giving me some error about reachability.
I was able to get it installed without homebridge crashing by commenting out this one line
existingAccessory.updateReachability(true);
however issues then started occur. The native app started to not respond well as well as the homekit controls. long delays and or it would lose connection.
Would hate to lose this plugin! Please help! 😄

Haiku lights

Hi, love the project any chance this could include the new Haiku lights?

[email protected] - Plugin 'homebridge-bigAssFans' tried to register with an incorrect plugin identifier: 'homebridge-bigAssFan'. Please report this to the developer!

After updating [email protected] receiving "Plugin 'homebridge-bigAssFans' tried to register with an incorrect plugin identifier: 'homebridge-bigAssFan'. Please report this to the developer!"

However, it seems just a warning for now. Everything is still working.

Apr 27 14:14:06 raspberrypi-3BPlus homebridge[5958]: [2020-4-27 14:14:06] Loaded plugin: homebridge-bigAssFans
Apr 27 14:14:06 raspberrypi-3BPlus homebridge[5958]: [2020-4-27 14:14:06] Registering platform 'homebridge-bigAssFans.BigAssFans'
Apr 27 14:14:06 raspberrypi-3BPlus homebridge[5958]: [2020-4-27 14:14:06] Plugin 'homebridge-bigAssFans' tried to register with an incorrect plugin identifier: 'homebridge-bigAssFan'. Please report this to the developer!
Apr 27 14:14:06 raspberrypi-3BPlus homebridge[5958]: [2020-4-27 14:14:06] Registering accessory 'homebridge-bigAssFans.BigAssFan'

Duplicate Serial Numbers for all fans

I have a number of Big Ass Fans in use with this plugin. I also use ControllerForHomeKit, and it has detected that all of the fans have the same serial number (Default-SerialNumber).

Each HomeKit device should have a unique serial number. So it appears this plugin needs to be updated to use unique serial numbers.

Haiku fans show up in Lutron app all in the same room duplicated

Not sure if this problem is on the Homebridge BigAssFans side, or Lutron side, but this is really weird:

When I have my 6 Haiku fans set up in Homebridge, synced to HomeKit in different rooms, they all end up showing up in my Lutron app in one room, duplicated (all six entries are the same fan), and randomly change from one fan to the next. It also causes the Lutron app to hang up and slow down.

Here's an example of one moment in time. It'll randomly change the fan represented to Guest Room, then Master Bedoom, etc for all the entries (yet stay in the same room next to each other) once in a while.

Controls do sort of work, I was able to get my fan to spin up to 100%, back to 0%, etc with the Luton quick set buttons.

image

So a few things that are odd:

  • Clearly Lutron thinks these are fans from their own fan controller. Could there be some identifier that is not set correctly on the Homebridge side? I notice the manufacturer, serial, model are all "Default-XXX", but doubt they specifically look for that. Anything else?
  • The Lutron app is collapsing these all down to one room, this seems like a clear Lutron bug as HomeKit shows them placed in the correct rooms. But maybe it happens because the serial, etc are all the same perhaps.

Thoughts? I'm going to email Lutron as well but I don't expect to get a lot of traction from them on debugging and/or fixing this.

Array Handling Error

Got the following error:

/usr/local/lib/node_modules/homebridge-bigAssFans/node_modules/BigAssFansAPI/BigAssApi.js:51
        var deviceType = msg[4].split(",",1); // Grab first part of string before ","
                               ^

TypeError: Cannot read property 'split' of undefined
    at FanMaster.<anonymous> (/usr/local/lib/node_modules/homebridge-bigAssFans/node_modules/BigAssFansAPI/BigAssApi.js:51:32)
    at FanMaster.<anonymous> (/usr/local/lib/node_modules/homebridge-bigAssFans/node_modules/BigAssFansAPI/BigAssApi.js:75:13)
    at emitTwo (events.js:106:13)
    at Socket.emit (events.js:192:7)
    at UDP.onMessage [as onmessage] (dgram.js:547:8)

...this error kills homebridge entirely.

Plugin causes Homebridge v1.3.0 beta to crash

Hello -

I answered the call for testers for the v1.3.0 beta of homebridge. Updating results in a crash loop for me with the following in the logs:

[1/2/2021, 2:16:23 PM] TypeError: Cannot read property 'omitEventUpdate' of null at Bridge.Accessory.handleCharacteristicChangeEvent (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1808:100) at Accessory.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:552:84) at Accessory.emit (events.js:315:20) at Accessory.handleCharacteristicChangeEvent (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1797:12) at Service.emit (events.js:315:20) at Characteristic.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Service.ts:669:12) at Characteristic.emit (events.js:315:20) at Object.0.03283219355104894 (/homebridge/node_modules/@miblanchard/homebridge-big-ass-fans/index.js:180:20) at BigAssProperty.<anonymous> (/homebridge/node_modules/@miblanchard/homebridge-big-ass-fans/node_modules/BigAssFansAPI/BigAssApi.js:158:48) at BigAssFan.<anonymous> (/homebridge/node_modules/@miblanchard/homebridge-big-ass-fans/node_modules/BigAssFansAPI/BigAssApi.js:319:36)

about 1/3 of the time one of my two fans would not be usable in the home app

I was running into an issue where 1 of my two fans would not be usable in the homekit app. They would be present as options in the app (fan and light) but for one of the fans the buttons in homekit would not do anything.
I'm forgetting the exact error message but it would say 2 accessories not responding or not usable. Something like that. It would be one fan and it's light.

I looked at the code and tried adding this to my config file.
"fan_count": 2
Since adding this to my config file I have not received this error. So this seems to have fixed my problem.
Sharing my issue and solution in case others have the same problem. Also in case there is a better way to solve for it in the code somehow.

Expose Haiku wall controller

Would love it if this plugin could expose the haiku wall controller so i can trigger other homekit products to turn on or off based on button press of controller.
https://www.haikuhome.com/wall-control-wifi-module

I recently installed the homberidge-hue app and it can expose the philips switches. It's been great to use those switch button presses as trigger events.

homebridge crashed with this error

homebridge crashed with this error

/usr/local/lib/node_modules/homebridge-bigAssFans/node_modules/BigAssFansAPI/BigAssApi.js:51
var deviceType = msg[4].split(",",1); // Grab first part of string before ","
^

TypeError: Cannot read property 'split' of undefined
at FanMaster. (/usr/local/lib/node_modules/homebridge-bigAssFans/node_modules/BigAssFansAPI/BigAssApi.js:51:33)
at FanMaster. (/usr/local/lib/node_modules/homebridge-bigAssFans/node_modules/BigAssFansAPI/BigAssApi.js:75:13)
at Socket.emit (events.js:197:13)
at UDP.onMessa

[FEATURE] Eve App 4.2 Issue with homebridge-bigAssFans

@sean9keenan
The lates Eve for HomeKit App v4.2 is causing issues with several Homebridge Plugins.
They changed something so that the serial number of a device is linked somehow in the background. This was not with previous Eve versions.
Problems causing now like described here.
homebridge/homebridge#2503
So all devices/switches etc. from homebridge-bigAssFans can't be sorted correctly anymore and can't get an icon for each device separately. This because of "Default-SerialNumber".

Do you see a solution to fix this "Eve" Issue, by changing something in your plugin?

Other plugin developers like @nicoduj homebridge-harmony already fixed the Eve Issue #249.
@pponce with homebridge-script2 did a fix #25 by adding "unique_serial": which also was a great and working solution.

homebridge-bigAssFans Plugin is indispensable for me and I would not want to miss it.

Thanks again for your work and the time you are investing.

Fan w/out Wall Controller

up until the latest haiku firmware update, both fans with and without wall controllers work fine. with the latest, my fan without the wall controller doesn’t work as expected. the fan will switch on and off but the lights do not work. nothing happens.

Error after configuration and installation of plugin in Homebridge

Trying to configure plugin for a single fan, getting an error when restarting homebridge:

TypeError: existingAccessory.getServices is not a function
    at new BigAssFanAccessory (/usr/local/lib/node_modules/homebridge-bigAssFans/index.js:254:52)
    at /usr/local/lib/node_modules/homebridge/src/server.ts:357:50
    at Array.forEach (<anonymous>)
    at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/src/server.ts:330:29)
    at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:156:12)
    at cli (/usr/local/lib/node_modules/homebridge/src/cli.ts:80:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (internal/modules/cjs/loader.js:1015:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
    at Module.load (internal/modules/cjs/loader.js:879:32)

Latest firmware update to haiku fans broke compatibility

I believe the latest firmware updates to my haiku fans broke compatibility.
I suspect they changed the underlying api’s to work similar to how their newer i6 models work.
This is just a guess as they also migrated support for these fans to their newer app that supported i6 models. The Old bigassfan app no longer works with the updated haiku fans.

when I have time I’ll test the theory out by installing the i6 plugin linked to and mentioned here.
#33

Service.OccupancySensor

I'm thinking a good feature enhancement, given recent trigger support for sensors in iOS, would be to add the Haiku occupancy sensor as it's own service with Service.OccupancySensor. I will play with this when I have a chance, but thoughts?

Plugin crashes Homebridge on launch

Hello,

My config is
{
"accessory": "BigAssFan",
"name": "Big Fan",
"fan_name": "Big Fan",
"fan_id": "b8:f0:09:ac:bd:b8"
}

The log is:

[4/11/2021, 11:10:43 AM] [Big Fan] Initializing BigAssFan accessory...
[4/11/2021, 11:10:43 AM] [Big Fan] No light exists for: Big Fan Fan Light
[4/11/2021, 11:10:43 AM] TypeError: existingAccessory.getService is not a function
at new BigAssFanAccessory (/usr/local/lib/node_modules/@miblanchard/homebridge-big-ass-fans/index.js:277:44)
at /usr/local/lib/node_modules/homebridge/src/server.ts:350:50
at Array.forEach ()
at Server.loadAccessories (/usr/local/lib/node_modules/homebridge/src/server.ts:270:29)
at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:162:12)
[4/11/2021, 11:10:43 AM] Got SIGTERM, shutting down Homebridge...

I should mention that I assumed the MAC address was the fan_id and the name I assigned the fan was the fan_name because getFanInfo.js from theBigAssFansAPI did not output anything. Will open an issue in the theBigAssFansAPI about that.

Thank you for your efforts.

  • brian

edited to add: Homebridge v1.3.4

Fan code assumes Light is present

I have a Haiku fan without the built-in light.

I was able to edit index.js and conditionalize the creation of this.lightService based on new config var that I added to the config.json. Not sure how to auto-detect that the light is present/missing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.