Limych / ha-iaquk

Indoor Air Quality Sensor Component for Home Assistant
MIT License
111 stars 16 forks source link

Event is not JSON serializable #6

Closed McGiverGim closed 3 years ago

McGiverGim commented 4 years ago

Version of the custom_component Not sure, HACS show it as: a2e39a4

Configuration

iaquk:
  comedor:
    sources:
      temperature: sensor.climate_nest_temperatura
      humidity: sensor.climate_nest_humedad

  habitacion:
    sources:
      temperature: sensor.temperatura_habitacion
      humidity: sensor.temperatura_habitacion_humedad

  despacho:
    sources:
      temperature: sensor.temperatura_despacho
      humidity: sensor.temperatura_despacho_humedad

  dormitorio:
    sources:
      temperature: sensor.temperatura_dormitorio
      humidity: sensor.temperatura_dormitorio_humedad

  banyo_pasillo:
    sources:
      temperature: sensor.temperatura_banyo_pasillo
      humidity: sensor.temperatura_banyo_pasillo_humedad

Describe the bug

In the logs I see the Event is not a JSON serializable message. Logs attached later. It seems too that the values of the sensor do not change. It shows always a value of 58.

To Reproduce

Nothing to do. It simply appears with the configuration attached.

Expected behavior

No error messages in the log, and the value of the sensor changing.

Screenshots

None.

Debug log

2020-06-02 09:58:00 WARNING (Recorder) [homeassistant.components.recorder] Event is not JSON serializable: <Event platform_discovered[L]: service=load_platform.sensor, platform=iaquk, discovered=name=comedor, sensors=dict_keys(['iaq_index', 'iaq_level'])>
2020-06-02 09:58:00 WARNING (Recorder) [homeassistant.components.recorder] Event is not JSON serializable: <Event platform_discovered[L]: service=load_platform.sensor, platform=iaquk, discovered=name=habitacion, sensors=dict_keys(['iaq_index', 'iaq_level'])>
2020-06-02 09:58:00 WARNING (Recorder) [homeassistant.components.recorder] Event is not JSON serializable: <Event platform_discovered[L]: service=load_platform.sensor, platform=iaquk, discovered=name=despacho, sensors=dict_keys(['iaq_index', 'iaq_level'])>
2020-06-02 09:58:00 WARNING (Recorder) [homeassistant.components.recorder] Event is not JSON serializable: <Event platform_discovered[L]: service=load_platform.sensor, platform=iaquk, discovered=name=dormitorio, sensors=dict_keys(['iaq_index', 'iaq_level'])>
2020-06-02 09:58:00 WARNING (Recorder) [homeassistant.components.recorder] Event is not JSON serializable: <Event platform_discovered[L]: service=load_platform.sensor, platform=iaquk, discovered=name=banyo_pasillo, sensors=dict_keys(['iaq_index', 'iaq_level'])>

Additional context

Using latest version of Home Assistant (110.4). I'm not too sure if this must work only with temperature and humidity sensors.

McGiverGim commented 4 years ago

It seems some of the sensors has change the value from 58 to 52, so this issue seems to not affect the correct work of the sensor.

crstophr commented 4 years ago

I have also run into the same issue. Using the HACS for install.

McGiverGim commented 3 years ago

The bug continues happening:

Logger: homeassistant.components.recorder
Source: components/recorder/__init__.py:397
Integration: Recorder (documentation, issues)
First occurred: 13 de diciembre de 2020 23:33:21 (1 occurrences)
Last logged: 13 de diciembre de 2020 23:33:21

Event is not JSON serializable: <Event platform_discovered[L]: service=load_platform.sensor, platform=iaquk, discovered=name=comedor, sensors=dict_keys(['iaq_index', 'iaq_level'])>
didericko commented 3 years ago

Logger: homeassistant.components.recorder Source: components/recorder/init.py:397 Integration: Recorder (documentation, issues) First occurred: 10:20:04 (4 occurrences) Last logged: 10:20:04

Event is not JSON serializable: <Event platform_discovered[L]: service=load_platform.sensor, platform=iaquk, discovered=name=slaapkamer, sensors=dict_keys(['iaq_index', 'iaq_level'])> Event is not JSON serializable: <Event platform_discovered[L]: service=load_platform.sensor, platform=iaquk, discovered=name=kantoor, sensors=dict_keys(['iaq_index', 'iaq_level'])> Event is not JSON serializable: <Event platform_discovered[L]: service=load_platform.sensor, platform=iaquk, discovered=name=daniel, sensors=dict_keys(['iaq_index', 'iaq_level'])> Event is not JSON serializable: <Event platform_discovered[L]: service=load_platform.sensor, platform=iaquk, discovered=name=jonathan, sensors=dict_keys(['iaq_index', 'iaq_level'])>

didericko commented 3 years ago

If you configure them explicitly the warning dissapears:

sensors:
  - iaq_index
  - iaq_level
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.