anotherjulien / MyHOME

MyHOME integration for Home-Assistant
GNU Affero General Public License v3.0
137 stars 57 forks source link

Secondary temperature sensors are no longer created. #24

Closed caiosweet closed 3 years ago

caiosweet commented 3 years ago

Hi Julien, secondary temperature sensors are no longer created. I have noticed this for a while, but I thought it was a problem starting the Home Assistant, but in practice the configuration is not recognized. By reloading the component, this error appears (but I think it is an error because there is no data I believe ...)

Configuration:

sensor:
  - platform: myhome
    devices:
      # Probe
      temp_quadro:
        where: "105"
        name: Temp Quadro
        class: temperature
        manufacturer: BTicino
        model: L4692

Error in Home Assistant log (after reloading the component)


2021-09-29 20:46:49 ERROR (SyncWorker_23) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/myhome/gateway.py", line 229, in listening_loop
    self.hass.data[DOMAIN][CONF_ENTITIES][
  File "/config/custom_components/myhome/climate.py", line 376, in handle_event
    self._target_temperature + self._local_offset
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

Partial Debug

2021-09-29 20:50:24 INFO (MainThread) [custom_components.myhome] Sensor 1 is reporting an active power draw of 270 W.
2021-09-29 20:50:25 DEBUG (MainThread) [custom_components.myhome] Received: *#4*5#1*17##
2021-09-29 20:50:25 INFO (MainThread) [custom_components.myhome] Unsupported message type: *#4*5#1*17##
2021-09-29 20:50:25 DEBUG (MainThread) [custom_components.myhome] Received: *#4*105*0*0329##
2021-09-29 20:50:25 WARNING (MainThread) [custom_components.myhome] Unknown device: WHO=4 WHERE=105
2021-09-29 20:50:28 DEBUG (MainThread) [custom_components.myhome] Received: *#4*5#1*17##
2021-09-29 20:50:28 INFO (MainThread) [custom_components.myhome] Unsupported message type: *#4*5#1*17##
2021-09-29 20:50:28 DEBUG (MainThread) [custom_components.myhome] Received: *#4*105*0*0330##
2021-09-29 20:50:28 WARNING (MainThread) [custom_components.myhome] Unknown device: WHO=4 WHERE=105
2021-09-29 20:50:32 DEBUG (MainThread) [custom_components.myhome] Received: *#4*105*0*0330##
2021-09-29 20:50:32 WARNING (MainThread) [custom_components.myhome] Unknown device: WHO=4 WHERE=105

Thanks for the attention.

anotherjulien commented 3 years ago

Hi!

Both problems were unrelated, but it's a good thing you caught them both :-)

The exception was due to an uninitialised state for local variables, fixed in 1c9761370f16f44436bd187973d66ba62dc7872b And the missing secondary temperature sensor was a silly mistake where the appropriate object was created but never "loaded" in HA, fixed in 9870445285b8658cf7c0d44cf38cf055f9c7c159 (There was a similar issue for Auxiliary binary_sensors, fixed in 233ae03ff02987249a818069adbda0fa6e4aa589)

Can you test the current master and let me know if everything is back on track?

caiosweet commented 3 years ago

Hello. I tried on the fly before going to work. Yes, everything looks ok. today I investigate better😅🤗