ha-ferroamp icon indicating copy to clipboard operation
ha-ferroamp copied to clipboard

ValueError: could not convert string to float

Open robinostlund opened this issue 3 months ago • 1 comments

Got some strange val response from one of my esos today, first time i have seen it (Using v1.15.0).

2024-10-27 14:58:34.176 ERROR (MainThread) [homeassistant.components.mqtt.client] Exception in eso_event_received when handling msg on 'ferroamp/extapi/data/eso': '{"id": {"val": "21010072"}, "ubat": {"val": "394.373"}, "ibat": {"val": "0.000"}, "wbatprod": {"val": "10199814659634"}, "wbatcons": {"val": "7323984040238"}, "soc": {"val": "30.000"}, "relaystatus": {"val": "0"}, "temp": {"val": "30.\u00008\u000016"}, "faultcode": {"val": "200"}, "udc": {"val": "760.011"}, "ts": {"val": "2024-10-27T13:58:34UTC"}}'
Traceback (most recent call last):
  File "/config/custom_components/ferroamp/sensor.py", line 330, in eso_event_received
    update_sensor_from_event(event, sensors, store)
  File "/config/custom_components/ferroamp/sensor.py", line 117, in update_sensor_from_event
    sensor.add_event(event)
  File "/config/custom_components/ferroamp/sensor.py", line 685, in add_event
    self.process_events(now)
  File "/config/custom_components/ferroamp/sensor.py", line 692, in process_events
    if self.update_state_from_events(temp):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ferroamp/sensor.py", line 829, in update_state_from_events
    temp = (temp or 0) + self.get_float_value(event)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ferroamp/sensor.py", line 677, in get_float_value
    return float(val["val"])
           ^^^^^^^^^^^^^^^^^
ValueError: could not convert string to float: '30.\x008\x0016'

robinostlund avatar Oct 27 '24 14:10 robinostlund