sean9keenan / BigAssFansAPI

Unofficial API for Big Ass Fans!
MIT License
55 stars 12 forks source link

Unofficial Big Ass API

This is this an unofficial Node.js API for Big Ass Fans - fans with SenseME.

In particular - all development was done on a Haiku fan with SenseME.

What this could be/is used for

Using the API!

Two major components - the FanMaster and the BigAssFan.

FanMaster

Every fan needs a FanMaster! Because that's where the messages come from!

Usage

BigAssFan

Installation

npm install BigAssFansAPI

Example Code

var bigAssApi = require("BigAssFansAPI");

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

myMaster.onFanFullyUpdated = function(myBigAss){

    // Will automatically update / retry setting for this connected fan
    myBigAss.light.brightness = 1;
    myBigAss.fan.speed = 1;

    console.log("Initial Big Ass Light value: " + myBigAss.light.brightness);

    // Register for an update callback (say if the phone updates the property)
    myBigAss.light.registerUpdateCallback("brightness", function (newValue) {
        console.log("Updated brightness value: " + myBigAss.light.brightness); // or newValue
    })
    myBigAss.light.update("brightness");  // Forces an update to brightness
};

More examples

To see more examples, navigate to the examples directory!

More about Properties

Properties 'supported'

How was this made

Through the magic of Wireshark! And the time granted by a weekend!

Pretty sure all the API's I saw when sniffing are now in here. But that'll probably change as BigAssFans adds more features.

Boring stuff

I am in no way am associated with Big Ass Fans. Also this can break at any time if they change their API. I'm also in no way am responsible for you damaging your fan by using this API.

(However - I would be surprised if you did)

Where this API is going