Re: openWB series 2 an HomeAssistant anbinden
Verfasst: Do Jan 11, 2024 2:59 pm
Nein, ich kann das Repo so wie es ist einbinden.
Code: Alles auswählen
2024-01-13 01:08:27.064 ERROR (MainThread) [homeassistant.util.logging] Exception in message_received when handling msg on 'openWB/system/lastlivevaluesJson': '{"timestamp": 1705104502, "time": "01:08:22", "grid": 0.408, "house-power": 0.408, "charging-all": 0.0, "pv-all": -0.0}'
Traceback (most recent call last):
File "/config/custom_components/openwb2mqtt/sensor.py", line 156, in message_received
self._attr_native_value = self.entity_description.value_fn(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/openwb2mqtt/const.py", line 1056, in <lambda>
value_fn=lambda x: round(1000 * float(json.loads(x).get("bat-all-power")), 0),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: float() argument must be a string or a real number, not 'NoneType'
2024-01-13 01:08:31.940 ERROR (MainThread) [homeassistant.util.logging] Exception in message_received when handling msg on 'openWB/system/lastlivevaluesJson': '{"timestamp": 1705104511, "time": "01:08:31", "grid": 0.407, "house-power": 0.407, "charging-all": 0.0, "pv-all": -0.0}'
Traceback (most recent call last):
File "/config/custom_components/openwb2mqtt/sensor.py", line 156, in message_received
self._attr_native_value = self.entity_description.value_fn(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/openwb2mqtt/const.py", line 1056, in <lambda>
value_fn=lambda x: round(1000 * float(json.loads(x).get("bat-all-power")), 0),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: float() argument must be a string or a real number, not 'NoneType'
2024-01-13 01:08:41.449 ERROR (MainThread) [homeassistant.util.logging] Exception in message_received when handling msg on 'openWB/system/lastlivevaluesJson': '{"timestamp": 1705104521, "time": "01:08:41", "grid": 0.41, "house-power": 0.41, "charging-all": 0.0, "pv-all": -0.0}'
Traceback (most recent call last):
File "/config/custom_components/openwb2mqtt/sensor.py", line 156, in message_received
self._attr_native_value = self.entity_description.value_fn(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/openwb2mqtt/const.py", line 1056, in <lambda>
value_fn=lambda x: round(1000 * float(json.loads(x).get("bat-all-power")), 0),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: float() argument must be a string or a real number, not 'NoneType'
2024-01-13 01:08:52.029 ERROR (MainThread) [homeassistant.util.logging] Exception in message_received when handling msg on 'openWB/system/lastlivevaluesJson': '{"timestamp": 1705104531, "time": "01:08:51", "grid": 0.403, "house-power": 0.403, "charging-all": 0.0, "pv-all": -0.0}'
Traceback (most recent call last):
File "/config/custom_components/openwb2mqtt/sensor.py", line 156, in message_received
self._attr_native_value = self.entity_description.value_fn(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/openwb2mqtt/const.py", line 1056, in <lambda>
value_fn=lambda x: round(1000 * float(json.loads(x).get("bat-all-power")), 0),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: float() argument must be a string or a real number, not 'NoneType'
2024-01-13 01:08:56.023 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 644, in state
numerical_value = float(value) # type:ignore[arg-type]
^^^^^^^^^^^^
ValueError: could not convert string to float: '{"timestamp": 1705104531, "time": "01:08:51", "grid": 0.403, "house-power": 0.403, "charging-all": 0.0, "pv-all": -0.0}'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 883, in _update_entity_states
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 916, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1066, in _async_write_ha_state
state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1003, in __async_calculate_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 951, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 646, in state
raise ValueError(
ValueError: Sensor sensor.openwb_controller_batterieleistung_gesamt has device class 'power', state class 'measurement' unit 'W' and suggested precision '0' thus indicating it has a numeric value; however, it has the non-numeric value: '{"timestamp": 1705104531, "time": "01:08:51", "grid": 0.403, "house-power": 0.403, "charging-all": 0.0, "pv-all": -0.0}' (<class 'str'>)
2024-01-13 01:09:01.598 ERROR (MainThread) [homeassistant.util.logging] Exception in message_received when handling msg on 'openWB/system/lastlivevaluesJson': '{"timestamp": 1705104541, "time": "01:09:01", "grid": 0.403, "house-power": 0.403, "charging-all": 0.0, "pv-all": -0.0}'
Traceback (most recent call last):
File "/config/custom_components/openwb2mqtt/sensor.py", line 156, in message_received
self._attr_native_value = self.entity_description.value_fn(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/openwb2mqtt/const.py", line 1056, in <lambda>
value_fn=lambda x: round(1000 * float(json.loads(x).get("bat-all-power")), 0),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: float() argument must be a string or a real number, not 'NoneType'
2024-01-13 01:09:12.017 ERROR (MainThread) [homeassistant.util.logging] Exception in message_received when handling msg on 'openWB/system/lastlivevaluesJson': '{"timestamp": 1705104551, "time": "01:09:11", "grid": 0.436, "house-power": 0.436, "charging-all": 0.0, "pv-all": -0.0}'
Traceback (most recent call last):
File "/config/custom_components/openwb2mqtt/sensor.py", line 156, in message_received
self._attr_native_value = self.entity_description.value_fn(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/openwb2mqtt/const.py", line 1056, in <lambda>
value_fn=lambda x: round(1000 * float(json.loads(x).get("bat-all-power")), 0),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: float() argument must be a string or a real number, not 'NoneType'
2024-01-13 01:09:21.505 ERROR (MainThread) [homeassistant.util.logging] Exception in message_received when handling msg on 'openWB/system/lastlivevaluesJson': '{"timestamp": 1705104561, "time": "01:09:21", "grid": 0.404, "house-power": 0.404, "charging-all": 0.0, "pv-all": -0.0}'
Traceback (most recent call last):
File "/config/custom_components/openwb2mqtt/sensor.py", line 156, in message_received
self._attr_native_value = self.entity_description.value_fn(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/openwb2mqtt/const.py", line 1056, in <lambda>
value_fn=lambda x: round(1000 * float(json.loads(x).get("bat-all-power")), 0),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: float() argument must be a string or a real number, not 'NoneType'
2024-01-13 01:09:26.024 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved