shenxn / ha-dyson

HomeAssitant custom integration for dyson
MIT License
312 stars 59 forks source link

ValueError: invalid literal for int() with base 10: 'off' #199

Open patelreese87 opened 6 months ago

patelreese87 commented 6 months ago

Dyson Local v0.16.4-4 Core 2024.5.4 Supervisor 2024.05.1

Assuming there is a poll interval, this error is caught hundreds of time throughout the day. Please advise if I am doing something wrong or how i can fix this.

` Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 658, in state numerical_value = int(value) ^^^^^^^^^^ ValueError: invalid literal for int() with base 10: 'off'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 661, in state numerical_value = float(value) ^^^^^^^^^^^^ ValueError: could not convert string to float: 'off'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 414, in _async_refresh self.async_update_listeners() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners update_callback() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 492, in _handle_coordinator_update self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1009, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state state, attr, capabilities, shadowed_attr = self.async_calculate_state() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1067, in async_calculate_state state = self._stringify_state(available) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1015, in _stringify_state if (state := self.state) is None: ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 665, in state raise ValueError( ValueError: Sensor sensor.pure_cool_link_temperature has device class 'temperature', state class 'measurement' unit '°F' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: 'off' (<class 'str'>) `

dotvezz commented 1 week ago

I'd like to point you in this direction: https://github.com/libdyson-wg/ha-dyson

More information is in #185 if you'd like to know the history.