Git Product home page Git Product logo

homebridge-blueair's Introduction

npm GitHub last commit

This plugin is not actively maintained, I no longer own a BlueAir and cannot fix issues - Repo is up for adoption.

An alternative plugin

Fraser has done a great job on a new dynamic, platform based plugin that was based on this foundation - please give his a try as an alternative! fjs21/homebridge-blueair

homebridge-blueair

This is a homebridge plugin which lets you integrate your non-HomeKit BlueAir air purifier into HomeKit.

Currently supported are all Classic i-Series air purifiers, however, Classic series without sensors but do have wifi controls, should be supportable if I can be provided with API output by anyone!

This plugin exposes all BlueAir (Foobot) API characteristics and assigns them to native HomeKit Characteristics. The plugin will also mimic the Elgato Eve Room device such that, if using Eve.app on an iOS device, you will have historical logging and graphs of these metrics.

Currently all history state is stored on the local filesystem of the device running homebridge.

Screenshots

Eve

Overview Detail 1 Detail 2 Detail 3
Overview Detail 1 Detail 2 Detail 3

Home

Overview Air Purifer On/Off Air Purifer Fan Speed Air Purifier Detail
Overview Air Purifer On/Off Air Purifer Fan Speed Air Purifier Detail
Air Quality Overview Air Quality Detail Temperature Overview Temperature Detail
Air Quality Overview Air Quality Detail Temperature Overview Temperature Detail
Humidity Overview Humidity Detail CO2 Overview CO2 Detail
Humidity Overview Humidity Detail CO2 Overview CO2 Detail
LED Overview LED Detail LED Brightness CO2 Automation
LED Overview LED Detail LED Brightness CO2 Automation

Configuration

Installation

npm install homebridge-blueair

config.json

An explaination of the config is below, a config-example.json is also provided along with the plugin for ease of use.

For instructions on how to retrieve your apikey see here.

/// i-Series
  {
    "accessory": "BlueAir",
    "name": "BlueAir 680i",
    "airPurifierIndex": "0", //optional if you have multiple air purifiers
    "nameAirQuality": "Air Quality", //optional
    "nameTemperature": "Temperature", //optional
    "nameHumidity": "Humidity", //optional
    "nameCO2": "Carbon Dioxide", //optional
    "username": "BlueAir-Email",
    "password": "BlueAir-Password",
    "showTemperature": true, //show temp sensor
    "showHumidity": true, //show humidity sensor
    "showAirQuality": true, //show air quality sensor
    "showCO2": true, //show CO2 sensor
    "showLED": true, //register the air purifier's LED as a lightbulb service
    "getHistoricalStats": true //enable historical logging in Eve.app
},

/// Classic Series or Sense

{
    "accessory": "BlueAir",
    "name": "BlueAir Sense",
    "airPurifierIndex": "1", //optional, should match your actual device order
    "purifierOnly": true, //must be true for Classic/Sense+ device
    "username": "BlueAir-Email",
    "password": "BlueAir-Password"
    "showLED": true //register the air purifier's LED as a lightbulb service
},

/// Aware

{
    "accessory": "BlueAir",
    "name": "BlueAir Aware",
    "airPurifierIndex": "2", //optional, should match your actual device order
    "sensorOnly": true, //must be true for Aware device
    "nameAirQuality": "Air Quality", //optional
    "nameTemperature": "Temperature", //optional
    "nameHumidity": "Humidity", //optional
    "nameCO2": "Carbon Dioxide", //optional
    "username": "BlueAir-Email",
    "password": "BlueAir-Password",
    "showTemperature": true, //show temp sensor
    "showHumidity": true, //show humidity sensor
    "showAirQuality": true, //show air quality sensor
    "showCO2": true, //show CO2 sensor
    "getHistoricalStats": true //enable historical logging in Eve.app
}

Releases

See CHANGELOG.md

To-dos

See open enhancement issues

API research

There is no documented API for the BlueAir devices, through some API proxying with Charles I was able to find out they use the Foobot API backend for their intelligence and map all requests for get/set.

Postman collection and environment

I coallated all requests that my device made into an easy-to-use Postman collection.

You need to create a Postman Environment with the following variables in it to use the collection: Postman Environment

Thanks

This plugin is heavily based on (hacked together from) two other plugins, homebridge-efergy and homebridge-mi-air-purifier, without these plugins I could not have created the foundation on which this was built. Thanks to @luc-ass and @seikan for their work on these.

The fakegato-history plugin on which this is based was built by @simont77, without this, we wouldn't have pretty graphs to gawk at.

homebridge-blueair's People

Contributors

dsully avatar mlkh0225 avatar mylesagray avatar yuao 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homebridge-blueair's Issues

iOS 13 optimazation

Hi,
After iOS 13 update, I cannot access to fan speed auto mode, only fan speed sliders now.
Would you please optimize this plugin into iOS 13 ?

Thank you.

airPurifierIndex specified is higher than number of air purifiers available

Since an unintentional restart of HomeBridge this morning, I can no longer control my BlueAir 480i and logs show:

[9/27/2020, 3:39:45 PM] [BlueAir 480i] Polled API: https://api-nc.foobot.io/v2/device/undefined/attribute/fanspeed/ {
currentValue: 0,
scope: 'device',
defaultValue: 0,
name: 'fan_speed',
uuid: undefined
}
[9/27/2020, 3:39:45 PM] [BlueAir 480i] Already logged in
[9/27/2020, 3:39:45 PM] [BlueAir 480i] Polled API: https://api-nc.foobot.io/v2/owner/****@gmail.com/device/ undefined
[9/27/2020, 3:39:45 PM] [BlueAir 480i] airPurifierIndex specified is higher than number of air purifiers available

It works fine to control from the BlueAir app, and I've tried removing configuration and plugin and reinstalling.

Possible bug when changing fan speed

mylesgray, I wanted to start a new topic for this so we can keep the last thread we were discussing it on closed.

I was trying to reproduce this issue tonight and realized it might have to do with situations where I change the fan speed on the Blueair unit itself, and the Home app hasn’t updated/synced to the new state. I think when I do this, and then I go change the speed in HomeKit, things get squirrelly.

I usually get unexpected results going from the highest speed 3, to around 30-35% on the slider. The fan will sometimes physically switch to speed 1, and then jump back to 2 right away. It’s hard to say exactly what percent the slider is on but it’s close to 1/3, and that’s when I see this glitch.

As I was testing, if I have the Home app’s fan speed selection on the screen, (let’s say on low), then I change the speed to High by pressing the physical button on the Blueair unit twice, the Honekit GUI won’t update to reflect the new state. It seems the Home app only updates the status if I kill the entire app and reopen it.

I’m not 100% sure yet if the bug I’m experiencing is related to that or not, but I will play around with it more and see if I can reliable reproduce the issue every time. If I can, I’ll post my steps and take a video.

Otherwise it’s really not a big deal as I have to screw around with it outside of a normal way of using it to get it to happen. I think in normal, everyday use, this fan speed jump I am seeing is unlikely to happen.

In any case, I think the issue could stem from the mystery state of the slider switch on the Home app. Because it’s a variable switch and you cannot see a percentage and sort of have to guess, I just can’t tell if I’m misinterpreting something, or if the logic is getting confused.

It would actually be really nice from a user interface perspective if there was a UI switch for a 3 speed selector, instead of a 0-100% sliding switch (intended for a dimmer switch). If there was something like this with 4 hard states (Off, 1, 2 and 3), I think this could solve my issue and possibly simplify the programming logic. Does HomeKit have any configuration settings for this sort of switch with multiple hard states?

I wonder what the HomeKit-enabled Hunter ceiling fans do, since most fans have low, medium, high and off?

Food for thought.

Updated to Homebridge platform

Hi @mylesagray,

As I was getting numerous warnings from Homebridge, I took a look at the blueair plugin to see if I could fix but then got a bit carried away.

I started working on a fork of your awesome plugin and recoded it using typescript as a dynamic platform type plugin. This way when you login, the BlueAir devices are detected and added as accessories automatically.

I also enabled configuration using the Homebridge UI so folks do not have to work with the json config directly. I also added some experimental code to allow people to hide devices that they do not want to wish to appear in Homebridge. This could also be extended to turn on/off support for features as you do.

https://github.com/fjs21/homebridge-blueair

Badly parsed values?

Ok, you asked me to create an issue with problems mentioned in the previous bug, so here it comes :)

UI output:
image

The readings at console/log level:
image

Does the UI output seem to be wrongly parsed? As you can see.
Filter output from API changed as for now API returns "initUsagePeriod: 87102227," which seems to be not countable by /60/60/24 anymore as we get huge value and period counted later reach minus values (180-1008).

I'm using Blueair 280i.

If you want more logs please drop me a line.

fork to hass.io add-on?

I'd like to control my new Blueair 480i via Home Assistant/hass.io. Unfortunately the hassio homebridge addon is officialy dead. The newer HomeKit component seems to work quite well. Any chance homebridge-blueair could be forked to a new hassio add-on?

Classic 605

Hi mylesgray,

Thank you for creating this. I have the 605. Is there some information I could provide that would help you add the classic series to your plugin?

Thank you,

Issue with the /login method

Does the https://{{homehost}}/v2/user/{{username}}/login/ method still function? I'm testing using your Postman collection and can't retrieve my X-AUTH-TOKEN using this method - it simply returns false.

I was able to proxy my traffic from the iOS app using Charles and found the login method is never called - instead login seems to use webviews via Gigya. Is this a new development? Or just an anomaly?

Once I have my auth token from iOS, I can use the rest of the Postman collection correctly - so I don't think it's something I'm doing. I haven't tried the code yet as I don't use homebridge. I am looking to fork your work into a similar connector for OpenHAB

For the record, my X-API-KEY-TOKEN is the same as yours too (Australia) so it does indeed look to be global.

Build global API key into code.

I am just letting you know that I followed your Wiki and found my API Token is the same as the global one.

This is tested in US.

BlueAir Classic 205

First and foremost thanks for all the work on this plugin!
I setup the plugin and I have both an BlueAir Aware and Classic 205.
As my Classic 205 does not have the following options.
"nameAirQuality": "Air Quality", //optional
"nameTemperature": "Temperature", //optional
"nameHumidity": "Humidity", //optional
"nameCO2": "Carbon Dioxide", //optional
I've removed those lines, so no issues there, however I don't want to show these sensors in Homekit.
In doing that I've changed these values to the the following.
"showTemperature": false,
"showHumidity": false,
"showAirQuality": false,
"showCO2": false,

When I save and attempt to restart I get the following errors and Homebridge does not start.

[7/2/2020, 08:03:47] [BlueAir 205] Initializing BlueAir accessory...
[7/2/2020, 08:03:48] TypeError: Cannot read property 'getCharacteristic' of undefined
at new BlueAir (/usr/local/lib/node_modules/homebridge-blueair/index.js:235:5)
at /usr/local/lib/node_modules/homebridge/src/server.ts:357:50
at Array.forEach ()
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. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (internal/modules/cjs/loader.js:1138:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)

So I need to revert back to true on the above values for All but the CO2 sensor. If any of the other sensors are listed as false, Homebridge won't start.

Blueair Aware is working fine. Controls of the Blueair Classic 205 is fine. I can turn it on and off as well as adjust fan speed.

Can anyone indicate what I may be doing wrong or is this a bug?

Thanks!

-Nick

plugin and homebridge crashes on foobot.io api failure

Sometime the foobot.io api returns non json strings. It causes the plugin crash.

<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewpo
rt" content="width=device-width, initial-scale=1"><title>503 Service Unavailable</title><style type="text/css">body{marg
in:5% auto 0 auto;padding:0 18px}.P{margin:0 22%}.O{margin-top:20px}.N{margin-top:10px}.M{margin:10px 0 30px 0}.L{margin
-bottom:60px}.K{font-size:25px;color:#F90}.J{font-size:14px}.I{font-size:20px}.H{font-size:18px}.G{font-size:16px}.F{wid
th:230px;float:left}.E{margin-top:5px}.D{margin:8px 0 0 -20px}.C{color:#3CF;cursor:pointer}.B{color:#909090;margin-top:1
5px}.A{line-height:30px}.hide_me{display:none}</style></head><body><div id="p" class="P"><div class="K">503</div><div cl
ass="O I">Service Unavailable</div><p class="J A L">Error Times: Sat, 13 Apr 2019 06:43:59 GMT<br><span class="F">IP: ****</span>Node information:tb74:3<br>URL: https://api-cn-north-1.foobot.io/v2/device/*******/info/<br
><span class="hide_me">Please contact our support                                                                       
                                                                                                                        
SyntaxError: Unexpected token < in JSON at position 0                                                                   
    at JSON.parse (<anonymous>)                                                                                         
    at BlueAir.<anonymous> (/usr/local/lib/nodejs/node-v10.15.0/lib/node_modules/homebridge-blueair/index.js:442:27)    
    at BlueAir.<anonymous> (/usr/local/lib/nodejs/node-v10.15.0/lib/node_modules/homebridge-blueair/index.js:264:6)     
    at Request.self.callback (/usr/local/lib/nodejs/node-v10.15.0/lib/node_modules/homebridge-blueair/node_modules/reque
st/request.js:185:22)                                                                                                   
    at Request.emit (events.js:182:13)                                                                                  
    at Request.<anonymous> (/usr/local/lib/nodejs/node-v10.15.0/lib/node_modules/homebridge-blueair/node_modules/request
/request.js:1161:10)                                                                                                    
    at Request.emit (events.js:182:13)                                                                                  
    at IncomingMessage.<anonymous> (/usr/local/lib/nodejs/node-v10.15.0/lib/node_modules/homebridge-blueair/node_modules
/request/request.js:1083:12)                                                                                            
    at Object.onceWrapper (events.js:273:13)                                                                            
    at IncomingMessage.emit (events.js:187:15)                     

Maybe we should add some protection around JSON.parse(...) ?

HAP Warning

Seeing this warning from the HAP library with Homebridge 1.1.2

[8/27/2020, 6:58:26 PM] [BlueAir 280i] Initializing BlueAir accessory...
HAP Warning: Characteristic 00000093-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 0000008D-0000-1000-8000-0026BB765291. Adding anyway.
HAP Warning: Characteristic 00000065-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 0000008D-0000-1000-8000-0026BB765291. Adding anyway.
HAP Warning: Characteristic undefined not in required or optional characteristics for service 0000008D-0000-1000-8000-0026BB765291. Adding anyway.

Looks like the "Carbon Dioxide Level" and others are not part of the "Air Quality Sensor" anymore?

classic 405 switching on/off keeps pending

When a 405 is switched on or off, the switching bit keeps on pending.
when I close and reopen home app, it is actually on or off.

when I switch off ::

[2018-12-3 18:35:30] [BlueAir 405] Polled API: https://api-eu-west-1.foobot.io/v2/device/id/attribute/fanspeed/ { currentValue: 0,
  scope: 'device',
  defaultValue: 0,
  name: 'fan_speed',
  uuid: 'id' }

And then nothing happens. The device keeps on pending stating it is switching off.
As soon as I reopen home

[2018-12-3 18:37:16] [BlueAir 405] Already have device ID
[2018-12-3 18:37:16] [BlueAir 405] Already have device ID
[2018-12-3 18:37:16] [BlueAir 405] Already have device ID
[2018-12-3 18:37:16] [BlueAir 405] Already have device ID
[2018-12-3 18:37:16] [BlueAir 405] Already have device ID
[2018-12-3 18:37:16] [BlueAir 405] Already have device ID
[2018-12-3 18:37:16] [BlueAir 405] Polled API: https://api-eu-west-1.foobot.io/v2/device/id/attributes/ undefined
[2018-12-3 18:37:16] [BlueAir 405] Got device settings
[2018-12-3 18:37:16] [BlueAir 405] Polled API: https://api-eu-west-1.foobot.io/v2/device/id/attributes/ undefined
[2018-12-3 18:37:16] [BlueAir 405] Got device settings
[2018-12-3 18:37:16] [BlueAir 405] Polled API: https://api-eu-west-1.foobot.io/v2/device/id/attributes/ undefined
[2018-12-3 18:37:16] [BlueAir 405] Got device settings
[2018-12-3 18:37:16] [BlueAir 405] Polled API: https://api-eu-west-1.foobot.io/v2/device/id/attributes/ undefined
[2018-12-3 18:37:16] [BlueAir 405] Got device settings
[2018-12-3 18:37:16] [BlueAir 405] Polled API: https://api-eu-west-1.foobot.io/v2/device/id/attributes/ undefined
[2018-12-3 18:37:16] [BlueAir 405] Got device settings
[2018-12-3 18:37:16] [BlueAir 405] Polled API: https://api-eu-west-1.foobot.io/v2/device/id/attributes/ undefined
[2018-12-3 18:37:16] [BlueAir 405] Got device settings

Then the actual (correct) status is presented.
I replaced the actual device id with id

This plugin slows down Homebridge

Homebridge version: 1.3.0
Node.js Version: v14.15.1
Npm Version: v6.14.9

This plugin slows down Homebridge. The read handler for the characteristic 'Carbon Dioxide Peak Level' was slow to respond! See https://git.io/JtMGR for more info.

Can't add duplicate Classic 405

I have two classic 405 and one 605

i am able to add one 405 and the 605

when i go to add the 3rd 405 I get a same uuid as another bridged accessory error

however I cannot change the UUID of the second blueair 405 and get it to show up

any thoughts?

plugin doesn't work and entire homebridge became "no response"

Hi, I could use this plugin without problem till 2 days ago. I have updated all my devices to iOS 14 and homebridge version 1.1.6 to 1.2.2.

I have this error "airPurifierIndex specified is higher than number of air purifiers available"
because of this all of other homebridge accessory became "no response" due to endless message cycle appeared as descried in log file. When I exclude this plugin from config.json, everything works as same as before.

I am running Homebridge v1.2.2 now but when I downgraded to v1.1.6, it doesn't work also, very strange...
I am not sure it is related to iOS update but it happened at same time, just for your reference.

I have tried hard reboot of homebridge hub(raspberry pi 3B+), deleted all purifier and re-registered again into blueair app, even only one purifier registered in both blueair app and homebridge config file without statement "airPurifierIndex": "0",
same error message "airPurifierIndex specified is higher than number of air purifiers available"

please be so kind to help, how to fix this.

homebridge.log in debug mode
[9/18/2020, 11:10:31] [HB Supervisor] Restarting Homebridge...
[9/18/2020, 11:10:31] [HB Supervisor] Starting Homebridge with extra flags: -I -D
[9/18/2020, 11:10:31] [HB Supervisor] Started Homebridge v1.2.2 with PID: 6048
[9/18/2020, 11:10:32] Loaded config.json with 13 accessories and 4 platforms.
[9/18/2020, 11:10:32] ---

[9/18/2020, 11:10:35] Loaded plugin: [email protected]
[9/18/2020, 11:10:38] Registering accessory 'homebridge-blueair.BlueAir'

[9/18/2020, 11:10:46] Loading 13 accessories...

[9/18/2020, 11:10:46] [WIC purifier] Initializing BlueAir accessory...
[9/18/2020, 11:10:46] [Entrance purifier] Initializing BlueAir accessory...
[9/18/2020, 11:10:46] [Entrance purifier] ** Fakegato-storage AddWriter : Entrance purifier
[9/18/2020, 11:10:46] [Entrance purifier] Loading...
[9/18/2020, 11:10:46] [Entrance purifier] ** Fakegato-storage read FS file: /var/lib/homebridge/hassio_Entrance purifier_persist.json
[9/18/2020, 11:10:46] [Entrance purifier] ** Fakegato-timer Subscription : Entrance purifier
[9/18/2020, 11:10:46] [Entrance purifier] Registring Events Entrance purifier
[9/18/2020, 11:10:46] [Entrance purifier] Accessory Entrance purifier
[9/18/2020, 11:10:46] [Entrance purifier] ** Fakegato-timer Subscription : undefined

[9/18/2020, 11:10:47] [WIC purifier] Polled API: https://api.foobot.io/v2/user/[email protected]/homehost/ undefined
[9/18/2020, 11:10:47] [WIC purifier] Got home region: "api-nc.foobot.io"
[9/18/2020, 11:10:47] [WIC purifier] Polled API: https://api.foobot.io/v2/user/[email protected]/homehost/ undefined
[9/18/2020, 11:10:47] [WIC purifier] Got home region: "api-nc.foobot.io"
[9/18/2020, 11:10:47] [WIC purifier] Polled API: https://api.foobot.io/v2/user/[email protected]/homehost/ undefined
[9/18/2020, 11:10:47] [WIC purifier] Got home region: "api-nc.foobot.io"
[9/18/2020, 11:10:47] [Entrance purifier] Polled API: https://api.foobot.io/v2/user/[email protected]/homehost/ undefined
[9/18/2020, 11:10:47] [Entrance purifier] Got home region: "api-nc.foobot.io"
[9/18/2020, 11:10:47] [Entrance purifier] Polled API: https://api.foobot.io/v2/user/[email protected]/homehost/ undefined
[9/18/2020, 11:10:47] [Entrance purifier] Got home region: "api-nc.foobot.io"
[9/18/2020, 11:10:47] [Entrance purifier] Polled API: https://api.foobot.io/v2/user/[email protected]/homehost/ undefined
[9/18/2020, 11:10:47] [Entrance purifier] Got home region: "api-nc.foobot.io"

after homebridge is runing,

[9/18/2020, 11:10:47] Homebridge is running on port 51600.
[9/18/2020, 11:10:48] [WIC purifier] Polled API: https://api-nc.foobot.io/v2/user/[email protected]/login/ undefined
[9/18/2020, 11:10:48] [WIC purifier] Logged in to API
[9/18/2020, 11:10:48] [Entrance purifier] Polled API: https://api-nc.foobot.io/v2/user/[email protected]/login/ undefined
[9/18/2020, 11:10:48] [Entrance purifier] Logged in to API
[9/18/2020, 11:10:48] [Entrance purifier] Polled API: https://api-nc.foobot.io/v2/user/[email protected]/login/ undefined
[9/18/2020, 11:10:48] [Entrance purifier] Logged in to API
[9/18/2020, 11:10:48] [WIC purifier] Polled API: https://api-nc.foobot.io/v2/user/[email protected]/login/ undefined
[9/18/2020, 11:10:48] [WIC purifier] Logged in to API
[9/18/2020, 11:10:48] [Entrance purifier] Polled API: https://api-nc.foobot.io/v2/user/[email protected]/login/ undefined
[9/18/2020, 11:10:48] [Entrance purifier] Logged in to API
[9/18/2020, 11:10:48] [WIC purifier] Polled API: https://api-nc.foobot.io/v2/user/[email protected]/login/ undefined
[9/18/2020, 11:10:48] [WIC purifier] Logged in to API
[9/18/2020, 11:10:48] [WIC purifier] Polled API: https://api-nc.foobot.io/v2/owner/[email protected]/device/ undefined
[9/18/2020, 11:10:48] [WIC purifier] airPurifierIndex specified is higher than number of air purifiers available
[9/18/2020, 11:10:48] [Entrance purifier] Polled API: https://api-nc.foobot.io/v2/owner/[email protected]/device/ undefined
[9/18/2020, 11:10:48] [Entrance purifier] airPurifierIndex specified is higher than number of air purifiers available
[9/18/2020, 11:10:48] [Entrance purifier] Polled API: https://api-nc.foobot.io/v2/owner/[email protected]/device/ undefined
[9/18/2020, 11:10:48] [Entrance purifier] airPurifierIndex specified is higher than number of air purifiers available
[9/18/2020, 11:10:48] [Entrance purifier] Polled API: https://api-nc.foobot.io/v2/owner/[email protected]/device/ undefined
[9/18/2020, 11:10:48] [Entrance purifier] airPurifierIndex specified is higher than number of air purifiers available
[9/18/2020, 11:10:48] [WIC purifier] Polled API: https://api-nc.foobot.io/v2/owner/[email protected]/device/ undefined
[9/18/2020, 11:10:48] [WIC purifier] airPurifierIndex specified is higher than number of air purifiers available
[9/18/2020, 11:10:48] [WIC purifier] Polled API: https://api-nc.foobot.io/v2/owner/[email protected]/device/ undefined
[9/18/2020, 11:10:48] [WIC purifier] airPurifierIndex specified is higher than number of air purifiers available

and this cycle of messages continues.

my config which was working before is shown below
{
"accessory": "BlueAir",
"name": "WIC purifier",
"airPurifierIndex": "0",
"username": "",
"password": ""
},
{
"accessory": "BlueAir",
"name": "Entrance purifier",
"airPurifierIndex": "1",
"nameAirQuality": "Air Quality",
"nameTemperature": "Temp.",
"nameHumidity": "Hum.",
"nameCO2": "CO2",
"username": "",
"password": "",
"showTemperature": true,
"showHumidity": true,
"showAirQuality": true,
"showCO2": true,
"showLED": false,
"getHistoricalStats": true
},

crashes homebridge on restart

on a fresh install of this, seems to crash the homebridge:
[8/24/2020, 11:30:32 PM] TypeError: Math.max is not iterable (cannot read property Symbol(Symbol.iterator)) at BlueAir.<anonymous> (/usr/local/lib/node_modules/homebridge-blueair/index.js:770:25) at BlueAir.<anonymous> (/usr/local/lib/node_modules/homebridge-blueair/index.js:691:11) at BlueAir.<anonymous> (/usr/local/lib/node_modules/homebridge-blueair/index.js:288:6) at Request.self.callback (/usr/local/lib/node_modules/homebridge-blueair/node_modules/request/request.js:185:22) at Request.emit (events.js:311:20) at Request.<anonymous> (/usr/local/lib/node_modules/homebridge-blueair/node_modules/request/request.js:1154:10) at Request.emit (events.js:311:20) at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge-blueair/node_modules/request/request.js:1076:12) at Object.onceWrapper (events.js:417:28) at IncomingMessage.emit (events.js:323:22)

BlueAir Sense+ support?

It's a very awesome and useful plugin.
Any plans adding support of Bluair Sense device?
I've tested this plugin on Sense+ device and I could say I was able to get a basic features working. Altough there is an execption that homberidge throws from time to time.

TypeError: Cannot read property 'length' of undefined
    at BlueAir.<anonymous> (/usr/lib/node_modules/homebridge-blueair/index.js:509:31)
    at BlueAir.<anonymous> (/usr/lib/node_modules/homebridge-blueair/index.js:281:6)
    at Request.self.callback (/usr/lib/node_modules/homebridge-blueair/node_modules/request/request.js:185:22)
    at Request.emit (events.js:311:20)
    at Request.<anonymous> (/usr/lib/node_modules/homebridge-blueair/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:311:20)
    at IncomingMessage.<anonymous> (/usr/lib/node_modules/homebridge-blueair/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:417:28)
    at IncomingMessage.emit (events.js:323:22)
    at endReadableNT (_stream_readable.js:1204:12)

Support for HealthProtect

Hello, Do you know if this will work with HealthProtect models? I can give you my u/p if you want to check it out.

Purifier Classic 205 error

Hi, got an issue following your instructions:

TypeError: Cannot read property 'uuid' of undefined
at BlueAir. (/usr/local/lib/node_modules/homebridge-blueair/index.js:375:55)
at BlueAir. (/usr/local/lib/node_modules/homebridge-blueair/index.js:288:6)
at Request.self.callback (/usr/local/lib/node_modules/homebridge-blueair/node_modules/request/request.js:185:22)
at Request.emit (events.js:315:20)
at Request. (/usr/local/lib/node_modules/homebridge-blueair/node_modules/request/request.js:1154:10)
at Request.emit (events.js:315:20)
at IncomingMessage. (/usr/local/lib/node_modules/homebridge-blueair/node_modules/request/request.js:1076:12)
at Object.onceWrapper (events.js:421:28)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1327:12)

My config is:
{
"accessory": "BlueAir",
"name": "BlueAir Classic",
"airPurifierIndex": 0,
"purifierOnly": true,
"username": "{BlueAir-Email}",
"password": "{BlueAir-Password}",
"showLED": true
}

I'm doing something bad?

Model (and serial number) not showing properly in accessory details.

Serial Number: server-undefined
Model: Default-Model

Looks like the calls to

.setCharacteristic(Characteristic.Model, this.appliance.info.compatibility) .setCharacteristic(Characteristic.SerialNumber, hostname + "-" + this.appliance.info.uuid)

Isn't setting these properly.

The firmware version is also showing as "0.5.1", when the BlueAir firmware shows as 1.1.38 (Wifi Firmware) and 10.35 (MCU Firmware)

BlueAir Classic 405 Support (Wi-Fi controllable with no built-in sensors)

I've confirmed using Charles as instructed that they share the same API however I cannot make it work on homebridge.

The log shows the following after homebridge crashes:

/usr/local/lib/node_modules/homebridge-blueair/index.js:474
this.measurements.pm = json.datapoints[0][i];
^

TypeError: Cannot read property '1' of undefined
at BlueAir. (/usr/local/lib/node_modules/homebridge-blueair/index.js:474:52)
at BlueAir. (/usr/local/lib/node_modules/homebridge-blueair/index.js:248:6)
at Request.self.callback (/usr/local/lib/node_modules/homebridge-blueair/node_modules/request/request.js:186:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request. (/usr/local/lib/node_modules/homebridge-blueair/node_modules/request/request.js:1163:10)

P.S. I'm new to GitHub and not a programmer so I'm not sure where to start.

API Changed

Seems that new API is using AWS. Im no programmer, but trying to edit Myle's code to make it work with the new API. Unfortunately I'm stuck at the moment due to the POST request coming back with an incomplete body of the JSON. Suspecting that it's chunked, but I'm not sure how to go about bringing in the full body of the JSON.

Seems to come back in full when using a curl script.. just not through the js request for some reason.

Does this still work?

Can't seem to get it to work and other users said it has stopped working.
Any confirmations?

Classic 505 doesn't have

When using this plugin with classic 505 without sensor, it throws error complaining json content.
I believe it doesn't have any response for this API:

/v2/device/' + this.deviceuuid + '/datapoint/

I think you did pretty god job in guarding every single measurement pulling with config flag. I think may be you can add another flag "pull_measurements" or something to skip initial pulling in the following block

https://github.com/mylesgray/homebridge-blueair/blob/046808126862b073f81c7d779d2f141428945c31/index.js#L238-L242

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.