Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wave Enhance support #49

Open
berezovskyi-oleksandr opened this issue Nov 8, 2024 · 20 comments
Open

Wave Enhance support #49

berezovskyi-oleksandr opened this issue Nov 8, 2024 · 20 comments
Labels
enhancement New feature or request

Comments

@berezovskyi-oleksandr
Copy link

Is your feature request related to a problem? Please describe.
I just receive the Wave Enhance support and it doesn't seem to be supported by this library

Describe the solution you'd like
I'd like to get the Wave Enhance support in this lib to get possibility to enable it in Home Assistant

@berezovskyi-oleksandr berezovskyi-oleksandr added the enhancement New feature or request label Nov 8, 2024
@LaStrada
Copy link
Member

This is under development, and will hopefully be released later this month

@berezovskyi-oleksandr
Copy link
Author

@LaStrada do you have any updates? I'd be happy to get my Wave Enhance sensors integrated

@samuolis
Copy link

samuolis commented Dec 7, 2024

Also waiting for wave enhance support. What is the problem to add it? Because it is mostly the same as any other wave device

@berezovskyi-oleksandr
Copy link
Author

@LaStrada any chance we could help to facilitate the testing and/or development?

@LaStrada
Copy link
Member

Sorry for the delay. Will try posting what I have during the weekend. What's missing is a check for version when adding it (all devices needs to be updated) + improve code quality + tests.

So it should work now, except for some issues when adding a brand new device (old firmware). Will post it as a custom integration and link it here!

@guppy
Copy link

guppy commented Dec 30, 2024

Looking forward to this as I'd like to get support added to ESPHome also.

@LaStrada
Copy link
Member

Again, sorry for the delay. I made some fixes yesterday and will try to publish a beta of the framework, and then make a custom integration that can be imported using HACS or similar later today.

I've fixed the issue with adding devices with old FW, the user is now asked to upgrade using the Airthings app.

Will update here when it's available!

@LaStrada
Copy link
Member

Looking forward to this as I'd like to get support added to ESPHome also.

I'm no expert in ESPHome development, but feel free to contact me on Discord (same username) if you, or anyone else, need any help in developing this!

@berezovskyi-oleksandr
Copy link
Author

berezovskyi-oleksandr commented Dec 31, 2024

beta of the framework

I tried it and it seems to work. I created a simple executable script to scan BLE devices and then call the lib for the communication

AirthingsDevice(manufacturer='Airthings AS', hw_version='REV X', sw_version='T-SUB-2.6.2-master+0', model=<AirthingsDeviceType.WAVE_ENHANCE_EU: '3210'>, name='Airthings Tern CO2', identifier='000551', address='B0:D2:78:XX:XX:XX', did_first_sync=True, sensors={'battery': 100, 'lux': 171, 'co2': 688, 'voc': 472, 'humidity': 37.35, 'temperature': 21.53, 'noise': 90, 'pressure': 987.17890625})

@LaStrada
Copy link
Member

LaStrada commented Jan 1, 2025

A beta can be found here:
https://github.com/LaStrada/HA-Airthings-BLE-beta

Install it as a custom integration using HACS or similar.

Please report bugs either in this thread, create a new issue ticket, or comment on this PR: #50

@samuolis
Copy link

samuolis commented Jan 2, 2025

I tested it, it looks like it works quite well. It looks like all of the entities are present, detection was also working so I guess it should be fine. I will work with the data now with this custom integration and will wait for the official update from HA
Screenshot 2025-01-02 at 11 54 35

@berezovskyi-oleksandr
Copy link
Author

berezovskyi-oleksandr commented Jan 2, 2025

The custom integration works well with both sensors I have. However, I noticed a couple of issues:

  1. The battery percentage displayed does not match the value shown in the mobile app (e.g. 89% in app and 100% in HA).
  2. One of the devices became unavailable for a period, and when it reconnected, the battery percentage was stuck at 0%, even though other data continued to update correctly.
    image

@LaStrada
Copy link
Member

LaStrada commented Jan 2, 2025

Thanks for the feedback! Will look into it. Mine is reporting 100% in HA, but the app is reporting 30%. Definitely something wrong there! 👀

@LaStrada
Copy link
Member

LaStrada commented Jan 2, 2025

@berezovskyi-oleksandr That was an easy fix, I forgot to convert from mV to V. 🤦‍♂️ I'll push a fix right away!

Not sure why you got 0%, though. If it persists, I might need to add more logging or debug the raw data in your logs.

@berezovskyi-oleksandr
Copy link
Author

Perfect, thanks for the fix!

Regarding the 0% issue, it resolved itself after another period of unavailability (likely due to instability in my bluetooth proxy network). I'll monitor this behavior and report it as a separate issue if it happens again.

Aside from these two points, everything works amazingly well! It's great to finally access the CO2 sensor data without relying on the mobile app. I really appreciate your hard work on this!

@LaStrada
Copy link
Member

LaStrada commented Jan 2, 2025

I’ve pushed an update to the custom integration:
https://github.com/LaStrada/HA-Airthings-BLE-beta/releases/tag/1.0.0b4

The previous beta release (1.0.0b3) included some fixes for auto-discovery, but I’ve only been able to automatically detect devices on my Mac, not on any of my other HA installations (Intel NUC, RPI4, RPI5). Not sure if this is a bug or an issue with these devices failing to correctly identify the name and/or BLE services of the device.

Has anyone had success with their Home Assistant installation automatically discovering any Wave Enhanced devices?

@berezovskyi-oleksandr
Copy link
Author

@LaStrada updated to the new custom integration version you just released. Now it shows battery levels other than 100%, but still doesn't match the mobile app. Mobile app reports 89% and 95% in Home Assistant

Regarding auto discovery, worked well with Home Assistant Yellow and ESPHome Bluetooth Proxy. It detected both of my units and added it

@berezovskyi-oleksandr
Copy link
Author

@LaStrada The integration has been working flawlessly for me since its implementation - great job!

Do you have any updates or plans regarding the merging of this PR and its potential integration into the Home Assistant upstream repository?

@LaStrada
Copy link
Member

Will make a release this weekend / early next week, and then open a PR to add it into HA. It should hopefully be part of the February release, unless there are any issues 🤞

@LaStrada
Copy link
Member

@LaStrada updated to the new custom integration version you just released. Now it shows battery levels other than 100%, but still doesn't match the mobile app. Mobile app reports 89% and 95% in Home Assistant

I see the same. Most of my devices have around 30% battery, and they're reporting 2-10% higher in HA.

Battery is always hard to get 100% the same as from the app. The reason for this is that we have way more code in the cloud to calculate this, so we have tried to make it as simple as possible for now, and this works for all other generations. I will look into this after this has been released and included in HA!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants