ccutrer / waterfurnace_aurora

Library for communication with WaterFurnace Aurora control systems
30 stars 7 forks source link

Error updaating state of heating_cooling_mode #53

Closed starsoccer closed 10 months ago

starsoccer commented 10 months ago

See below error. Not sure whats causing this exactly but it seems to be filling my logs

2023-10-03 09:23:20.036 ERROR (MainThread) [homeassistant.components.mqtt.models] Exception raised when updating state of sensor.waterfurnace_heat_pump_current_heating_cooling_mode_2, topic: 'homie/aurora-230602042/abc/current-mode' with payload: b'standby'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 586, in state
numerical_value = int(value)
^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'standby'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 589, in state
numerical_value = float(value)
^^^^^^^^^^^^
ValueError: could not convert string to float: 'standby'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt/models.py", line 305, in process_write_state_requests
entity.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 730, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 830, in _async_write_ha_state
state, attr = self._async_generate_attributes()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 771, in _async_generate_attributes
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 736, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 593, in state
raise ValueError(
ValueError: Sensor sensor.waterfurnace_heat_pump_current_heating_cooling_mode_2 has device class 'None', state class 'measurement' unit 'None' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: 'standby' (<class 'str'>)
ccutrer commented 10 months ago

Can you update your mqtt-homeassistant gem to 0.1.6 (gem install mqtt-homeassistant), restart the bridge, and try again? It will then start publishing with a device class of enum, but I'm not sure if I also have to remove the state class of measurement (the docs are unclear).

starsoccer commented 10 months ago

Can you update your mqtt-homeassistant gem to 0.1.6 (gem install mqtt-homeassistant), restart the bridge, and try again? It will then start publishing with a device class of enum, but I'm not sure if I also have to remove the state class of measurement (the docs are unclear).

It looks like that solved the issue. Just noting for others make sure you reboot after installing or atleast restart the service as I didnt at first

starsoccer commented 10 months ago

A bit unrelated but any plans to enable discussions on this project? Just would be useful for some questions I have that arent issues per se

ccutrer commented 10 months ago

Discussions are enabled, just nobody has made any yet.

starsoccer commented 10 months ago

While I still believe this is solved there seems to be a warning being generated on start,

2023-10-19 10:20:41.789 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.waterfurnace_heat_pump_current_heating_cooling_mode (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using state class 'measurement' which is impossible considering device class ('enum') it is using; expected None; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22
2023-10-19 10:20:41.886 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.waterfurnace_heat_pump_current_heating_cooling_mode_2 (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using state class 'measurement' which is impossible considering device class ('enum') it is using; expected None; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22