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
Support for the AirThings Wave Plus #1656
Conversation
Hey there @esphome/core, mind taking a look at this pull request as its been labeled with an integration ( |
466ec49
to
53a838a
Compare
e9eb5e2
to
c7cee59
Compare
The code is looking better with some formatting applied, though the clang linter does not know how to find the "BLEDevice.h" header file, and requests changes that cannot be made ( Is there a way to hint the linter to find this arduino file ? |
dc94b2d
to
716e197
Compare
Could the BLE client part of this be managed by #1177 ? |
@buxtronix it may end up being the base for the BLE Client, yes, but for now the integration in this PR is built around not keeping the BLE connection alive on purpose, so that the AirThings mobile app continues to work (I'll update the PR to mention that in the code and docs as well). I'm not sure if #1177 supports this mode yet. |
Yep, #1177 supports enabling and disabling individual client connections. |
Got it, it's up to the sensor to enable/disable itself and wait for the connect event to get the attribute value. I don't follow all the pieces of that new API completely, but as long as there's a way to read an attribute raw value, it should be good. |
716e197
to
a4d5682
Compare
This change delegates BLE managenement to BLEClientNode and BLEClient, instead of the integration initializating BLE itself.
16554bf
to
fbf1933
Compare
esphome/const.py
Outdated
@@ -834,6 +838,7 @@ | |||
DEVICE_CLASS_TEMPERATURE = "temperature" | |||
DEVICE_CLASS_POWER_FACTOR = "power_factor" | |||
DEVICE_CLASS_PRESSURE = "pressure" | |||
DEVICE_CLASS_RADON = "radon" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Device classes have to exist in Home Assistant before they can be added to ESPHome.
If it does not exists in HA, then DEVICE_CLASS_NONE
should be used, or it should be left out of the named args of sensor_schema()
(Like I modified)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've removed class, that's good to know! That being said, I've been using it in home assistant with this for a while, and I have not noticed any warning or error message related to this. What are the consequences ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no consequences, but we don't want to introduce classes that do not exist in HA. You are able to request the class be added in HA (not sure of the process, perhaps see a past PR that does this)
b889baa
to
961386e
Compare
will this be released soon? |
Hi, esp32_ble_tracker: I get an error for the row airthings_wave_plus: |
@Srki82 Please look at the example carefully https://next.esphome.io/components/sensor/airthings_ble.html#device-discovery The discovery YAML key is not |
@jesserockz thanks! I followed the instructions and I managed to find the MAC adress and then I got the sensors inside Home Assistant. The only issue now is that all sensors shows the state "unknown". |
If all the states are unknown, this means there's a communication failure somewhere. I'd say this PR is not the right place to discuss this, and a new issue would be more interesting to provide additional information. Can you open a new one with debugging information from the ESP? |
What does this implement/fix?
Adds support for the AirThings Wave Plus BLE device.
Types of changes
Related issue or feature (if applicable): fixes esphome/feature-requests#147
Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#1081
Test Environment
Example entry for
config.yaml
:BLE Scanner to find the device's MAC:
Sensors:
Explain your changes
This PR is adding a AirThings device scanner, to find the BLE MAC address of the device, then a set of sensors provided by the device, polled every 5 minutes.
This PR adds a class, unit and icon related to radon measurement.
This is a new repository for me, so I'm pretty sure the esphome wizards will find things to say about it and how to make this PR better.
Tests and documentation are coming.
Checklist:
tests/
folder).If user exposed functionality or configuration variables are added/changed: