Giter Club home page Giter Club logo

sensor.airthings_wave's Introduction

sensor.airthings_wave

Great news! This HACS component is now deprecated and retired and has been replaced by the official Airthings BLE integration

Please remove this integration and use the official one in its place

A big thank you to everyone who have helped support this integration, and a thank you to @vincegio for porting it into the official Home Assistant repository.


hassio support for Airthings Wave, Airthings Wave Plus, and Airthings Wave Mini BLE environmental sensors.

This component is cloudless and accomplishes this by communicating over bluetooth instead of using Airthings' cloud API.

ScreenShot

Much of the code to build this component was inspired by these projects:

The aforementioned radonwave project is especially useful as it describes many of the BLE characteristics specific to this product and has good trouble-shooting tips. The script provided is also very useful in determining the MAC address of your AW device. See here: marcelm/radonwave#3

Getting started

Download

/custom_components/airthings_wave/

into

<config directory>/custom_components/airthings_wave/

Example configuration.yaml:

# Example configuration.yaml entry
sensor:
  - platform: airthings_wave
    scan_interval: 120
    elevation: 998
    voltage_100: 3.2
    voltage_0: 2.2

Optional Configuration Variables

mac

(string)(Optional) The airthings_wave mac address, if not provided will scan for all airthings devices at startup

scan_interval

(string)(Optional) The interval between polls. Defaults to 300 seconds (5 minutes)

elevation

(float)(Optional) The current elevation in meters. Used to correct the pressure sensor to sea level conditions.

voltage_100

(float)(Optional) The voltage for 100% battery, calculated linearly between voltage_0 and voltage_100 (on supported device), default is 3.2

voltage_0

(float)(Optional) The voltage for 0% battery, calculated linearly between voltage_0 and voltage_100 (on supported device), default is 2.2

Limitations

Users has reported that it is possible to get data without first registering with the official app, so it should be possible to use the sensor with this integration without registering.

The radon level history stored on the Wave itself cannot be accessed with this component. To get around this, it connects regularly to the radon detector.

It might be beneficial to install the latest firmware on the device using the official app first.

Battery level only works for the Airthings wave pluss device.

Known Issues

  • Not yet able to specify the monitored_conditions configuration

  • No translations available yet

Hardware Requirements

Other Resources

sensor.airthings_wave's People

Contributors

altaic avatar b1ob avatar dingusdk avatar kressir avatar lymanepp avatar martytremblay avatar rsnodgrass avatar sverrham avatar tomtorger 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sensor.airthings_wave's Issues

Component sensor returns metric values only

As it stands, the component returns values in Bq/m3 anc C units but should also support pCi/L and F units.

Ultimately should default to hassio's configuration with the option of being overridden within the component's sensor config

Need Version info in Manifest

No 'version' key in the manifest file for custom integration 'airthings'. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintainer of 'airthings'

Failed initial setup

Hi,

I copied the folder to /homeassistant/custom_components/airthings_wave, edited the configurations.yaml as instructed, but got this Error in logs:

Failed intial setup.

Traceback (most recent call last):
File "/config/custom_components/airthings_wave/sensor.py", line 178, in setup_platform
num_devices_found = airthingsdetect.find_devices()
File "/config/custom_components/airthings_wave/airthings.py", line 164, in find_devices
advertisements = scanner.scan(timeout)
File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 852, in scan
self.start(passive=passive)
File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 790, in start
self._mgmtCmd("le on")
File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 312, in _mgmtCmd
raise BTLEManagementError("Failed to execute management command '%s'" % (cmd), rsp)
bluepy.btle.BTLEManagementError: Failed to execute management command 'le on' (code: 20, error: Permission Denied)

Could you tell me whether I have done anything wrong?

Thanks!

Failure to connect with HassOs + Airthings Wave Plus

Raspberry Pi4 running HassOS latest
Airthings Wave Plus sensor firmware updated + registered to cloud service
Git clone 1.4.2020 of Airthings sensor

After configuration in Hassio, no sensors are visible.
If MAC address is not declared in configuration.yaml, sensor is not found message is brought. In logs, it attempts to connect to 4 other Bluetooth devices but none with Airthings Wave Plus MAC address.
When MAC address is declared in configuration.yaml following errors arise:

Logger: custom_components.airthings_wave.airthings
Source: custom_components/airthings_wave/airthings.py:165
First occurred: 9.34.07 (4 occurrences)
Last logged: 9.34.11

Traceback (most recent call last):
File "/config/custom_components/airthings_wave/airthings.py", line 165, in get_info
data = dev.char_read(characteristic.uuid)
File "/usr/local/lib/python3.7/site-packages/pygatt/backends/gatttool/device.py", line 17, in wrapper
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pygatt/backends/gatttool/device.py", line 40, in char_read
return self._backend.char_read(self, uuid, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pygatt/backends/gatttool/gatttool.py", line 50, in wrapper
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pygatt/backends/gatttool/gatttool.py", line 593, in char_read
self.sendline('char-read-uuid %s' % uuid)
File "/usr/local/lib/python3.7/contextlib.py", line 119, in exit
next(self.gen)
File "/usr/local/lib/python3.7/site-packages/pygatt/backends/gatttool/gatttool.py", line 191, in event
self.wait(event, timeout)
File "/usr/local/lib/python3.7/site-packages/pygatt/backends/gatttool/gatttool.py", line 157, in wait
raise NotificationTimeout()
pygatt.exceptions.NotificationTimeout: None

Setup of sensor platform airthings_wave is taking over 10 seconds.

Logger: custom_components.airthings_wave.airthings
Source: custom_components/airthings_wave/airthings.py:183
First occurred: 9.41.26 (1 occurrences)
Last logged: 9.41.26
Failed to discover sensors

Traceback (most recent call last):
File "/config/custom_components/airthings_wave/airthings.py", line 183, in get_sensors
characteristics = dev.discover_characteristics()
File "/usr/local/lib/python3.7/site-packages/pygatt/backends/gatttool/device.py", line 17, in wrapper
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pygatt/backends/gatttool/device.py", line 58, in discover_characteristics
self, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pygatt/backends/gatttool/gatttool.py", line 50, in wrapper
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pygatt/backends/gatttool/gatttool.py", line 531, in discover_characteristics
raise NotConnectedError("Characteristic discovery failed")
pygatt.exceptions.NotConnectedError: Characteristic discovery failed

Platform not found: sensor.airthings_wave

Home Assistant 0.96.2

Airthings Wave: aeabf69

root@ubuntu:/usr/share/hassio/homeassistant/custom_components/airthings_wave# hass --script check_config -c  /usr/share/hassio/homeassistant/
Testing configuration at /usr/share/hassio/homeassistant/
Failed config
  General Errors:
    - Platform not found: sensor.airthings_wave

Successful config (partial)

This is after numerous restarts. Any idea what I am doing wrong ?

Not showing up on the Dashboard

I find Airthings value in Developer Tools/States however nothing is showing up on the Overview.

Also I get this error:

Radon level is : got an exception: could not convert string to float: 'unknown'

Only finding 1 WavePlus

Seems like i can only see 1 of my waveplus devices even though manual testing of AT's python script works from pi console. Does this support multiples? Wasn't sure how to format multiple MACs in the optional arguments yaml. TIA

Airthings Wave Plus - Radon data not populating

Hello,

Just added this component this morning and connected without issue.

Radon data is not populating. I can see it is collecting the 1day_avg and longterm_avg but there is no entity/sensor that the data is going to.

Log:

2020-04-15 11:35:02 DEBUG (SyncWorker_10) [custom_components.airthings_wave.airthings] XX:XX:XX:XX:XX:XX Got sensordata {'date_time': '2020-04-15T11:35:02.601644', 'humidity': 38.0, 'radon_1day_avg': 34, 'radon_longterm_avg': 51, 'temperature': 17.18, 'rel_atm_pressure': 1001.12, 'co2': 466.0, 'voc': 411.0}
2020-04-15 11:35:02 INFO (SyncWorker_10) [pygatt.backends.gatttool.gatttool] Stopping
2020-04-15 11:35:02 INFO (Thread-28) [pygatt.backends.gatttool.gatttool] Listener thread finished
2020-04-15 11:35:02 DEBUG (SyncWorker_10) [custom_components.airthings_wave.sensor] State XX:XX:XX:XX:XX:XX-date_time 2020-04-15T11:35:02.601644
2020-04-15 11:35:02 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.xx_xx_xx_xx_xx_xx_date_time, old_state=<state sensor.xx_xx_xx_xx_xx_xx_date_time=2020-04-15T11:33:01.603828; device_date_time=2020-04-15T11:33:01.603828, unit_of_measurement=time, friendly_name=XX:XX:XX:XX:XX:XX-date_time @ 2020-04-15T11:33:01.966644-04:00>, new_state=<state sensor.xx_xx_xx_xx_xx_xx_date_time=2020-04-15T11:35:02.601644; device_date_time=2020-04-15T11:35:02.601644, unit_of_measurement=time, friendly_name=XX:XX:XX:XX:XX:XX-date_time @ 2020-04-15T11:35:02.965606-04:00>>
2020-04-15 11:35:02 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.1829668560] Sending {'id': 2, 'type': 'event', 'event': <Event state_changed[L]: entity_id=sensor.xx_xx_xx_xx_xx_xx_date_time, old_state=<state sensor.xx_xx_xx_xx_xx_xx_date_time=2020-04-15T11:33:01.603828; device_date_time=2020-04-15T11:33:01.603828, unit_of_measurement=time, friendly_name=XX:XX:XX:XX:XX:XX-date_time @ 2020-04-15T11:33:01.966644-04:00>, new_state=<state sensor.xx_xx_xx_xx_xx_xx_date_time=2020-04-15T11:35:02.601644; device_date_time=2020-04-15T11:35:02.601644, unit_of_measurement=time, friendly_name=XX:XX:XX:XX:XX:XX-date_time @ 2020-04-15T11:35:02.965606-04:00>>}
2020-04-15 11:35:02 DEBUG (SyncWorker_9) [custom_components.airthings_wave.sensor] State XX:XX:XX:XX:XX:XX-humidity 38.0
2020-04-15 11:35:02 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.xx_xx_xx_xx_xx_xx_humidity, old_state=<state sensor.xx_xx_xx_xx_xx_xx_humidity=38.0; device_date_time=2020-04-15T11:33:01.603828, unit_of_measurement=%, friendly_name=XX:XX:XX:XX:XX:XX-humidity, device_class=humidity @ 2020-04-15T11:20:51.443701-04:00>, new_state=<state sensor.xx_xx_xx_xx_xx_xx_humidity=38.0; device_date_time=2020-04-15T11:35:02.601644, unit_of_measurement=%, friendly_name=XX:XX:XX:XX:XX:XX-humidity, device_class=humidity @ 2020-04-15T11:20:51.443701-04:00>>
2020-04-15 11:35:02 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.1829668560] Sending {'id': 2, 'type': 'event', 'event': <Event state_changed[L]: entity_id=sensor.xx_xx_xx_xx_xx_xx_humidity, old_state=<state sensor.xx_xx_xx_xx_xx_xx_humidity=38.0; device_date_time=2020-04-15T11:33:01.603828, unit_of_measurement=%, friendly_name=XX:XX:XX:XX:XX:XX-humidity, device_class=humidity @ 2020-04-15T11:20:51.443701-04:00>, new_state=<state sensor.xx_xx_xx_xx_xx_xx_humidity=38.0; device_date_time=2020-04-15T11:35:02.601644, unit_of_measurement=%, friendly_name=XX:XX:XX:XX:XX:XX-humidity, device_class=humidity @ 2020-04-15T11:20:51.443701-04:00>>}
2020-04-15 11:35:03 DEBUG (SyncWorker_7) [custom_components.airthings_wave.sensor] State XX:XX:XX:XX:XX:XX-temperature 17.18
2020-04-15 11:35:03 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.xx_xx_xx_xx_xx_xx_temperature, old_state=<state sensor.xx_xx_xx_xx_xx_xx_temperature=63.01; device_date_time=2020-04-15T11:33:01.603828, unit_of_measurement=°F, friendly_name=XX:XX:XX:XX:XX:XX-temperature, device_class=temperature @ 2020-04-15T11:31:01.517199-04:00>, new_state=<state sensor.xx_xx_xx_xx_xx_xx_temperature=62.92; device_date_time=2020-04-15T11:35:02.601644, unit_of_measurement=°F, friendly_name=XX:XX:XX:XX:XX:XX-temperature, device_class=temperature @ 2020-04-15T11:35:03.012796-04:00>>
2020-04-15 11:35:03 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.1829668560] Sending {'id': 2, 'type': 'event', 'event': <Event state_changed[L]: entity_id=sensor.xx_xx_xx_xx_xx_xx_temperature, old_state=<state sensor.xx_xx_xx_xx_xx_xx_temperature=63.01; device_date_time=2020-04-15T11:33:01.603828, unit_of_measurement=°F, friendly_name=XX:XX:XX:XX:XX:XX-temperature, device_class=temperature @ 2020-04-15T11:31:01.517199-04:00>, new_state=<state sensor.xx_xx_xx_xx_xx_xx_temperature=62.92; device_date_time=2020-04-15T11:35:02.601644, unit_of_measurement=°F, friendly_name=XX:XX:XX:XX:XX:XX-temperature, device_class=temperature @ 2020-04-15T11:35:03.012796-04:00>>}
2020-04-15 11:35:03 DEBUG (SyncWorker_12) [custom_components.airthings_wave.sensor] State XX:XX:XX:XX:XX:XX-rel_atm_pressure 1001.12
2020-04-15 11:35:03 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.xx_xx_xx_xx_xx_xx_rel_atm_pressure, old_state=<state sensor.xx_xx_xx_xx_xx_xx_rel_atm_pressure=1001.14; device_date_time=2020-04-15T11:33:01.603828, unit_of_measurement=mbar, friendly_name=XX:XX:XX:XX:XX:XX-rel_atm_pressure, device_class=pressure @ 2020-04-15T11:31:01.551107-04:00>, new_state=<state sensor.xx_xx_xx_xx_xx_xx_rel_atm_pressure=1001.12; device_date_time=2020-04-15T11:35:02.601644, unit_of_measurement=mbar, friendly_name=XX:XX:XX:XX:XX:XX-rel_atm_pressure, device_class=pressure @ 2020-04-15T11:35:03.030145-04:00>>
2020-04-15 11:35:03 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.1829668560] Sending {'id': 2, 'type': 'event', 'event': <Event state_changed[L]: entity_id=sensor.xx_xx_xx_xx_xx_xx_rel_atm_pressure, old_state=<state sensor.xx_xx_xx_xx_xx_xx_rel_atm_pressure=1001.14; device_date_time=2020-04-15T11:33:01.603828, unit_of_measurement=mbar, friendly_name=XX:XX:XX:XX:XX:XX-rel_atm_pressure, device_class=pressure @ 2020-04-15T11:31:01.551107-04:00>, new_state=<state sensor.xx_xx_xx_xx_xx_xx_rel_atm_pressure=1001.12; device_date_time=2020-04-15T11:35:02.601644, unit_of_measurement=mbar, friendly_name=XX:XX:XX:XX:XX:XX-rel_atm_pressure, device_class=pressure @ 2020-04-15T11:35:03.030145-04:00>>}
2020-04-15 11:35:03 DEBUG (SyncWorker_6) [custom_components.airthings_wave.sensor] State XX:XX:XX:XX:XX:XX-co2 466.0
2020-04-15 11:35:03 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.xx_xx_xx_xx_xx_xx_co2, old_state=<state sensor.xx_xx_xx_xx_xx_xx_co2=469.0; device_date_time=2020-04-15T11:33:01.603828, unit_of_measurement=ppm, friendly_name=XX:XX:XX:XX:XX:XX-co2, icon=mdi:periodic-table-co2, device_class=co2 @ 2020-04-15T11:31:01.588135-04:00>, new_state=<state sensor.xx_xx_xx_xx_xx_xx_co2=466.0; device_date_time=2020-04-15T11:35:02.601644, unit_of_measurement=ppm, friendly_name=XX:XX:XX:XX:XX:XX-co2, icon=mdi:periodic-table-co2, device_class=co2 @ 2020-04-15T11:35:03.061499-04:00>>
2020-04-15 11:35:03 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.1829668560] Sending {'id': 2, 'type': 'event', 'event': <Event state_changed[L]: entity_id=sensor.xx_xx_xx_xx_xx_xx_co2, old_state=<state sensor.xx_xx_xx_xx_xx_xx_co2=469.0; device_date_time=2020-04-15T11:33:01.603828, unit_of_measurement=ppm, friendly_name=XX:XX:XX:XX:XX:XX-co2, icon=mdi:periodic-table-co2, device_class=co2 @ 2020-04-15T11:31:01.588135-04:00>, new_state=<state sensor.xx_xx_xx_xx_xx_xx_co2=466.0; device_date_time=2020-04-15T11:35:02.601644, unit_of_measurement=ppm, friendly_name=XX:XX:XX:XX:XX:XX-co2, icon=mdi:periodic-table-co2, device_class=co2 @ 2020-04-15T11:35:03.061499-04:00>>}
2020-04-15 11:35:03 DEBUG (SyncWorker_19) [custom_components.airthings_wave.sensor] State XX:XX:XX:XX:XX:XX-voc 411.0
2020-04-15 11:35:03 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.xx_xx_xx_xx_xx_xx_voc, old_state=<state sensor.xx_xx_xx_xx_xx_xx_voc=421.0; device_date_time=2020-04-15T11:33:01.603828, unit_of_measurement=ppb, friendly_name=XX:XX:XX:XX:XX:XX-voc, icon=mdi:cloud, device_class=voc @ 2020-04-15T11:31:01.606367-04:00>, new_state=<state sensor.xx_xx_xx_xx_xx_xx_voc=411.0; device_date_time=2020-04-15T11:35:02.601644, unit_of_measurement=ppb, friendly_name=XX:XX:XX:XX:XX:XX-voc, icon=mdi:cloud, device_class=voc @ 2020-04-15T11:35:03.085583-04:00>>

Thank you!
-J

MAC Address issue

Hi,

It look like I have an issue with the MAC Address, and the YAML catch it like an interger...

Here is how the YAML (had to put a screenshot for the color):

devices:
  - mac: d8:**:**:**:**:20
    name: ****
refresh_interval: 150
retry_count: 10
retry_wait: 3
log_level: DEBUG
mqtt_discovery: 'true'

image

I've past several hours searching on google for this issue, but didn't find a method to pass it normally... I try simple and double quote, no success, each time the YAML comes back as show on the screenshot.

Hence here is my error message on Debug mode... Don't know if someone have a better understanding of my issue...

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[13:48:35] INFO: Getting mqtt configuration...
[13:48:35] INFO: Starting python script...
INFO:airthings-mqtt-ha:Setting up Airthings sensors...
DEBUG:airthings-mqtt-ha:Getting info about device(s)...
ERROR:airthings:Disconnected
Traceback (most recent call last):
  File "/src/airthings.py", line 228, in get_info
    char = self._dev.getCharacteristics(uuid=characteristic.uuid)[0]
  File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 508, in getCharacteristics
    rsp = self._getResp('find')
  File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 407, in _getResp
    resp = self._waitResp(wantType + ['ntfy', 'ind'], timeout)
  File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 362, in _waitResp
    raise BTLEDisconnectError("Device disconnected", resp)
bluepy.btle.BTLEDisconnectError: Device disconnected
WARNING:airthings-mqtt-ha:Unexpected exception while getting device information on attempt 1. Retrying in 3 seconds.

Thanks !

HACS integration?

Is there a way to install this through HACS so we can keep it updated?

Entity sensor implements device_state_attributes. Please report it to the custom component author.

After latest HA relase (2021.12) following warnings are shown in the system log (replaced the actual MAC address with XX's).

I believe it is linked to this:

property device_state_attributes
Return entity specific state attributes.
This method is deprecated, platform classes should implement extra_state_attributes instead.

Entity sensor.xx_xx_xx_xx_xx_xx_radon_longterm_avg (<class 'custom_components.airthings_wave.sensor.AirthingsSensor'>) implements device_state_attributes. Please report it to the custom component author.

Entity sensor.xx_temperature (<class 'custom_components.airthings_wave.sensor.AirthingsSensor'>) implements device_state_attributes. Please report it to the custom component author.

Entity sensor.xx_rel_atm_pressure (<class 'custom_components.airthings_wave.sensor.AirthingsSensor'>) implements device_state_attributes. Please report it to the custom component author.

Entity sensor.xx_co2 (<class 'custom_components.airthings_wave.sensor.AirthingsSensor'>) implements device_state_attributes. Please report it to the custom component author.

Entity sensor.xx_voc (<class 'custom_components.airthings_wave.sensor.AirthingsSensor'>) implements device_state_attributes. Please report it to the custom component author

New release

@MartyTremblay it seems I cant push directly to this repo, wanted to update version and make a new release but don't know how, if you give me some guidance I can probably do it.

Sensor is not created in Home Assistant

Hi

I`m running HA on NUC with Mint Linux and HA in Docker.

In Mint I was able to obtain MAC of the Airthings wave and run env/bin/python3 radonwave.py ADDRESS and it worked in command line.

In HA I get this error

Log Details (ERROR)
Logger: custom_components.airthings_wave.airthings
Source: custom_components/airthings_wave/airthings.py:191
Integration: airthings_wave (documentation)
First occurred: 11:53:52 PM (1 occurrences)
Last logged: 11:53:52 PM

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 415, in connect
self.sendline(cmd)
File "/usr/local/lib/python3.8/contextlib.py", line 120, in exit
next(self.gen)
File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 191, in event
self.wait(event, timeout)
File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 157, in wait
raise NotificationTimeout()
pygatt.exceptions.NotificationTimeout: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/config/custom_components/airthings_wave/airthings.py", line 191, in get_info
dev = self.adapter.connect(mac, 3)
File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 421, in connect
raise NotConnectedError(message)
pygatt.exceptions.NotConnectedError: Timed out connecting to 00:81:F9:77:82:D3 after 3 seconds.

reading from command line
image

v7.0

Hey since I got upgraded to HA 7.0 your plugin doesn't work. Do you think you will be resolving the issue?

Get battery status? (feature)

Hi - thanks so much for making this!

Do you have any plans to report on the battery status? It's something you can view in the official app. It would be nice to be able to see when the batteries are low and send a notification.

Update resolution seems to be too slow

Looking at the history graphs, it seems unlikely that the data changes at the slow rate that it does, especially when comparing it with the mobile app.

Failed initial setup

Trying to get my airthings working. Previous updates did not resolve my issue but found this in my log today.

Logger: custom_components.airthings_wave.sensor
Source: custom_components/airthings_wave/airthings.py:156
Integration: airthings_wave (documentation)
First occurred: 1:54:21 PM (1 occurrences)
Last logged: 1:54:21 PM

Failed intial setup.
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pexpect/spawnbase.py", line 166, in read_nonblocking
    s = os.read(self.child_fd, size)
OSError: [Errno 5] I/O error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pexpect/expect.py", line 111, in expect_loop
    incoming = spawn.read_nonblocking(spawn.maxread, timeout)
  File "/usr/local/lib/python3.8/site-packages/pexpect/pty_spawn.py", line 485, in read_nonblocking
    return super(spawn, self).read_nonblocking(size)
  File "/usr/local/lib/python3.8/site-packages/pexpect/spawnbase.py", line 171, in read_nonblocking
    raise EOF('End Of File (EOF). Exception style platform.')
pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 342, in scan
    scan.expect('foooooo', timeout=timeout)
  File "/usr/local/lib/python3.8/site-packages/pexpect/spawnbase.py", line 340, in expect
    return self.expect_list(compiled_pattern_list,
  File "/usr/local/lib/python3.8/site-packages/pexpect/spawnbase.py", line 369, in expect_list
    return exp.expect_loop(timeout)
  File "/usr/local/lib/python3.8/site-packages/pexpect/expect.py", line 117, in expect_loop
    return self.eof(e)
  File "/usr/local/lib/python3.8/site-packages/pexpect/expect.py", line 63, in eof
    raise EOF(msg)
pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
<pexpect.pty_spawn.spawn object at 0x7f89c9adc0>
command: /usr/bin/hcitool
args: ['/usr/bin/hcitool', '-i', 'hci0', 'lescan']
buffer (last 100 chars): b''
before (last 100 chars): b'Set scan parameters failed: I/O error\r\n'
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: 1
flag_eof: True
pid: 257
child_fd: 49
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
    0: re.compile(b'foooooo')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/airthings_wave/sensor.py", line 178, in setup_platform
    num_devices_found = airthingsdetect.find_devices()
  File "/config/custom_components/airthings_wave/airthings.py", line 156, in find_devices
    devices = self.adapter.scan(timeout=3)
  File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 353, in scan
    raise BLEError(message)
pygatt.exceptions.BLEError: Unexpected error when scanning: Set scan parameters failed: I/O error

Component stopped working on 2021.12.8-ish

Hi!

On HA 2021.12.8 your otherwise nice component seem to not be working (at least on my environment).

I am on a default Rpi4 supervised install.

Bluetooth BLE still works on other custom components.

No changes has been done on the install or config files before it suddenly stopped working.

I get these three errors in the log:


Logger: custom_components.airthings_wave.airthings
Source: custom_components/airthings_wave/airthings.py:203
Integration: airthings_wave (documentation, issues)
First occurred: 24. januar 2022, 14:39:22 (1 occurrences)
Last logged: 24. januar 2022, 14:39:22
Disconnected

Traceback (most recent call last):
  File "/config/custom_components/airthings_wave/airthings.py", line 203, in get_info
    char = self._dev.getCharacteristics(uuid=characteristic.uuid)[0]
  File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 508, in getCharacteristics
    rsp = self._getResp('find')
  File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 407, in _getResp
    resp = self._waitResp(wantType + ['ntfy', 'ind'], timeout)
  File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 362, in _waitResp
    raise BTLEDisconnectError("Device disconnected", resp)
bluepy.btle.BTLEDisconnectError: Device disconnected


Logger: custom_components.airthings_wave.sensor
Source: custom_components/airthings_wave/airthings.py:203
Integration: airthings_wave (documentation, issues)
First occurred: 24. januar 2022, 14:39:22 (1 occurrences)
Last logged: 24. januar 2022, 14:39:22
Failed intial setup.

Traceback (most recent call last):
  File "/config/custom_components/airthings_wave/sensor.py", line 191, in setup_platform
    devices_info = airthingsdetect.get_info()
  File "/config/custom_components/airthings_wave/airthings.py", line 203, in get_info
    char = self._dev.getCharacteristics(uuid=characteristic.uuid)[0]
AttributeError: 'NoneType' object has no attribute 'getCharacteristics'



Logger: custom_components.airthings_wave.sensor
Source: custom_components/airthings_wave/airthings.py:204
Integration: airthings_wave (documentation, issues)
First occurred: 24. januar 2022, 14:39:28 (3 occurrences)
Last logged: 24. januar 2022, 14:39:29
Failed intial setup.

Traceback (most recent call last):
  File "/config/custom_components/airthings_wave/sensor.py", line 191, in setup_platform
    devices_info = airthingsdetect.get_info()
  File "/config/custom_components/airthings_wave/airthings.py", line 204, in get_info
    data = char.read()
  File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 197, in read
    return self.peripheral.readCharacteristic(self.valHandle)
  File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 530, in readCharacteristic
    resp = self._getResp('rd')
  File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 407, in _getResp
    resp = self._waitResp(wantType + ['ntfy', 'ind'], timeout)
  File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 370, in _waitResp
    raise BTLEException("Error from bluepy-helper (%s)" % errcode, resp)
bluepy.btle.BTLEException: Error from bluepy-helper (badstate)

Airthings Plus with Raspberry Pi 4 initial setup failure

Initial Setup failing, despite BLE sensor working with MiFlora component.

Log:
2020-09-15 14:55:39 ERROR (SyncWorker_0) [custom_components.airthings_wave.sensor] Failed intial setup.
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pexpect/spawnbase.py", line 166, in read_nonblocking
s = os.read(self.child_fd, size)
OSError: [Errno 5] I/O error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pexpect/expect.py", line 111, in expect_loop
incoming = spawn.read_nonblocking(spawn.maxread, timeout)
File "/usr/local/lib/python3.8/site-packages/pexpect/pty_spawn.py", line 485, in read_nonblocking
return super(spawn, self).read_nonblocking(size)
File "/usr/local/lib/python3.8/site-packages/pexpect/spawnbase.py", line 171, in read_nonblocking
raise EOF('End Of File (EOF). Exception style platform.')
pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 342, in scan
scan.expect('foooooo', timeout=timeout)
File "/usr/local/lib/python3.8/site-packages/pexpect/spawnbase.py", line 340, in expect
return self.expect_list(compiled_pattern_list,
File "/usr/local/lib/python3.8/site-packages/pexpect/spawnbase.py", line 369, in expect_list
return exp.expect_loop(timeout)
File "/usr/local/lib/python3.8/site-packages/pexpect/expect.py", line 117, in expect_loop
return self.eof(e)
File "/usr/local/lib/python3.8/site-packages/pexpect/expect.py", line 63, in eof
raise EOF(msg)
pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
<pexpect.pty_spawn.spawn object at 0xaef838e0>
command: /usr/bin/hcitool
args: ['/usr/bin/hcitool', '-i', 'hci0', 'lescan']
buffer (last 100 chars): b''
before (last 100 chars): b'Set scan parameters failed: I/O error\r\n'
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: 1
flag_eof: True
pid: 279
child_fd: 17
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
0: re.compile(b'foooooo')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/config/custom_components/airthings_wave/sensor.py", line 142, in setup_platform
num_devices_found = airthingsdetect.find_devices()
File "/config/custom_components/airthings_wave/airthings.py", line 156, in find_devices
devices = self.adapter.scan(timeout=3)
File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 353, in scan
raise BLEError(message)
pygatt.exceptions.BLEError: Unexpected error when scanning: Set scan parameters failed: I/O error

Impossible to restart server after having enabled airthings_wave

I have Home Assistant Core running in docker on a amd64 host based on OMV.
I have downloaded the air things integration through HACS and I've enabled it in the configuration. If I try to restart the server I get the following error:

Logger: homeassistant.util.package
Source: util/package.py:99
First occurred: 17:40:08 (6 occurrences)
Last logged: 17:41:58

Unable to install package bluepy==1.3.0: ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6uh5mhwt/bluepy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6uh5mhwt/bluepy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-m8jz5n97 cwd: /tmp/pip-install-6uh5mhwt/bluepy/ Complete output (8 lines): /usr/lib/python3.9/site-packages/setuptools/dist.py:697: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running bdist_wheel running build running build_py Working dir is /tmp/pip-install-6uh5mhwt/bluepy execute make -C ./bluepy clean error: [Errno 2] No such file or directory: 'make' ---------------------------------------- ERROR: Failed building wheel for bluepy DEPRECATION: Could not build wheels for bluepy which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368. ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6uh5mhwt/bluepy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6uh5mhwt/bluepy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-9vmai4si/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /config/.local/include/python3.9/bluepy cwd: /tmp/pip-install-6uh5mhwt/bluepy/ Complete output (8 lines): /usr/lib/python3.9/site-packages/setuptools/dist.py:697: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running install running build running build_py Working dir is /tmp/pip-install-6uh5mhwt/bluepy execute make -C ./bluepy clean error: [Errno 2] No such file or directory: 'make' ---------------------------------------- ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6uh5mhwt/bluepy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6uh5mhwt/bluepy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-9vmai4si/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /config/.local/include/python3.9/bluepy Check the logs for full command output. WARNING: You are using pip version 20.2; however, version 21.3.1 is available. You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
Unable to install package bluepy==1.3.0: ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-pvx94trb/bluepy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-pvx94trb/bluepy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-hn93r03d cwd: /tmp/pip-install-pvx94trb/bluepy/ Complete output (8 lines): /usr/lib/python3.9/site-packages/setuptools/dist.py:697: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running bdist_wheel running build running build_py Working dir is /tmp/pip-install-pvx94trb/bluepy execute make -C ./bluepy clean error: [Errno 2] No such file or directory: 'make' ---------------------------------------- ERROR: Failed building wheel for bluepy DEPRECATION: Could not build wheels for bluepy which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368. ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-pvx94trb/bluepy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-pvx94trb/bluepy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-no4vk6hj/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /config/.local/include/python3.9/bluepy cwd: /tmp/pip-install-pvx94trb/bluepy/ Complete output (8 lines): /usr/lib/python3.9/site-packages/setuptools/dist.py:697: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running install running build running build_py Working dir is /tmp/pip-install-pvx94trb/bluepy execute make -C ./bluepy clean error: [Errno 2] No such file or directory: 'make' ---------------------------------------- ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-pvx94trb/bluepy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-pvx94trb/bluepy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-no4vk6hj/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /config/.local/include/python3.9/bluepy Check the logs for full command output. WARNING: You are using pip version 20.2; however, version 21.3.1 is available. You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
Unable to install package bluepy==1.3.0: ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_w909mej/bluepy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_w909mej/bluepy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-azouudir cwd: /tmp/pip-install-_w909mej/bluepy/ Complete output (8 lines): /usr/lib/python3.9/site-packages/setuptools/dist.py:697: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running bdist_wheel running build running build_py Working dir is /tmp/pip-install-_w909mej/bluepy execute make -C ./bluepy clean error: [Errno 2] No such file or directory: 'make' ---------------------------------------- ERROR: Failed building wheel for bluepy DEPRECATION: Could not build wheels for bluepy which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368. ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_w909mej/bluepy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_w909mej/bluepy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-2xx7tzyw/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /config/.local/include/python3.9/bluepy cwd: /tmp/pip-install-_w909mej/bluepy/ Complete output (8 lines): /usr/lib/python3.9/site-packages/setuptools/dist.py:697: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running install running build running build_py Working dir is /tmp/pip-install-_w909mej/bluepy execute make -C ./bluepy clean error: [Errno 2] No such file or directory: 'make' ---------------------------------------- ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_w909mej/bluepy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_w909mej/bluepy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-2xx7tzyw/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /config/.local/include/python3.9/bluepy Check the logs for full command output. WARNING: You are using pip version 20.2; however, version 21.3.1 is available. You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
Unable to install package bluepy==1.3.0: ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-95b99lfu/bluepy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-95b99lfu/bluepy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-slhbnoue cwd: /tmp/pip-install-95b99lfu/bluepy/ Complete output (8 lines): /usr/lib/python3.9/site-packages/setuptools/dist.py:697: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running bdist_wheel running build running build_py Working dir is /tmp/pip-install-95b99lfu/bluepy execute make -C ./bluepy clean error: [Errno 2] No such file or directory: 'make' ---------------------------------------- ERROR: Failed building wheel for bluepy DEPRECATION: Could not build wheels for bluepy which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368. ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-95b99lfu/bluepy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-95b99lfu/bluepy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-fv86edrr/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /config/.local/include/python3.9/bluepy cwd: /tmp/pip-install-95b99lfu/bluepy/ Complete output (8 lines): /usr/lib/python3.9/site-packages/setuptools/dist.py:697: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running install running build running build_py Working dir is /tmp/pip-install-95b99lfu/bluepy execute make -C ./bluepy clean error: [Errno 2] No such file or directory: 'make' ---------------------------------------- ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-95b99lfu/bluepy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-95b99lfu/bluepy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-fv86edrr/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /config/.local/include/python3.9/bluepy Check the logs for full command output. WARNING: You are using pip version 20.2; however, version 21.3.1 is available. You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
Unable to install package bluepy==1.3.0: ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6sshjqg7/bluepy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6sshjqg7/bluepy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-rc9bu1u2 cwd: /tmp/pip-install-6sshjqg7/bluepy/ Complete output (8 lines): /usr/lib/python3.9/site-packages/setuptools/dist.py:697: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running bdist_wheel running build running build_py Working dir is /tmp/pip-install-6sshjqg7/bluepy execute make -C ./bluepy clean error: [Errno 2] No such file or directory: 'make' ---------------------------------------- ERROR: Failed building wheel for bluepy DEPRECATION: Could not build wheels for bluepy which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368. ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6sshjqg7/bluepy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6sshjqg7/bluepy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-hkuziozo/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /config/.local/include/python3.9/bluepy cwd: /tmp/pip-install-6sshjqg7/bluepy/ Complete output (8 lines): /usr/lib/python3.9/site-packages/setuptools/dist.py:697: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running install running build running build_py Working dir is /tmp/pip-install-6sshjqg7/bluepy execute make -C ./bluepy clean error: [Errno 2] No such file or directory: 'make' ---------------------------------------- ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6sshjqg7/bluepy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6sshjqg7/bluepy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-hkuziozo/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /config/.local/include/python3.9/bluepy Check the logs for full command output. WARNING: You are using pip version 20.2; however, version 21.3.1 is available. You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.

I've tried to mess up with upgrading pip but didn't solved the issue. Someone can point me in the right direction to fix it? Any help would be very appreciated.

radon_level text attribute incorrect

RadonSensor's radon_level attribute assumes the becquerel unit is being used. If the sensor is setup to use picocurie, the textual representation of the sensor is quite incorrect.

No need to register

Under the "Issues" section of the README, it says "It may be possible that the Wave must be connected to the official app at least once before you can use this program, so you will probably not get around registering an account with Airthings".

Yesterday I received a new unit from Airthings (wave plus). I can confirm that you do not have to register the unit with them to get readings out of it. I have never used their app or registered an account. So it seems you can get around sharing your personal data with them by using this code.

Mac and Multiple sensors

Hi Marty

I hope all is well, thank you for this library. I am new to Hassio, so forgive me for noob question. I have a couple of Airthings Wave Plus sensors that I want to track with home assistant using the RiPi4's built in BLE vs using the cloud.

I followed the getting started direction you have, but I must be missing something.

— Where to find the sensor's MAC ID, found the BLE's characteristics. Used bluetoothd and system_profiler on Mac's terminal, but can't find any of the sensors, even though they are connected to my phone and Airthings App — Which the sync info does not list the Mac ID.

— Once I figure how pair to the devices, how to add the card that displays the sensors data in the main display?

Any help is greatly appreciated.

Best,
\ Carlos

Can't connect to Airthings Wave+

Running on a new install of Home Assistant on Raspberry Pi 4, can't connect.

Getting this error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 415, in connect
    self.sendline(cmd)
  File "/usr/local/lib/python3.8/contextlib.py", line 120, in __exit__
    next(self.gen)
  File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 191, in event
    self.wait(event, timeout)
  File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 157, in wait
    raise NotificationTimeout()
pygatt.exceptions.NotificationTimeout: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/airthings_wave/airthings.py", line 211, in get_sensors
    dev = self.adapter.connect(mac, 3)
  File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 421, in connect
    raise NotConnectedError(message)
pygatt.exceptions.NotConnectedError: Timed out connecting to 80:6F:B0:39:49:2C after 3 seconds.

I can connect in the Terminal with bluetoothctl, and also from my phone.
Distance between the Pi and tthe Wave+ is 2.5 meters, line of sight with no obstructions.

Any idea how to debug?

Crash, thread crashed and no more sensor data was received. (in Fork sverrham)

Crashed on my system this is running from my fork sverrham. trying to read data from an Airthings wave plus.
Worked stable for 6hours before it crashed.

2020-01-29 05:22:35 DEBUG (Thread-3) [custom_components.airthings_wave.sensor] C onnecting to Thread-3 Exception in thread Thread-3: Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/pexpect/spawnbase.py", line 166, in read_nonblocking s = os.read(self.child_fd, size) OSError: [Errno 5] I/O error During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/pexpect/expect.py", line 111, in expect_loop incoming = spawn.read_nonblocking(spawn.maxread, timeout) File "/usr/local/lib/python3.7/site-packages/pexpect/pty_spawn.py", line 485, in read_nonblocking return super(spawn, self).read_nonblocking(size) File "/usr/local/lib/python3.7/site-packages/pexpect/spawnbase.py", line 171, in read_nonblocking raise EOF('End Of File (EOF). Exception style platform.') pexpect.exceptions.EOF: End Of File (EOF). Exception style platform. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/config/custom_components/airthings_wave/sensor.py", line 366, in run adapter.start(reset_on_start=False) File "/usr/local/lib/python3.7/site-packages/pygatt/backends/gatttool/gatttool .py", line 289, in start self._con.expect(r'\[LE\]>', timeout=initialization_timeout) File "/usr/local/lib/python3.7/site-packages/pexpect/spawnbase.py", line 341, in expect timeout, searchwindowsize, async_) File "/usr/local/lib/python3.7/site-packages/pexpect/spawnbase.py", line 369, in expect_list return exp.expect_loop(timeout) File "/usr/local/lib/python3.7/site-packages/pexpect/expect.py", line 117, in expect_loop return self.eof(e) File "/usr/local/lib/python3.7/site-packages/pexpect/expect.py", line 63, in e of raise EOF(msg) pexpect.exceptions.EOF: End Of File (EOF). Exception style platform. <pexpect.pty_spawn.spawn object at 0xadb86b90> command: /usr/bin/gatttool args: ['/usr/bin/gatttool', '-i', 'hci0', '-I'] buffer (last 100 chars): b'' after: <class 'pexpect.exceptions.EOF'> match: None match_index: None exitstatus: None flag_eof: True pid: 396 child_fd: 17 closed: False timeout: 30 delimiter: <class 'pexpect.exceptions.EOF'> logfile: None logfile_read: None logfile_send: None maxread: 2000 ignorecase: False searchwindowsize: None delaybeforesend: 0.05 delayafterclose: 0.1 delayafterterminate: 0.1 searcher: searcher_re: 0: re.compile(b'\\[LE\\]>')

Connection time out when restarting

Hi,

This is such a great integration and it very eases to connect Airthings Wave. However, there is one issue bugging that I'm facing every now and then in the device discovery when restarting the hass.io instance running on RPi4. The connection time out seems to be too quick and the device doesn't get connected. The workaround for this is to repeat the boot as many times as necessary, sometimes it requires 10 times or so. Is there a possibility to make the discovery time as a variable or increase the discovery time or increase the number or times the discovery is conducted to reduce the risk of failure? Would it be possible to continue the device discovery until connected? Might be that I'm looking a wrong place to resolve this issue though.. any other suggestions?

There is like 6 m in between the RPi4 and AT devices and a kitchen wall which might cause interference. Anyway, the integration works like a swiss clock once connected.

Log says as follows:

2021-03-08 23:08:54 ERROR (SyncWorker_0) [pygatt.backends.gatttool.gatttool] Timed out connecting to A4:DA:32:14:13:5A after 3 seconds.
2021-03-08 23:08:54 ERROR (SyncWorker_0) [custom_components.airthings_wave.airthings] Failed to connect
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 415, in connect
self.sendline(cmd)
File "/usr/local/lib/python3.8/contextlib.py", line 120, in exit
next(self.gen)
File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 191, in event
self.wait(event, timeout)
File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 157, in wait
raise NotificationTimeout()
pygatt.exceptions.NotificationTimeout: None
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/config/custom_components/airthings_wave/airthings.py", line 230, in get_sensor_data
dev = self.adapter.connect(mac, 3)
File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 421, in connect
raise NotConnectedError(message)
pygatt.exceptions.NotConnectedError: Timed out connecting to A4:DA:32:14:13:5A after 3 seconds.

need version key for future HA release

Logger: homeassistant.loader
Source: loader.py:802
First occurred: 8:27:09 AM (1 occurrences)
Last logged: 8:27:09 AM

No 'version' key in the manifest file for custom integration 'airthings_wave'. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of 'airthings_wave'

Airthings Wave Mini

Would it be possible to read an Airthings Wave Mini? The mini only monitors TVOC, temperature and humidity. No radon levels.

All Entities Reporting as "Unavailable"

I have an Airthings Wave Plus and Wave Mini that were both working fine, reporting values without issue. It appears at some point yesterday all entities for both devices started showing as "Unavailable". After re-installing the integration and rebooting Home Assistant I saw the following in the logs:

2021-03-24 06:32:29 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform airthings_wave is taking over 10 seconds.
2021-03-24 06:32:41 ERROR (SyncWorker_4) [custom_components.airthings_wave.airthings] Disconnected
Traceback (most recent call last):
  File "/config/custom_components/airthings_wave/airthings.py", line 202, in get_info
    char = self._dev.getCharacteristics(uuid=characteristic.uuid)[0]
  File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 508, in getCharacteristics
    rsp = self._getResp('find')
  File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 407, in _getResp
    resp = self._waitResp(wantType + ['ntfy', 'ind'], timeout)
  File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 362, in _waitResp
    raise BTLEDisconnectError("Device disconnected", resp)
bluepy.btle.BTLEDisconnectError: Device disconnected
2021-03-24 06:32:41 ERROR (SyncWorker_4) [custom_components.airthings_wave.sensor] Failed intial setup.
Traceback (most recent call last):
  File "/config/custom_components/airthings_wave/sensor.py", line 186, in setup_platform
    devices_info = airthingsdetect.get_info()
  File "/config/custom_components/airthings_wave/airthings.py", line 202, in get_info
    char = self._dev.getCharacteristics(uuid=characteristic.uuid)[0]
AttributeError: 'NoneType' object has no attribute 'getCharacteristics'

Here is the relevant portion of my sensor.yaml:

  - platform: airthings_wave
    scan_interval: 120
    elevation: 973

Error starting for first time

Tried installing the component, but ran into the following error. Running 2021.12.1 inside docker. I am also running Passive BLE monitor integration which work fine, so HA can talk to the bluetooth dongle. Any suggestions?

`This error originated from a custom integration.

Logger: custom_components.airthings_wave.sensor
Source: custom_components/airthings_wave/airthings.py:164
Integration: airthings_wave (documentation, issues)
First occurred: 9:37:21 PM (1 occurrences)
Last logged: 9:37:21 PM

Failed intial setup.
Traceback (most recent call last):
File "/config/custom_components/airthings_wave/sensor.py", line 183, in setup_platform
num_devices_found = airthingsdetect.find_devices()
File "/config/custom_components/airthings_wave/airthings.py", line 164, in find_devices
advertisements = scanner.scan(timeout)
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 852, in scan
self.start(passive=passive)
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 790, in start
self._mgmtCmd("le on")
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 312, in _mgmtCmd
raise BTLEManagementError("Failed to execute management command '%s'" % (cmd), rsp)
bluepy.btle.BTLEManagementError: Failed to execute management command 'le on' (code: 20, error: Permission Denied)`

View Plus support

I have purchased a View Plus and realized that there's no repository that can port it inside Home Assistant, which is a shame since that's the reason why I chose to pay the extra bucks.

The API seems well documented https://developer.airthings.com/consumer-api-docs/ but this project aims to handle the bluetooth devicese, hence I was wondering if there's any plan to integrate it or if I should consider starting a new repository to do it.

No module named 'bluepy'

Trying to use this component as described. When checking the hass config I get the following error:
Platform error sensor.airthings_wave - No module named 'bluepy'

Airthings plus is not found on Rpi 4 64 bit version og hassion

I cant get the software to find the Device. It keeps shrowin errors in the log file.

2020-08-26 22:41:49 ERROR (SyncWorker_11) [custom_components.airthings_wave.airthings]
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 415, in connect
self.sendline(cmd)
File "/usr/local/lib/python3.8/contextlib.py", line 120, in exit
next(self.gen)
File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 191, in event
self.wait(event, timeout)
File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 157, in wait
raise NotificationTimeout()
pygatt.exceptions.NotificationTimeout: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/config/custom_components/airthings_wave/airthings.py", line 177, in get_info
dev = self.adapter.connect(mac, 3)
File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 421, in connect
raise NotConnectedError(message)
pygatt.exceptions.NotConnectedError: Timed out connecting to 00:81:f9:f0:5c:f9 after 3 seconds.

020-08-26 22:41:53 ERROR (SyncWorker_11) [custom_components.airthings_wave.airthings] Failed to discover sensors
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 415, in connect
self.sendline(cmd)
File "/usr/local/lib/python3.8/contextlib.py", line 120, in exit
next(self.gen)
File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 191, in event
self.wait(event, timeout)
File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 157, in wait
raise NotificationTimeout()
pygatt.exceptions.NotificationTimeout: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/config/custom_components/airthings_wave/airthings.py", line 197, in get_sensors
dev = self.adapter.connect(mac, 3)
File "/usr/local/lib/python3.8/site-packages/pygatt/backends/gatttool/gatttool.py", line 421, in connect
raise NotConnectedError(message)
pygatt.exceptions.NotConnectedError: Timed out connecting to 00:81:f9:f0:5c:f9 after 3 seconds.

arch aarch64
chassis embedded
dev false
docker true
docker_version 19.03.11
hassio true
host_os HassOS 4.12
installation_type Home Assistant OS
os_name Linux
os_version 4.19.127-v8
python_version 3.8.3
supervisor 235
timezone Europe/Copenhagen
version 0.114.4
virtualenv false
  • platform: airthings_wave
    scan_interval: 120
    mac: 00:81:f9:f0:5c:f9

I have tried with mac address and without. Any suggestions?

error after restart / Failed intial setup.

Logger: custom_components.airthings_wave.sensor
Source: custom_components/airthings_wave/airthings.py:233
Integration: airthings_wave (documentation, issues)
First occurred: 7:47:23 PM (1 occurrences)
Last logged: 7:47:23 PM

Failed intial setup.
Traceback (most recent call last):
File "/config/custom_components/airthings_wave/sensor.py", line 198, in setup_platform
sensordata = airthingsdetect.get_sensor_data()
File "/config/custom_components/airthings_wave/airthings.py", line 233, in get_sensor_data
char = self._dev.getCharacteristics(uuid=characteristic.uuid)[0]
File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 508, in getCharacteristics
rsp = self._getResp('find')
File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 407, in _getResp
resp = self._waitResp(wantType + ['ntfy', 'ind'], timeout)
File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 362, in _waitResp
raise BTLEDisconnectError("Device disconnected", resp)
bluepy.btle.BTLEDisconnectError: Device disconnected

All entities are unavailable in Home Assistant

Not sure if there's somewhere I can grab logs for this, but I've found this to be quite unreliable, with most of the entities showing up as unavailable a lot of the time. This is particularly unfortunate as I'm using the temperature value in automations in my office.

HA 0.115 will remove "mdi:periodic-table-co2"

Hi!

Great component!

Changes coming in the next version of HA will require a minor change to the code.
From HA logs: "Icon mdi:periodic-table-co2 was renamed to mdi:molecule-co2, please change your config, it will be removed in version 0.115."

Not proficient in Git or I'd pull and propose change.

Update documentation

As a new Home Assistant user it wasn't immediately clear to me how to add multiple Airthings devices as sensors with a fixed MAC address. It might makes sense to include an example in the documentation:

sensor:
  - platform: airthings_wave
    scan_interval: 120
    elevation: 998
    mac: 00:81:F9:XX:XX:XX
  - platform: airthings_wave
    scan_interval: 120
    elevation: 998
    mac: 04:ee:03:YY:YY:YY

I also had difficulties to add even one device because it was previously registered with a Airthings Hub. What made it work was to

  1. Remove all sensors from the Airthings app for my phone
  2. Turn off the Hub
  3. Log into the Airthings web site
  4. Unpair the Hub
  5. Reset the Wave sensors by removing the batteries for at least 30 min as mentioned on https://help.airthings.com/en/articles/3119849-wave-basic-troubleshooting
  6. Put the batteries back
  7. Add the sensors in the Airthings app on the phone (this time without going through the hub)
  8. Restart HomeAssistant

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.