fjs21 / homebridge-blueair

BlueAir air purifier plugin for homebridge
https://www.npmjs.com/package/@fjs21/homebridge-blueair
Apache License 2.0
50 stars 6 forks source link

Please post your model & capabilities #6

Closed fjs21 closed 1 year ago

fjs21 commented 2 years ago

Hi,

I have enabled the use of the BlueAir model defined from info.compatibility to determine the capabilities and initialize the correct accessory type.

e.g. 'classic_280i' has temperature/humidity/air quality sensors while 'classic_605' has no sensors

Currently the following three models are recognized:

'classic_280i' = temp/hum/air quality sensors 'classic_680i' = temp/hum/air quality sensors

'classic_605' = no sensors

When you use v0.8.0 or higher, the model will be reported in the Homebridge log - something like

[@fjs21/homebridge-blueair] Kitchen BlueAir 680i of type "classic_680i" initialized.

If you see the following error:

'%s: device type not recognized, contact developer via GitHub.'

Then please post in this issue, your model and it's capabilities. I will then patch the plugin to add support as appropriate.

lbcastro commented 2 years ago

Hi

Thanks a lot for developing this plugin.

My device is recognized as 'classic_405'. Here's the product page: https://www.blueair.com/en-hk/air-purifiers/classic-405/global-1599.html

TLDR capabilities list: Wifi enabled, 3 speed settings, no air sensors.

Thanks and happy new year!

fjs21 commented 2 years ago

Hi

Thanks a lot for developing this plugin.

My device is recognized as 'classic_405'. Here's the product page: https://www.blueair.com/en-hk/air-purifiers/classic-405/global-1599.html

TLDR capabilities list: Wifi enabled, 3 speed settings, no air sensors.

Thanks and happy new year!

Added in v0.8.2

lensherm commented 2 years ago

I think the "i" models have sensors and the non "i" do not. In either case, my 480i has temp, humidity, air quality, voc, etc.

fjs21 commented 2 years ago

Thanks @lensherm. I have added 'classic_480i' to the list of supported devices. See v0.8.3.

lensherm commented 2 years ago

Thank you @fjs21

Now all seems to be working, in terms of the data from the accessories being populated and able to be controlled.

I'm seeing the below in the log:

===============================================================

[1/3/2022, 1:46:17 PM] [HB Supervisor] Restarting Homebridge... [1/3/2022, 1:46:17 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /homebridge/node_modules [1/3/2022, 1:46:18 PM] [HB Supervisor] Started Homebridge v1.3.9 with PID: 2260 [1/3/2022, 1:46:18 PM] Loaded config.json with 0 accessories and 2 platforms. [1/3/2022, 1:46:18 PM] Loaded 3 cached accessories from cachedAccessories. [1/3/2022, 1:46:18 PM] --- [1/3/2022, 1:46:19 PM] Loaded plugin: @fjs21/homebridge-blueair@0.8.3 [1/3/2022, 1:46:19 PM] Registering platform '@fjs21/homebridge-blueair.BlueAir' [1/3/2022, 1:46:19 PM] --- [1/3/2022, 1:46:19 PM] Loaded plugin: homebridge-config-ui-x@4.41.5 [1/3/2022, 1:46:19 PM] Registering platform 'homebridge-config-ui-x.config' [1/3/2022, 1:46:19 PM] --- [1/3/2022, 1:46:19 PM] Loading 2 platforms... [1/3/2022, 1:46:19 PM] [Config] Initializing config platform... [1/3/2022, 1:46:19 PM] [Config] Running in Service Mode [1/3/2022, 1:46:19 PM] [BlueAir] Initializing BlueAir platform... [1/3/2022, 1:46:19 PM] [BlueAir] base_API_url: https://api.blueair.io/v2/user/xxx@yyy.com/homehost/ [1/3/2022, 1:46:19 PM] [BlueAir] Loading accessory from cache: Downstairs [1/3/2022, 1:46:19 PM] [BlueAir] Loading accessory from cache: Living Room [1/3/2022, 1:46:19 PM] [BlueAir] Loading accessory from cache: Len’s Classic 480i Setup Payload: X-HM://00254CH2VYGBW Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

xxx-xxx-xxx

[1/3/2022, 1:46:19 PM] Homebridge v1.3.9 (HAP v0.9.8) (Homebridge DDA3) is running on port 53003. [1/3/2022, 1:46:19 PM] [BlueAir] Got homehost: api-us-east-1.blueair.io [1/3/2022, 1:46:19 PM] [BlueAir] x-auth-token: abcdefghijklmnop [1/3/2022, 1:46:20 PM] [BlueAir] Found 3 devices. [1/3/2022, 1:46:25 PM] [BlueAir] BlueAir AWS API: error - Time out on BlueAir AWS connection. [1/3/2022, 1:46:25 PM] [BlueAir] { message: 'Unauthorized' } [1/3/2022, 1:46:25 PM] [BlueAir] Restoring existing accessory from cache: Downstairs [1/3/2022, 1:46:25 PM] [BlueAir] Downstairs of type "classic_605" initialized. [1/3/2022, 1:46:25 PM] [BlueAir] Restoring existing accessory from cache: Living Room [1/3/2022, 1:46:25 PM] [BlueAir] Living Room of type "classic_605" initialized. [1/3/2022, 1:46:25 PM] [BlueAir] Restoring existing accessory from cache: Len’s Classic 480i [1/3/2022, 1:46:25 PM] [BlueAir] Len’s Classic 480i of type "classic480i" initialized. [1/3/2022, 1:49:10 PM] [BlueAir] BlueAir API: error - Time out on BlueAir connection. [1/3/2022, 1:49:10 PM] [BlueAir] Len’s Classic 480i: getDeviceInfo failed. [1/3/2022, 1:49:10 PM] [BlueAir] updateAccessoryCharacteristic failed (2F0146653E5085F2) [1/3/2022, 2:06:26 PM] [BlueAir] BlueAir API: error - Time out on BlueAir connection. [1/3/2022, 2:06:26 PM] [BlueAir] Len’s Classic 480i: getDeviceDatapoint failed. [1/3/2022, 2:06:26 PM] [BlueAir] updateAccessoryCharacteristic failed (2F0146653E5085F2)

===============================================================

lensherm commented 2 years ago

On a related note, the "i" series purifiers I've seen so far have an optional Auto fan mode, which controls the fan speed, based on detected particulates.

Just in case it would be helpful, I captured some message payloads from the purifier, as I switch it through various fan modes, using Node Red and am including them below:


Turned off
===========================
msg.payload : Object
object
PM2_5Density: 0
VOCDensity: 242
AirQuality: 1
CurrentRelativeHumidity: 38
CarbonDioxideDetected: 0
Active: 0
CurrentAirPurifierState: 0
TargetAirPurifierState: 0
LockPhysicalControls: 0
RotationSpeed: 1
===========================

Switching to Speed 1
===========================
msg.payload : Object
object
PM2_5Density: 0
VOCDensity: 228
AirQuality: 1
CurrentRelativeHumidity: 38
CarbonDioxideDetected: 0
Active: 1
CurrentAirPurifierState: 2
TargetAirPurifierState: 0
LockPhysicalControls: 0
RotationSpeed: 34
===========================

Switching to speed 2
===========================
msg.payload : Object
object
PM2_5Density: 0
VOCDensity: 228
AirQuality: 1
CurrentRelativeHumidity: 38
CarbonDioxideDetected: 0
Active: 1
CurrentAirPurifierState: 2
TargetAirPurifierState: 0
LockPhysicalControls: 0
RotationSpeed: 67
===========================

Switching to speed 3
===========================
msg.payload : Object
object
PM2_5Density: 0
VOCDensity: 191
AirQuality: 1
CurrentRelativeHumidity: 39
CarbonDioxideDetected: 0
Active: 1
CurrentAirPurifierState: 2
TargetAirPurifierState: 0
LockPhysicalControls: 0
RotationSpeed: 100
===========================

Switching to Auto
===========================
msg.payload : Object
object
PM2_5Density: 0
VOCDensity: 191
AirQuality: 1
CurrentRelativeHumidity: 39
CarbonDioxideDetected: 0
Active: 1
CurrentAirPurifierState: 2
TargetAirPurifierState: 1
LockPhysicalControls: 0
RotationSpeed: 34
===========================

Switching to Speed 1
===========================
msg.payload : Object
object
PM2_5Density: 0
VOCDensity: 191
AirQuality: 1
CurrentRelativeHumidity: 39
CarbonDioxideDetected: 0
Active: 1
CurrentAirPurifierState: 2
TargetAirPurifierState: 0
LockPhysicalControls: 0
RotationSpeed: 34
===========================

Switching to Auto
===========================
msg.payload : Object
object
PM2_5Density: 0
VOCDensity: 161
AirQuality: 1
CurrentRelativeHumidity: 39
CarbonDioxideDetected: 0
Active: 1
CurrentAirPurifierState: 2
TargetAirPurifierState: 1
LockPhysicalControls: 0
RotationSpeed: 34
===========================

From above, it looks like the TargetAirPurifierState shows whether the purifier is in Auto Mode or not, with 1 being Auto and 0 being Manual.

fjs21 commented 2 years ago

Yes. Auto mode is already supported in the current version. Long press the air purifier and scroll down. You can see set Auto by setting "Mode" to Auto. Child lock is also supported as well.

Note: the time out errors are sporadic and seem to be related to the API used by BlueAir. I could setting longer time outs but we would get errors from Homebridge/Homekit.

canerdianeh commented 2 years ago

classic_580i and classic_505 here.

fjs21 commented 2 years ago

classic_580i and classic_505 here.

Hi @canerdianeh, I assume the 580i has sensors and the 505 has no sensors?

canerdianeh commented 2 years ago

I believe that is correct.

canerdianeh commented 2 years ago

On a completely unrelated note, would you be interested working with me in building a HB plugin for the Tempest weather station? It makes its data available via UDP broadcast… I’ve done some code to listen to this in python, but I’ve got no experience with node or making a HB plugin.

fjs21 commented 2 years ago

Support for "classic_580i" and "classic_505" added in v0.8.4.

fjs21 commented 2 years ago

On a completely unrelated note, would you be interested working with me in building a HB plugin for the Tempest weather station? It makes its data available via UDP broadcast… I’ve done some code to listen to this in python, but I’ve got no experience with node or making a HB plugin.

I'm always happy to help. I suggest you join the Discord channel for homebridge and post your questions there. I found the community is very helpful. Looking at existing plugins and the recommended plugin template helped me a lot when I was getting started.

motaker commented 2 years ago

Hi, please add classic_205 (without sensor model).

fjs21 commented 2 years ago

Support added in v0.8.6

canerdianeh commented 2 years ago

Excellent... can confirm it works on the 580i - and it is even showing a CO2 sensor that even the native app lacks...

avis commented 2 years ago

Hi there! LivingRoom of type "sense+" initialized. [BlueAir] LivingRoom: device type not recognized, contact developer via GitHub. Let me know if there's a way to get capabilities. Thanks!

fjs21 commented 2 years ago

I added "sense+" as a classic type device. This supports setting the device fan speed and on/off but does not have sensors (temp, air quality, humidity). Please see v0.8.7

ayame-q commented 2 years ago

Hello! Can you please add "classic_290i" with temp/hum/air quality sensors? Thank you.

fjs21 commented 2 years ago

Added in v0.8.8

ghazel commented 2 years ago

[1/15/2022, 8:13:19 AM] [BlueAir] Sniffy of type "aware" initialized. [1/15/2022, 8:13:19 AM] [BlueAir] Sniffy: device type not recognized, contact developer via GitHub.

BlueAir Aware has PM 2.5, VOC, CO2, temperature and humidity.

The old bluerair plugin still kinda works with this device type.

fjs21 commented 2 years ago

Added in v0.8.9

ghazel commented 2 years ago

Added in v0.8.9

Thank you!

A few minor things:

fjs21 commented 2 years ago

Added in v0.8.9

Thank you!

A few minor things:

  • This prints Sniffy: no filter_status found. a lot (the Aware has no filter), but that seems to be harmless.
  • It's a little strange that I can't change the Room setting for the Humidity or Temperature sensor, but I can change the Room for the Air Quality sensor, which changes the others. Not a big deal (obviously the device can only be in one room), but on other integrations I've seen it's possible to change any of the sensors and they all change.
  • The Humidity and Temperature sensors don't show Manufacturer / Serial Number / etc section at the bottom (possibly related to the above). Makes it a little difficult to identify them.

I’ll have to code a new sensor only accessory. Can you tell me what capabilities it has? Air quality, humidity and temperature. Anything else?

ghazel commented 2 years ago

PM 2.5, VOC, CO2, temperature and humidity. Oh, and an LED.

fjs21 commented 2 years ago

Thanks. This should be addressed in v0.9. I added a new accessory type which includes the sensors but strips out the air purifier and filter maintenance services from the accessory. Let me know if it works and if you are getting any warnings/errors in the log. I can't test fully as I don't have this type of device.

jonato1 commented 2 years ago

@Phunkadilic Can you please post your logs for your Health Protect 7710i? Specifically, I'm looking for something like this... This device is not yet supported. Device Type:

Phunkadilic commented 2 years ago

@jonato1, no problem! If you need the full log, I can paste that as well. For now, here is the line you requested: This device is not yet supported. Device Type: low_1.4

jonato1 commented 2 years ago

@Phunkadilic v1.0.5 should be out - let me know if your HealthProtect 7710i is working now or if you see any issues.

Phunkadilic commented 2 years ago

@Phunkadilic v1.0.5 should be out - let me know if your HealthProtect 7710i is working now or if you see any issues.

@jonato1, sweet! Both 7710i purifiers are now showing in HomeKit with the AWS option box checked. Thanks a ton! I have a couple questions… is there a feature list I can use to add features or are all available features available. Mainly, is there a way to run “auto” mode from HomeKit?

Secondly, what’s the easiest way to donate to this project. It seems you’ve maybe taken over for fjs21? I want to donate to you both for your hard work and responsive/quick turnaround and updates and improvements.

jonato1 commented 2 years ago

@Phunkadilic For features, I would say you could open up "Issues" in GitHub and they can be tagged/tracked as features - that is probably the easiest way.

To enable Auto mode, do the instructions here satisfy what you are looking for? If not, feel free to open an issue to track.

Lastly, I appreciate the willingness to donate. I will say, I have not taken over for @fjs21, but rather just stepped in to offer what I could on this specific AWS issue (I had a DustProtect myself and had enough motivation, time, and expertise to make it happen). I would not have been able to do what I had done (and so quickly) without the foundation that Fraser had in place and the quick responses on his end to code review and publish.

If you'd like to donate, I believe Fraser has a Sponsor profile set up. I don't have one set up yet (just found out about it), but I've got PayPal and Venmo if you feel so inclined 😄 Thanks!

jimbee25 commented 2 years ago

Please can you add the Classic 690i? https://www.blueair.com/my/air-purifiers/classic-690i/global-9997.html

I believe this is just the international version of the Classic 680i sold in the US. It looks like the features are the same.

Thanks!

9zero8 commented 2 years ago

Any chance on support for 7470i?

fjs21 commented 2 years ago

@9zero8 can you check the log and tell me what it says on this line:

This device is not yet supported. Device Type: XXXXX

9zero8 commented 2 years ago

@9zero8 can you check the log and tell me what it says on this line:

This device is not yet supported. Device Type: XXXXX

@fjs21 It does not say anything like that. It looks like it connects, it gets a host name then ends with "Blueair BridgeBlueAirFound 0 devices."

frictionlessDevelopments commented 2 years ago

Hello, I have a BlueAir 7470i as well. Browsing through the platform.ts it seems like support for 7470i has been added.

https://github.com/fjs21/homebridge-blueair/blob/89d17e25fb04b71345c8f047b0ab308b08421e09/src/platform.ts#L335

However, on the Home App, it identifies itself as a DustProtect.

Do let me know if I can provide any information to help.

Edit: 01-Aug I noticed that the following are missing

  1. night mode
  2. humidity sensor
  3. temp sensor
fjs21 commented 2 years ago

The Model text is hardcoded into the Accessory code as 'DustProtect'. So that's not a major concern. The accessory running both is the same.

The accessory supports NightMode as a switch, GermShield as a switch, but I don't see any mention of a temp sensor.

@jonato1 has been providing support for the Amazon AWS API based devices as I do not own one of these.

jonato1 commented 2 years ago

@frictionlessDevelopments i can work on trying to fix the hard coded reference to "DustProtect".

For your other notes, nightmode should be supported as an on/off switch in HomeKit.

The temp and humidity sensors are not something I ever added as I didn't have insight into the code they returned. When I get some time later this week, I can send some questions over to you that should help narrow that down.

Thanks, Jon

jonato1 commented 2 years ago

@frictionlessDevelopments Can you confirm that you were able to utilize nightmode? Also, for the temp and humidity sensors, can you do the following to assist?

  1. If needed, download and install Postman.
  2. Import this collection here.
  3. In the collection variables, enter your username and password.
  4. Run the commands in order until you get to "Get State".
  5. Copy the response of the "Get State" request into your next reply.

Thanks, Jon

frictionlessDevelopments commented 2 years ago

@jonato1 hey jon, could share with me how does the night mode toggle look like? This is what I'm looking at when I load up my home.app. Thanks for looking into this.

Home.app, Purifier tile Screen Shot 2022-08-16 at 21 16 33

Home.app -> Purifier tile -> Purifier -> Settings

Screen Shot 2022-08-16 at 21 17 42

Here's the response, with my uuid and mac address removed. If it matters, I used the EU variant of the postman collection shared in #24

https://gist.github.com/frictionlessDevelopments/225f72c94efdba22e5e03ca866f5e872

jonato1 commented 2 years ago

@fjs21 Can you review my latest commits and publish a release at your earliest convenience?

@frictionlessDevelopments The nightmode switch should show up as a separate on/off switch just like GermShield. Can you enable debugging logging on your Homebridge and see if you see any errors or logs containing the keyword "nightmare"?

Thanks, Jon

frictionlessDevelopments commented 2 years ago

Hey @jonato1 I downloaded the new update and enabled debug log. I can now see the temperature and humidity sensors.

There's no keyword "nightmare" in the debug log. If my understanding of the log is correct, it's able to detect the nightmode state but the tile/switch is not created on the home.app.

[17/08/2022, 20:14:40] [BlueAir] Accessory State (#1): { n: 'germshield', vb: true, t: 1660738479 }
[17/08/2022, 20:14:40] [BlueAir] Accessory State (#2): { n: 'filterusage', v: 6, t: 1660738479 }
[17/08/2022, 20:14:40] [BlueAir] Accessory State (#3): { n: 'brightness', v: 25, t: 1660738479 }
[17/08/2022, 20:14:40] [BlueAir] Accessory State (#4): { n: 'standby', vb: false, t: 1660738479 }
[17/08/2022, 20:14:40] [BlueAir] Accessory State (#5): { n: 'fanspeed', v: 11, t: 1660738479 }
[17/08/2022, 20:14:40] [BlueAir] Accessory State (#6): { n: 'nightmode', vb: false, t: 1660738479 }
[17/08/2022, 20:14:40] [BlueAir] Accessory State (#7): { n: 'childlock', vb: false, t: 1660738479 }
[17/08/2022, 20:14:40] [BlueAir] Accessory State (#8): { n: 'safetyswitch', vb: true, t: 1660738479 }
[17/08/2022, 20:14:40] [BlueAir] Accessory State (#9): { n: 'mfv', v: 16777243, t: 1660738479 }
[17/08/2022, 20:14:40] [BlueAir] Accessory State (#10): { n: 'ofv', v: 33554968, t: 1660738479 }
[17/08/2022, 20:14:40] [BlueAir] Accessory State (#11): { n: 'automode', vb: true, t: 1660738479 }
[17/08/2022, 20:14:40] [BlueAir] Accessory State (#12): { t: 1660738479, vb: true, n: 'online' }

If it helps, I cleaned up the log a little to show only blueair related information. https://gist.github.com/frictionlessDevelopments/b69f664dcba7784fa6ddb23309e0b473

Let me know if I can provide more information.

jonato1 commented 2 years ago

HI @frictionlessDevelopments - That is good news on the sensors! Do the readings in Home.app seem to match what you see in the Blueair app? If so, I think we should be good there.

As for my last message, I meant to say "nightmode", but alas - autocorrect. The logs are helpful, so thank you for those. I may need to dig into this one a bit more. I agree that the code is returning an Accessory State for nightmare, but the fact that it is not registering the switch is a bit odd. I'll have to see what the issue is here. I'll plan to follow up in the next week or so. You can see what it should look like below.

Other than that, is everything working as expected? Are there any other gaps you see from your end?

Thanks, Jon

Screen Shot 2022-08-18 at 11 02 01 AM Screen Shot 2022-08-18 at 11 02 12 AM
frictionlessDevelopments commented 1 year ago

Hey @jonato1 Yes the sensor readings on the Home App matches those with the Blueair App. Everything is working as expected. Thank you very much for your help!

homeAppPurifier

ChristopherUC commented 1 year ago

I have 2 BlueAir 7710i that have temp, humidity, and germ protect modes the same as the 7470i. But they don't show up that way in HomeKit.

110% happy to pull logs or anything else to get the temp and humidity sensors in those working.

Thanks for ALL your great work!

jonato1 commented 1 year ago

@ChristopherUC can you share screenshots of how they are showing up in HomeKit? Also, can you clarify what is not working as you would expect, and what the behavior is that you would want to see?

ChristopherUC commented 1 year ago

Thanks @jonato1 Here are the screenshots from HomeKit.

image

image

image

Here are the ones from the BlueAir app.

image

image

image

From what I gathered from looking at the code, there is support for certain models (just not the 7710i?) to represent the on/off Staus of GermShield in HomeKit, as well as the temp/humidity sensors that are shown in the BlueAir app.

Finally, here's how it shows up in the Eve app, which is arguably more useful than the native Home app.

image

image

Finally, Here's where I suspect the change would need to be made...

image

jonato1 commented 1 year ago

You are 100% on point; I'll make the code change shortly. I initially misunderstood that the scope was for germ protect, temp and humidity simply not showing up (vs. something actually appearing incorrectly for them). Thanks for all of the info.

ChristopherUC commented 1 year ago

Sorry, I didn’t mean to be unclear at first. Thanks for sticking with me and getting this sorted. I truly appreciate the work you have put into this integration.

jonato1 commented 1 year ago

@ChristopherUC Truly no worries! Thanks for the collaboration. The fix is in and should be in the next build. @fjs21 should be able to provide clarity on timeline for when that will be, but it's usually a few days at most.