Integration Airthings Hub

Hi

Anyone made an integration with AirThings hub recently?

I found this 2 year old project
GitHub - gkreitz/homeassistant-airthings: Quick n’ dirty hack to get Airthings Wave Plus sensor into Home Assistant

I have made two.
One with bluetooth and one using the airthings cloud:

2 Likes

Hi Daniel, thanks for the Airthings Hub custom_component. Is it possible to have faster update of the sensors? My sensors updates every 20min in home assistant!

Best regards
Thekholm

1 Like

I am with Thekholm on this one, It would be really great of we could have a lower pulling time.

I was able to install this custom component via HACS, I can read all sensors and it seems to be working, but I am having issues with creating automations using STATE on the sensor.airthings* nothing happens, its like the trigger does not get read. I am fairly new to HA, but I would love to get this thing working.

Try using platform: numeric_state, works great! I have my set to send a push notification if the Co2 or VOC are to high. I also have it announced to my Google speakers over TTS.

/Thekholm

For the Bluetooth integration you can customize the update time with:

scan_interval: 120

Will update every 120s

Its working good now. I am using numeric_state.

Since I am new to HA, I had the popular problem of not realizing that HA is reading the sensor values as a string instead of a number. That is why nothing happed when my sensor values were triggered…

In order to get it to work, I had to add this to my Value template under conditions
{{ states.sensor**sensor-name**.state | float }}
in my case it was
{{ states.sensor.airthings_office_temp.state | float }}

Maybe this helps some other beginners.

Hello Daniel.

I am using your Airthings Cloud, not BLT.

To recap: Do you have any advice to reduce the sensor update interval from 20min to lets say 5?

I am not sure the data on Airthings cloud is updated more often.
You can try to change the update interval in the code:

Hi Daniel,

I posted this on another thread but haven’t heard anything. I am getting the error below.
Not sure if you are still supporting this and can help. I have tried different versions. Nothing but a downgrade of HA to my snapshots works. However that has its downsides with other stuff. I am using HA OS 6 everything is up to date on my system

Logger: homeassistant.components.sensor
Source: custom_components/airthings_cloud/sensor.py:242
Integration: Sensor (documentation, issues)
First occurred: 10:14:10 AM (1 occurrences)
Last logged: 10:14:10 AM

Error while setting up airthings_cloud platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/airthings_cloud/sensor.py", line 61, in async_setup_platform
    if not await airthings_data.update_data():
  File "/config/custom_components/airthings_cloud/sensor.py", line 242, in update_data
    resp = await self._session.get(
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 542, in _request
    resp = await req.send(conn)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 668, in send
    await writer.write_headers(status_line, self.headers)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_writer.py", line 118, in write_headers
    buf = _serialize_headers(status_line, headers)
  File "aiohttp/_http_writer.pyx", line 137, in aiohttp._http_writer._serialize_headers
  File "aiohttp/_http_writer.pyx", line 109, in aiohttp._http_writer.to_str
TypeError: Cannot serialize non-str key None

Hey @Danielhiversen is there a simple tweak to get the “Mini” to work with the cloud addon?

Thank you!

Most likely, but I do not have any of the Mini sensors, so it would depend on others to add support for it