Giter Club home page Giter Club logo

home_assistant_airthings_cloud's Introduction

Airthings cloud

Validate with hassfest GitHub Release hacs_badge

Custom component for using Airthings sensors in Home Assistant.

Support the developer

Install

Use hacs or copy the files to the custom_components folder in Home Assistant config.

Configuration

In configuration.yaml:

sensor:
  - platform: airthings_cloud
    username: [email protected]
    password: YOURPSWD

home_assistant_airthings_cloud's People

Contributors

avocadosalsa avatar danielhiversen avatar gregology avatar msvinth 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

home_assistant_airthings_cloud's Issues

not found in HACS and no connection

Maybe I do somthing wrong.

Frist I cannot find airthings_cloud in HACS, only "Sensor.Airthings Wave" is found.
I've installed it coping your files in custom_components. Then restarted.
Now the logs tell me:
Logger: homeassistant.components.sensor
Source: /usr/local/lib/python3.8/asyncio/events.py:81
Integration: Sensor (documentation, issues)
First occurred: 10:26:10 (4 occurrences)
Last logged: 10:26:28

Setup of sensor platform airthings_cloud is taking over 10 seconds.
Setup of sensor platform solaredge is taking over 10 seconds.
Setup of sensor platform meteo-swiss is taking over 10 seconds.

and:
Logger: custom_components.airthings_cloud.sensor
Source: custom_components/airthings_cloud/sensor.py:62
Integration: airthings_cloud (documentation, issues)
First occurred: 10:26:20 (1 occurrences)
Last logged: 10:26:20

Failed to get data from Airthings

Error while setting up airthings_cloud platform for sensor - KeyError: 'mold'

Hi
When i try load sensor i get the following error.
Ive got Wave Plus and Wave Mini connected to the cloud.

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

Error while setting up airthings_cloud platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 193, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/airthings_cloud/sensor.py", line 64, in async_setup_platform
dev.append(Airthings(sensor_id, sensor, airthings_data))
File "/config/custom_components/airthings_cloud/sensor.py", line 77, in init
self._unit_of_measurement = SENSOR_TYPES[sensor[1]][0]
KeyError: 'mold'

Radon units are incorrect: Airthings Dashboard shows 1 pCi/L but HA component shows Bq/m3

I'm located in USA and the radon units on my Airthings Dashboard are pCi/L.
image

I'm not sure if the displayed units are different for different countries, but the units are incorrect for me (though the numerical value is correct). Per https://www.ncbi.nlm.nih.gov/books/NBK230646/, "1 pCi/L is equal to 37 Bq/m3" so maybe a simple conversion could be added based on location, sourced either from Home Assistant or perhaps based on the units selected in the Airthings Dashboard (I don't know what's available).

New entities created on restart of Home Assistant

I am getting a new set of entities with new ids created on every restart of Home Assistant.
After some restarts:
Screenshot 2020-10-25 at 09 47 05

This is on Home Assistant 0.116.4
Does not happen for any of my other integrations.

Suddenly Unauthorized

Thank you for sharing your code!

I installed the component yesterday and it worked fine. I see in the logs, that a couple of hours later the the calls to to Airthings server started to fail:

[custom_components.airthings_cloud.sensor] Error connecting to Airthings, resp code: 401 Unauthorized

Maybe there's a max number of allowed calls to the Airthings server? However I am able to login to the Airthings dashboard using a browser (from the same IP + user credentials).

Data granularity

I'm using a Wave Plus device and the Airthings dashboard CSV export gives sensors data series mostly regular with a 5 minutes step, except for Radon which is once per hour. On home assistant charts I'm seeing irregular samples at less than 1 sample per hour on average instead.
Where's the issue? Is it the data from the Airthings API, which differs in granularity from the CSV export, or an issue with the component / home assistant?

Does not show in HACS

I looked for this in the HACS repositories, and was unable to find it when searching for "airthings"
I was able to download the file, and install it manually

Support for PM

Using this with the new View Plus. Works like a champ. Missing particulate matter (PM) so requesting support for PM.

Version without binding to Home Assistant

Hi!
Do you have a version of this without the binding to HA?
I would like to login and collect this data from the Cloud and send it to a Mqtt broker where any automation system can fetch it.
Regards Roger

Multiple Devices - some do not show up

I have 7 Airthings devices (1x Wave, 2x Wave Plus, 3x Wave Mini and an Airthings Hub). All are connected to cloud and operating correctly. I have added the airthings_cloud integration over past few weeks (to multiple Home Assistant new installations). I have setup Home Assistant OS and Home Assistant supervised a couple different methods. Direct install on hardware, as Proxmox VM, Docker install on Debian Linux. The integration seems to work every time but only 2 or 3 of the 6 devices show up. What is really strange is that each time it is a different combination of devices that is pulled into Home Assistant. The first 2 devices I added in my account from an Airthings Home Kit (Wave & Wave Mini) always show up. Then a 3rd or 3rd and 4th -- sometimes 2 Wave Mini, sometimes 1 Wave Plus or Wave Mini.

I tried to determine if it was based on most recent update to cloud account or name or ID... but there does not seem to be any pattern. I also did not find any obvious errors via log that correspond to the missing devices.

I am going to pull everything from my account and try resetting up one at a time -- adding another device after confirming last device works and is showing up in Home Assistant.

I am reaching out just in case there is some inherent limitation on how many devices are read from cloud. I looked at the python code but I am far from a deep expert developer so nothing stood out as limiting what is pulled back from the cloud.

Any input is appreciated.

And thank you for your work on this integration. It seems strange how all other Airthings integration effort is so focused on Bluetooth. It kinda defeats the purpose of a hub or centralized server to run around your house placing extra systems just to have Bluetooth close enough to air monitoring devices to pick up data. Your cloud integration is ideal if you plan to have multiple Airthings devices on one account (assuming I can get all devices to pull back into Home Assistant). I would never have gotten this working on my own.

Regards

Collection time is offset

when data is pulled by the script it's tagged with current date/time instead of the date/time of the reading on the dashboard.
recommend bringing in latestSample utc time with the currentSensorValues

"content": {
"serialNumber": "2930022690",
"locationName": "Local FD",
"roomName": "Basement",
"segmentStart": "2020-10-04T21:39:51",
"latestSample": "2020-10-14T13:44:57",
"currentSensorValues": [
{
"type": "radonShortTermAvg",
"value": 0.19,
"providedUnit": "pci",
"preferredUnit": "pci",
"isAlert": false,
"thresholds": [
2.7,
4
]
},

Sensor does not refresh

As far as I could from your code the sensor is supposed to refresh every 20 min.
This does not seem to work.
For me the sensor only refreshes on Home Assistant restart.

Also tried to call homeassistant.update_entity but also not updating.

this repo vs official integration

My understanding is that this add-on was recently merged into Home Assistant Core. Any advice on how to migrate to the official integration? I've been using this repo via HACS for a while. I don't know whether I would loose data if I delete this and install the official integration... ? Thanks for any help!

404 error, Airthings change something on their site?

Noticed the values weren't updating today and restarted Home Assistant.

Now the log only shows this:

Logger: custom_components.airthings_cloud.sensor
Source: custom_components/airthings_cloud/sensor.py:247
Integration: airthings_cloud (documentation, issues)
First occurred: 1:47:41 PM (1 occurrences)
Last logged: 1:47:41 PM

Error connecting to Airthings, resp code: 404 Not Found

Been happening for a while now. Website and app appear to be fine.

Temp conversion mismatch

Dashboard is setup in F. Script is expecting C and converting to F. Currently about 158degrees in my basement ;)

More Infos from ViewPlus

Hi I just installed my brand new ViewPlus. It is seen and I have the same entities as with the Plus. Now the ViewPuls has two more Sensors the PM1 and PM2.5, this ist not shown as an entity. Can you implement this?

Second Wave Mini

I've just recently added a second Wave Mini and it's not showing up in Home Assistant. It's linked with the airthings hub, and showing up in the app. It is not finished calibration yet.

Invalid E-mail incorrect error

When performing initial setup, leaving the email from the setup instructions unchanged produces an

Platform error sensor.airthings_cloud - Integration 'airthings_cloud' not found.

Error, instead of an invalid credentials error upon rebooting Home Assistant.

Invalid isoformat string

Just installed through HACS and set up config. The logs fails in setup like this:

`Logger: homeassistant.components.sensor
Source: custom_components/airthings_cloud/sensor.py:99
Integration: Sensor (documentation, issues)
First occurred: 21 September 2021, 19:00:12 (2 occurrences)
Last logged: 21 September 2021, 19:00:12

Error adding entities for domain sensor with platform airthings_cloud
Error while setting up airthings_cloud platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 587, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 698, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 464, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 505, in _async_write_ha_state
extra_state_attributes = self.device_state_attributes
File "/config/custom_components/airthings_cloud/sensor.py", line 99, in device_state_attributes
"timestamp": datetime.datetime.fromisoformat(
ValueError: Invalid isoformat string: ''
`

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.