Limych / ha-iaquk

Indoor Air Quality Sensor Component for Home Assistant
MIT License
105 stars 15 forks source link

Sensor not updated when tracked entities change #4

Closed insajd closed 4 years ago

insajd commented 4 years ago

Version 1.1.1

Configuration

iaquk:
  livingroom:
    name: "Living Room"
    sources:
      temperature: sensor.temperature_158d00023256d7
      humidity: sensor.humidity_158d00023256d7
      co2: sensor.co2_sensor_co2

Describe the bug

When HA is started, sensor value is set based on temperature, CO2 , and humidity values that are present. After that - although temperatures, CO2 levels change - iaq_index stays the same. If I restart HA - it shows new value for iaq_index.

To Reproduce

If applicable, describe the steps to reproduce the behavior:

  1. Configure temp, humidity, co2 sensors.
  2. Restart HA - new iaq_index is calculated.
  3. Force drastic temperature/CO2 change.
  4. Expect new iaq_index value, but it's the same.

Expected behavior

Expect for iaq_index and iaq_level to change because of temp/co2 level change without HA reboot.

Debug log

2020-01-28 21:33:49 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for logbook_cache which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2020-01-28 21:33:49 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for iaquk which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2020-01-28 21:33:49 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for nordpool which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2020-01-28 21:33:49 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for alexa_media which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2020-01-28 21:33:49 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2020-01-28 21:33:49 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for circadian_lighting which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2020-01-28 21:33:50 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for sonoff which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
...
2020-01-28 21:34:02 INFO (MainThread) [homeassistant.setup] Setting up iaquk
2020-01-28 21:34:02 INFO (MainThread) [custom_components.iaquk] Version 1.1.1
2020-01-28 21:34:02 INFO (MainThread) [custom_components.iaquk] If you have ANY issues with this, please report them here: https://github.com/Limych/ha-iaquk/issues
2020-01-28 21:34:02 DEBUG (MainThread) [custom_components.iaquk] Initialize controller livingroom for sources: temperature=sensor.temperature_158d00023256d7, humidity=sensor.humidity_158d00023256d7, co2=sensor.co2_sensor_co2
2020-01-28 21:34:02 INFO (MainThread) [homeassistant.setup] Setup of domain iaquk took 0.0 seconds.
...
2020-01-28 21:34:27 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.zwave
2020-01-28 21:34:27 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.iaquk
2020-01-28 21:34:27 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.sonoff
2020-01-28 21:34:27 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.circadian_lighting
2020-01-28 21:34:27 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.xiaomi_aqara
2020-01-28 21:34:27 DEBUG (MainThread) [custom_components.iaquk.sensor] Initialize sensor iaq_index for controller livingroom
2020-01-28 21:34:27 DEBUG (MainThread) [custom_components.iaquk.sensor] Initialize sensor iaq_level for controller livingroom
2020-01-28 21:34:27 INFO (MainThread) [coap] Retransmission, Message ID: 52436.
2020-01-28 21:34:30 INFO (MainThread) [hacs.repository.integration.hacs.integration] Registration complete
...
2020-01-28 21:35:51 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 122.83s
2020-01-28 21:35:51 INFO (MainThread) [homeassistant.core] Starting Home Assistant
2020-01-28 21:35:51 INFO (SyncWorker_13) [homeassistant.components.zwave] Starting Z-Wave network...
2020-01-28 21:35:51 INFO (SyncWorker_13) [openzwave] Start Openzwave network.
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] State update
2020-01-28 21:35:51 INFO (SyncWorker_2) [homeassistant.components.zeroconf] Starting Zeroconf broadcast
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] sensor.temperature_158d00023256d7=21.8
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] temperature=21.8
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] temperature_index=4
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] sensor.humidity_158d00023256d7=42.6
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] humidity=42.6
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] humidity_index=5
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] sensor.co2_sensor_co2=978
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] CO2=978.0
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] co2_index=3
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] co_index=None
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] no2_index=None
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] tvoc_index=None
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] hcho_index=None
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] pm_index=None
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] Current IAQ index 52 (3 sensors)
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] State update
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] sensor.temperature_158d00023256d7=21.8
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] temperature=21.8
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] temperature_index=4
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] sensor.humidity_158d00023256d7=42.6
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] humidity=42.6
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] humidity_index=5
2020-01-28 21:35:51 DEBUG (MainThread) [custom_components.iaquk] [livingroom] sensor.co2_sensor_co2=978
2020-01-28 21:35:52 DEBUG (MainThread) [custom_components.iaquk] [livingroom] CO2=978.0
2020-01-28 21:35:52 DEBUG (MainThread) [custom_components.iaquk] [livingroom] co2_index=3
2020-01-28 21:35:52 DEBUG (MainThread) [custom_components.iaquk] [livingroom] co_index=None
2020-01-28 21:35:52 DEBUG (MainThread) [custom_components.iaquk] [livingroom] no2_index=None
2020-01-28 21:35:52 DEBUG (MainThread) [custom_components.iaquk] [livingroom] tvoc_index=None
2020-01-28 21:35:52 DEBUG (MainThread) [custom_components.iaquk] [livingroom] hcho_index=None
2020-01-28 21:35:52 DEBUG (MainThread) [custom_components.iaquk] [livingroom] pm_index=None
2020-01-28 21:35:52 DEBUG (MainThread) [custom_components.iaquk] [livingroom] Current IAQ index 52 (3 sensors)
2020-01-28 21:35:52 INFO (MainThread) [homeassistant.components.automation] Initialized trigger Create alexa speaker group in active rooms
...
2020-01-28 21:36:10 INFO (MainThread) [snitun.utils.aiohttp_client] AioHTTP snitun client started on 127.0.0.1:58143
2020-01-28 21:36:12 INFO (MainThread) [snitun.utils.aiohttp_client] AioHTTP snitun client connected to: eu-central-1.ui.nabu.casa:443
2020-01-28 21:36:17 INFO (MainThread) [hacs.factory] Processing 23 tasks
2020-01-28 21:36:28 ERROR (MainThread) [hacs.factory] GitHub returned 502 for https://api.github.com/rate_limit
2020-01-28 21:36:40 WARNING (Recorder) [homeassistant.components.recorder] Event is not JSON serializable: <Event platform_discovered[L]: service=load_platform.sensor, platform=iaquk, discovered=name=livingroom, sensors=dict_keys(['iaq_index', 'iaq_level'])>
2020-01-28 21:36:42 INFO (MainThread) [hacs.factory] Task processing of 23 tasks completed in 25 seconds
...
insajd commented 4 years ago

v1.1.2 fixed this. Thanks!

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.