Luftdaten component updating error

Luftdaten component is randomly stopping updates and is giving the following message:

2019-03-04 00:09:41 ERROR (MainThread) [luftdaten] Can not load data from luftdaten.info
2019-03-04 00:09:41 ERROR (MainThread) [homeassistant.components.luftdaten] Unable to retrieve data from luftdaten.info
2019-03-04 00:19:41 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File “/usr/local/lib/python3.7/site-packages/homeassistant/components/luftdaten/init.py”, line 140, in refresh_sensors await luftdaten.async_update() File “/usr/local/lib/python3.7/site-packages/homeassistant/components/luftdaten/init.py”, line 183, in async_update self.data[DATA_LUFTDATEN].update(self.client.meta) AttributeError: ‘NoneType’ object has no attribute ‘update’
2019-03-04 00:29:38 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File “/usr/local/lib/python3.7/site-packages/homeassistant/components/luftdaten/init.py”, line 140, in refresh_sensors await luftdaten.async_update() File “/usr/local/lib/python3.7/site-packages/homeassistant/components/luftdaten/init.py”, line 180, in async_update await self.client.get_data() File “/usr/local/lib/python3.7/site-packages/luftdaten/init.py”, line 62, in get_data for measurement in self.values.keys(): AttributeError: ‘NoneType’ object has no attribute ‘keys’

I set up the component by “Configuration via frontend” or Configuration/Integrations. HA Version 0.88.2 on RP 3.

I am facing this issue, too but I think it is related to luftdaten.info, not the component or the release 0.88.2

Just started using luftdaten a couple of days ago, so I can’t say if it’s an issue with the current HA version. The sensor id I added was online the hole time and data available via https://maps.luftdaten.info . If I reboot the host system, data are coming in again. This seems to be some sort of loop: Can’t find data → couldn’t find data in last periode → …

First error message see first post, since then followed by:

2019-03-04 14:20:57 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File “/usr/local/lib/python3.7/site-packages/homeassistant/components/luftdaten/init.py”, line 140, in refresh_sensors await luftdaten.async_update() File “/usr/local/lib/python3.7/site-packages/homeassistant/components/luftdaten/init.py”, line 180, in async_update await self.client.get_data() File “/usr/local/lib/python3.7/site-packages/luftdaten/init.py”, line 62, in get_data for measurement in self.values.keys(): AttributeError: ‘NoneType’ object has no attribute ‘keys’

Got tired of Luftdaten’s peculiarities and instabilities. I figured, as I’m hosting a sensor station myself, I might as well get the data locally instead of polling the cloud. I managed to set this up using a rest sensor and then a template one for each value I need (temp, pressure, humidity, pm10, pm25)
I can share my code as an example if anybody else is interested.

Could also use OpenSenseMap, the Luftdaten fw supports pushing data to their API as well.

I just switched FROM opensensemap TO luftdaten BECAUSE of the instability of opensensemap. so i guess they are both not very reliable…

Yes I am :slight_smile: I have the same setup…

right… here’s the setup that I’ve got. Using packages. Code is probably clumsy. Let me know if you need info:

sensor:

  ################################################################################
  ## rest
  ## enumarating array from [0]
  ################################################################################



  - platform: rest
    name: json_bme280_data
    scan_interval: '00:59'
    json_attributes:
      - softwareversion
      - age
      - sensordatavalues
    resource: !secret bme280_ip
    value_template: '{{ value_json.json_bme280_data }}'
  - platform: template
    sensors:
      bm280_sdsp1:
        friendly_name: bme280_pm10
        unit_of_measurement: "µg/m³"
        value_template: '{{ states.sensor.json_bme280_data.attributes["sensordatavalues"][0].value }}'
      bme280_sdsp2:
        friendly_name: bme280_pm25
        unit_of_measurement: "µg/m³"
        value_template: '{{ states.sensor.json_bme280_data.attributes["sensordatavalues"][1].value }}'
      bm280_temperature:
        friendly_name: bme280_temperature
        value_template: '{{ states.sensor.json_bme280_data.attributes["sensordatavalues"][2].value }}'
        unit_of_measurement: "°C"
      bm280_humidity:
        friendly_name: bme280_humidity
        unit_of_measurement: "%"
        value_template: '{{ states.sensor.json_bme280_data.attributes["sensordatavalues"][3].value }}'
      bm280_pressure:
        friendly_name: bme280_pressure
        unit_of_measurement: "hP"
        value_template: '{{ states.sensor.json_bme280_data.attributes["sensordatavalues"][4].value }}'
1 Like