Closed tiagofreire-pt closed 2 years ago
Thanks for creating this issue, I bought two of them last week when there was a big sale. However, I am not able to connect wave or wave_mini using EP32. Kindly help add support to these devices too.
Wave-mini, don't allow me to save and install not sure if there is any mistake in the spell of the example and the actual class please check.
I’m having similar issues with my original wave device too. It looks like there are different repositories for each of the different models (for integration with raspberry pi) https://github.com/airthings
There were two versions of the wave devices there seem to be some changes in the data structure according to the own Airthings sample code https://github.com/Airthings/wave-reader I own one of each, tested both as a airthings_wave_plus and didn't worked
tagging @jeromelaban because https://github.com/esphome/esphome/pull/1656
Any ideas of how to get Airthings Wave Gen 1 supported?
These UUIDs that are known to work from https://github.com/sabeechen/AirthingsMQTT
serviceUUID: b42e1f6e-ade7-11e4-89d3-123b93f75cba
charUUID: b42e01aa-ade7-11e4-89d3-123b93f75cba
radon24UUID: b42e01aa-ade7-11e4-89d3-123b93f75cba
radonLongTermUUID: b42e0a4c-ade7-11e4-89d3-123b93f75cba
datetimeUUID: ((uint32_t)0x2A08)
temperatureUUID: ((uint32_t)0x2A6E)
humidityUUID: ((uint32_t)0x2A6F)
Edit: based on Airthings/wave-reader
Very similar to Wave Plus: struct.unpack("<4B8H", rawdata)
serviceUUID: b42e1f6e-ade7-11e4-89d3-123b93f75cba
charUUID: b42e4dcc-ade7-11e4-89d3-123b93f75cba
For gen 1 wave one can just create custom BLE client sensor:
esp32_ble_tracker:
ble_client:
- mac_address: AA:BB:CC:DD:EE:00
id: airthings01
sensor:
- platform: ble_client
ble_client_id: airthings01
name: "Radon Sensor: radon"
service_uuid: 'b42e1f6e-ade7-11e4-89d3-123b93f75cba'
characteristic_uuid: 'b42e01aa-ade7-11e4-89d3-123b93f75cba'
icon: 'mdi:radioactive'
unit_of_measurement: 'pCi/L'
accuracy_decimals: 2
lambda: |-
return *((uint16_t*)(&x[0]))/37.0f;
- platform: ble_client
ble_client_id: airthings01
name: "Radon Sensor: radon long term"
service_uuid: 'b42e1f6e-ade7-11e4-89d3-123b93f75cba'
characteristic_uuid: 'b42e0a4c-ade7-11e4-89d3-123b93f75cba'
icon: 'mdi:radioactive'
unit_of_measurement: 'pCi/L'
accuracy_decimals: 2
lambda: |-
return *((uint16_t*)(&x[0]))/37.0f;
- platform: ble_client
ble_client_id: airthings01
name: "Radon Sensor: temperature"
service_uuid: 'b42e1f6e-ade7-11e4-89d3-123b93f75cba'
characteristic_uuid: 2A6E
unit_of_measurement: '°C'
device_class: "temperature"
accuracy_decimals: 1
lambda: |-
return *((uint16_t*)(&x[0]))/100.0f;
- platform: ble_client
ble_client_id: airthings01
name: "Radon Sensor: humidity"
service_uuid: 'b42e1f6e-ade7-11e4-89d3-123b93f75cba'
characteristic_uuid: 2A6F
unit_of_measurement: '%'
device_class: "humidity"
accuracy_decimals: 1
lambda: |-
return *((uint16_t*)(&x[0]))/100.0f;
@debsahu Thanks a lot for the tip,
I tried it with my wave 1 and it kinda work, but it shows unknown most of the time, I guess that the device only sends data when there is a change on the value or sort of that. Anyway in HA the values are shown as unknown most of the time, I think that showing the latest reading would make it mostly usable. My biggest concern is that I'm used to Bq/m3 readings instead of pci/L, but I guess that some magic in the lambda part would make the deal.
In my wave 2 (the one with battery indicator) the structure and the uuid are not the same and it doesn't work, I could paste my log output if it can help.
I am trying to get my airthings wave gen 2 to work with ESPHOME. I tried with the airthingsplus code and the device is detected but then nothing more happens. Sensors are created but always "unknown". Tried above custom BLE code but get this:
[W][ble_sensor:119]: [Radon Sensor: radon long term] Cannot poll, not connected
[W][ble_sensor:119]: [Radon Sensor: radon] Cannot poll, not connected
[W][ble_sensor:119]: [Radon Sensor: temperature] Cannot poll, not connected
Now got
D][ble_client:047]: Found device at MAC address [F4:60:77:74:BA:D1]
[I][ble_client:085]: Attempting BLE connection to f4:60:77:74:ba:d1
[I][ble_sensor:033]: [Radon Sensor: radon] Connected successfully!
[I][ble_sensor:033]: [Radon Sensor: radon long term] Connected successfully!
[I][ble_sensor:033]: [Radon Sensor: temperature] Connected successfully!
[I][ble_sensor:033]: [Radon Sensor: humidity] Connected successfully!
[I][ble_client:161]: Service UUID: 0x1800
[I][ble_client:162]: start_handle: 0x1 end_handle: 0x9
[I][ble_client:341]: characteristic 0x2A00, handle 0x3, properties 0x2
[I][ble_client:341]: characteristic 0x2A01, handle 0x5, properties 0x2
[I][ble_client:341]: characteristic 0x2A04, handle 0x7, properties 0x2
[I][ble_client:341]: characteristic 0x2AC9, handle 0x9, properties 0x2
[I][ble_client:161]: Service UUID: 0x1801
[I][ble_client:162]: start_handle: 0xa end_handle: 0xa
[I][ble_client:161]: Service UUID: B42E4A8E-ADE7-11E4-89D3-123B93F75CBA
[I][ble_client:162]: start_handle: 0xb end_handle: 0x16
[I][ble_client:341]: characteristic B42E4DCC-ADE7-11E4-89D3-123B93F75CBA, handle 0xd, properties 0x2
[I][ble_client:341]: characteristic B42E50D8-ADE7-11E4-89D3-123B93F75CBA, handle 0x10, properties 0x2c
[I][ble_client:341]: characteristic B42E538A-ADE7-11E4-89D3-123B93F75CBA, handle 0x14, properties 0x10
[I][ble_client:161]: Service UUID: F000FFC0-0451-4000-B000-000000000000
[I][ble_client:162]: start_handle: 0x17 end_handle: 0x23
[I][ble_client:341]: characteristic F000FFC1-0451-4000-B000-000000000000, handle 0x19, properties 0x1c
[I][ble_client:341]: characteristic F000FFC2-0451-4000-B000-000000000000, handle 0x1d, properties 0x1c
[I][ble_client:341]: characteristic F000FFC5-0451-4000-B000-000000000000, handle 0x21, properties 0x14
[I][ble_client:161]: Service UUID: 0x180A
[I][ble_client:162]: start_handle: 0x24 end_handle: 0xffff
[I][ble_client:341]: characteristic 0x2A23, handle 0x26, properties 0x2
[I][ble_client:341]: characteristic 0x2A24, handle 0x28, properties 0x2
[I][ble_client:341]: characteristic 0x2A25, handle 0x2a, properties 0x2
[I][ble_client:341]: characteristic 0x2A26, handle 0x2c, properties 0x2
[I][ble_client:341]: characteristic 0x2A27, handle 0x2e, properties 0x2
[I][ble_client:341]: characteristic 0x2A29, handle 0x30, properties 0x2
[D][sensor:113]: 'Radon Sensor: radon': Sending state nan pCi/L with 2 decimals of accuracy
[W][ble_sensor:051]: No sensor characteristic found at service B42E1F6E-ADE7-11E4-89D3-123B93F75CBA char B42E01AA-ADE7-11E4-89D3-123B93F75CBA
[D][sensor:113]: 'Radon Sensor: radon long term': Sending state nan pCi/L with 2 decimals of accuracy
[W][ble_sensor:051]: No sensor characteristic found at service B42E1F6E-ADE7-11E4-89D3-123B93F75CBA char B42E0A4C-ADE7-11E4-89D3-123B93F75CBA
[D][sensor:113]: 'Radon Sensor: temperature': Sending state nan °C with 1 decimals of accuracy
[W][ble_sensor:051]: No sensor characteristic found at service B42E1F6E-ADE7-11E4-89D3-123B93F75CBA char 0x2A6E
[D][sensor:113]: 'Radon Sensor: humidity': Sending state nan % with 1 decimals of accuracy
[W][ble_sensor:051]: No sensor characteristic found at service B42E1F6E-ADE7-11E4-89D3-123B93F75CBA char 0x2A6F
I'll add another req for wave gen 1 support. Wave pro is expensive for radon only needs and mini is a simple device. Why support pro and mini but not the original device?
I think that many of us have bought the cheaper Wave, just to be able to measure the radon levels. Would be very nice to be able to pull data from it, and have support via ESPHome :-) And unfortunately my programming skills are not good enough to make pull request and do it myself.
I also want to support the idea of ESPHome to support the Airthings Wave (not plus). That would be nice.
Same for Airthings Wave (not plus) v2.
Maybe possible to re-use code from this HA custom component.
I actually did my own custom component based on the esphome wave plus code (copy/pasted the code) and changed the uuid's to this
static const char *const SERVICE_UUID = "b42e4a8e-ade7-11e4-89d3-123b93f75cba";
static const char *const CHARACTERISTIC_UUID = "b42e4dcc-ade7-11e4-89d3-123b93f75cba";
And then just ignore the things that the non-plus version do not support like CO2 level.
I actually did my own custom component based on the esphome wave plus code (copy/pasted the code) and changed the uuid's to this
static const char *const SERVICE_UUID = "b42e4a8e-ade7-11e4-89d3-123b93f75cba";
static const char *const CHARACTERISTIC_UUID = "b42e4dcc-ade7-11e4-89d3-123b93f75cba";
And then just ignore the things that the non-plus version do not support like CO2 level.
Are you able/willing to provide a little more detail about how you did this for those of us that are just learning some of the nuances of home automation?
Thanks for you contribution and time.
Sorry for the idiot level question.
I actually did my own custom component based on the esphome wave plus code (copy/pasted the code) and changed the uuid's to this
static const char *const SERVICE_UUID = "b42e4a8e-ade7-11e4-89d3-123b93f75cba";
static const char *const CHARACTERISTIC_UUID = "b42e4dcc-ade7-11e4-89d3-123b93f75cba";
And then just ignore the things that the non-plus version do not support like CO2 level.
This makes me think it would be simple for someone, who knows what they are doing, to fix the official ESPHome integration with an additional Wave non-plus type.
I actually did my own custom component based on the esphome wave plus code (copy/pasted the code) and changed the uuid's to this
static const char *const SERVICE_UUID = "b42e4a8e-ade7-11e4-89d3-123b93f75cba";
static const char *const CHARACTERISTIC_UUID = "b42e4dcc-ade7-11e4-89d3-123b93f75cba";
And then just ignore the things that the non-plus version do not support like CO2 level.This makes me think it would be simple for someone, who knows what they are doing, to fix the official ESPHome integration with an additional Wave non-plus type.
In addition, Airthings has provided Python code for the Wave here
Are you able/willing to provide a little more detail about how you did this for those of us that are just learning some of the nuances of home automation?
So I do not have any development environment and wanted to use the easyness of ESPHome addon in HA to compile and deploy OTA.
I copied the emitted code from having aithings_wave_plus specified in the yaml-file. It was placed here
esphome/.esphome/build/temperaturer/src/esphome/components/airthings_wave_plus
I copied that folder and renamed it to some name, e.g. aithings_wave_plus_xx:
esphome/custom_components/airthings_wave_plus_xx
Make sure to also rename all names of files from airthings_wave_plus to airthings_wave_plus_xx. This includes namespace and TAG
Then I replaced the UUIDs as specified in the .h file with the ones I mentioned.
When this is done you should be able to change your yaml-file to include the reference to your own new custom component:
- platform: airthings_wave_plus_xx
ble_client_id: airthings01
...
Was someone able to get this to work?
Was someone able to get this to work?
Not me. I looked in the docs and there is still no plain Wave option, just there Wave Plus and Mini ones. I've been curious why the issue was closed when it wasn't actually resolved, especially since it seems too be an easy fix for someone who knows what they are doing.
I tried the alternative offered but was unable to get it to work. Did anyone have any luck with the custom component?
Not me. I looked in the docs and there is still no plain Wave option, just there Wave Plus and Mini ones. I've been curious why the issue was closed when it wasn't actually resolved, especially since it seems too be an easy fix for someone who knows what they are doing.
I agree. Fair enough that it was tagged with 'alternative-offered', but it is not resolved and I think the alternative is quite a laborious one.
Well, I tried the alternative and I was not able to get it to work. I will make another attempt this week and will post my work here. Just curious if someone got the alternative working
Describe the problem you have/What new integration you would like Add support for the simple Wave device, gen 1.
Please describe your use case for this integration and alternatives you've tried: This is another Radon measuring device, much simpler and cheaper. Only measures temperature, humidity, instantaneous radon decay, long term radon decay.
Additional context
100% Working implementation with ESP32: BLEUUID: https://github.com/tiagofreire-pt/AirthingsMQTT/blob/master/AirthingsMQTTBridge.ino#L84 References: https://github.com/tiagofreire-pt/AirthingsMQTT/blob/master/AirthingsMQTTBridge.ino#L114
ESPHome: Logs
Config: