home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.54k stars 30.72k forks source link

Luftdaten sensor reports unknown value for one out of two conditions #11283

Closed runningman84 closed 6 years ago

runningman84 commented 6 years ago

Home Assistant release (hass --version): 0.60.0

Python release (python3 --version): Python 3.6.3

Component/platform: luftdaten

Description of problem: The sensor only reports one out of two conditions (humidity and P2 is reported as unknown). The api data from luftdaten seems to be fine in the same timeframe.

It might be that sensor 5637 is not providing measurements for humidity 20:28 components/sensor/luftdaten.py (WARNING) It might be that sensor 5636 is not providing measurements for P2 20:28 components/sensor/luftdaten.py (WARNING)

Expected: Home assistant should display P1, P2, temperature and humidity.

Problem-relevant configuration.yaml entries and steps to reproduce:

- platform: luftdaten
  sensorid: 5636
  monitored_conditions:
    - P1
    - P2
- platform: luftdaten
  sensorid: 5637
  monitored_conditions:
    - temperature
    - humidity

Additional info:

curl https://api.luftdaten.info/v1/sensor/5637/
[{"sensordatavalues":[{"value":"9.30","id":1320348971,"value_type":"temperature"},{"value":"99.90","id":1320348972,"value_type":"humidity"}],"location":{"country":"DE","latitude":"51.541","id":2840,"longitude":"7.912"},"timestamp":"2017-12-23 19:31:53","sensor":{"sensor_type":{"manufacturer":"various","name":"DHT22","id":9},"pin":"7","id":5637},"sampling_rate":null,"id":604177852},{"sensordatavalues":[{"value":"9.20","id":1320360405,"value_type":"temperature"},{"value":"99.90","id":1320360406,"value_type":"humidity"}],"location":{"country":"DE","latitude":"51.541","id":2840,"longitude":"7.912"},"timestamp":"2017-12-23 19:34:20","sensor":{"sensor_type":{"manufacturer":"various","name":"DHT22","id":9},"pin":"7","id":5637},"sampling_rate":null,"id":604183274}

curl https://api.luftdaten.info/v1/sensor/5636/
[{"sensordatavalues":[{"value":"31.73","id":1320348947,"value_type":"P1"},{"value":"15.40","id":1320348948,"value_type":"P2"}],"location":{"country":"DE","latitude":"51.541","id":2840,"longitude":"7.912"},"timestamp":"2017-12-23 19:31:53","sensor":{"sensor_type":{"manufacturer":"Nova Fitness","name":"SDS011","id":14},"pin":"1","id":5636},"sampling_rate":null,"id":604177840},{"sensordatavalues":[{"value":"36.53","id":1320360378,"value_type":"P1"},{"value":"17.42","id":1320360379,"value_type":"P2"}],"location":{"country":"DE","latitude":"51.541","id":2840,"longitude":"7.912"},"timestamp":"2017-12-23 19:34:20","sensor":{"sensor_type":{"manufacturer":"Nova Fitness","name":"SDS011","id":14},"pin":"1","id":5636},"sampling_rate":null,"id":604183262}]
ReneNulschDE commented 6 years ago

I've taken a look on this and from my perspective it is a bug in python-luftdaten 0.1.1

I've created an PR to hopefully fix the issue. (https://github.com/fabaff/python-luftdaten/pull/1)

BR Rene

mattsches commented 6 years ago

Problem still occurs in hass 0.60.1 (shouldn't it be included in that release?)

ReneNulschDE commented 6 years ago

This minor fix was not selected for version 0.60.1. Should be part of 0.61

mattsches commented 6 years ago

Can confirm that it works again with 0.61.