Open henfri opened 6 days ago
You are running v1.13.0-beta.0 right?
No, v1.12.13.
Best regards, Hendrik
There is some issue with one of the member sensors, having some invalid value. Anyway I made this more failsafe and logged a warning with #2340. Just released this in latest beta: v1.13.0-beta.1. Would be nice if you can give it a go.
Thanks, will do
Hello,
I am on the Beta.1 now. I now see these errors in the Log:
2024-06-30 19:57:25.864 INFO (MainThread) [homeassistant.components.sensor] Setting up powercalc.sensor
2024-06-30 19:57:25.979 ERROR (MainThread) [homeassistant.components.sensor] Error adding entity sensor.sat_verteiler_energy for domain sensor with platform powercalc
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 580, in _async_add_entities
await coro
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 892, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1358, in add_to_platform_finish
await self.async_added_to_hass()
File "/config/custom_components/powercalc/sensors/daily_energy.py", line 219, in async_added_to_hass
self._state += self.calculate_delta()
^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/powercalc/sensors/daily_energy.py", line 256, in calculate_delta
value = float(value.async_render())
^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: float() argument must be a string or a real number, not 'TupleWrapper'
2024-06-30 19:58:12.689 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/powercalc/sensors/power.py", line 397, in initial_update
await self._handle_source_entity_state_change(
File "/config/custom_components/powercalc/sensors/power.py", line 490, in _handle_source_entity_state_change
self._power = await self.calculate_power(state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/powercalc/sensors/power.py", line 539, in calculate_power
power = await self._strategy_instance.calculate(entity_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/powercalc/strategy/fixed.py", line 63, in calculate
return await evaluate_power(self._power)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/powercalc/helpers.py", line 23, in evaluate_power
return Decimal(power) # type: ignore[arg-type]
^^^^^^^^^^^^^^
ValueError: argument must be a sequence of length 3
Please let me know, if you need a debug log.
Both errors I didn't see before.
Looking at the first error there is some decimal conversion error for daily fixed sensor.
In your configuration I see you have value: 4,7
. That would probably be the reason. You should use a period there not a comma. value: 4.7
.
The second error it's a similar kind of error where powercalc receives a value which it cannot process. Not sure where it's coming from. I will see if the error can be catched and logged cleaner, including the power value / entity id which is causing the issue.
Understood, thanks. Yes, we have the comma as decimal separator here. That's the cause for my fault. let me know, once there is a new beta out that provides more logging to find that issue.
Thanks for your help and your great integration!
v1.13.0 is released which should log which entity is the problem.
System Health details
System Information
Home Assistant Community Store
GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4815 Installed Version | 1.34.0 Stage | running Available Repositories | 1397 Downloaded Repositories | 32Home Assistant Cloud
logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | okDashboards
dashboards | 6 -- | -- resources | 13 views | 6 mode | storageRecorder
oldest_recorder_run | 20. Juni 2024 um 14:41 -- | -- current_recorder_run | 29. Juni 2024 um 14:43 estimated_db_size | 1411.15 MiB database_engine | sqlite database_version | 3.44.2Spotify
api_endpoint_reachable | ok -- | --Checklist
Describe the issue
2024-06-29 14:44:25.849 ERROR (MainThread) [homeassistant.helpers.event] Error while dispatching event for sensor.standby_und_ports_power to <Job track state_changed event ['sensor.till_tw_power', 'sensor.keller_stahltraeger_licht_power', 'sensor.till_farb_power', 'sensor.standby_und_ports_power', 'switch.tp_link_switch_port_4_poe_enabled', 'switch.tp_link_switch_port_2_poe_enabled', 'switch.tp_link_switch_port_7_poe_enabled', 'switch.tp_link_switch_port_8_poe_enabled', 'sensor.og_charlie_hauptlicht_power', 'sensor.og_schlafzimmer_wand_2_power', 'sensor.eg_gaderobe_power', 'sensor.sat_verteiler_power', 'switch.tp_link_switch_port_5_poe_enabled', 'sensor.eg_wohnzimmer_nordost_power', 'sensor.og_elternbad_spiegel_power', 'sensor.og_schlafzimmer_licht_hendrik_power', 'sensor.og_elternbad_wand_2_power', 'sensor.og_lina_lampe3_power', 'sensor.keller_werkstatt_licht_power', 'switch.tp_link_switch_port_3_poe_enabled', 'sensor.aussen_dachueberstand1_power', 'sensor.og_schlafzimmer_licht_julia_power', 'sensor.keller_waschkeller_licht_power', 'sensor.eg_wohnzimmer_nordwest_power', 'sensor.keller_party_licht_power', 'sensor.og_lina_hauptlicht_power', 'sensor.og_elternbad_duschfarb_power', 'sensor.og_kinderbad_hauptlicht_power', 'sensor.aussen_weg_licht_power', 'sensor.eg_arbeitszimmer_hauptlicht_power', 'sensor.aussen_garage_licht_power', 'sensor.og_lina_lampe1_power', 'sensor.eg_schuppen_hauptlicht_power', 'sensor.aussen_dachueberstand2_power', 'sensor.eg_flur_hauptlicht_power', 'sensor.keller_vorrat_licht_power', 'sensor.kwl_power', 'sensor.eg_treppe_power', 'sensor.og_charlie_lichtost_power', 'sensor.og_schlafzimmer_licht_kleiderschrank_power', 'sensor.wasserstation_power', 'sensor.og_elternbad_hauptlicht_power', 'sensor.aussen_dachueberstand3_power', 'sensor.og_flur_hauptlicht_power', 'sensor.eg_esszimmer_hauptlicht_power', 'sensor.eatonusv_power', 'sensor.og_lina_lampe2_power', 'sensor.homeserver_power', 'sensor.uvr1611_power', 'sensor.eg_wohnzimmer_voute_2_power', 'sensor.eg_arbeitszimmer_farb_2_power', 'sensor.eg_gaestebad_hauptlicht_power', 'sensor.og_charlie_lichtwest_power', 'sensor.eg_wohnzimmer_suedost_power', 'sensor.og_lina_fensterfarb_2_power', 'sensor.keller_haustechnik_licht_power', 'switch.tp_link_switch_port_1_poe_enabled', 'sensor.og_elternbad_klolicht_power', 'sensor.eg_wohnzimmer_suedwest_power', 'sensor.eg_kueche_hauptlicht_power', 'switch.tp_link_switch_port_6_poe_enabled'] HassJobType.Callback <bound method GroupedSensor.on_state_change of>>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 327, in _async_dispatch_entity_id_event
hass.async_run_hass_job(job, event)
File "/usr/src/homeassistant/homeassistant/core.py", line 947, in async_run_hass_job
hassjob.target(*args)
File "/config/custom_components/powercalc/sensors/group.py", line 594, in on_state_change
summed = self.calculate_new_state(available_states, states)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/powercalc/sensors/group.py", line 638, in calculate_new_state
values = [self._get_state_value_in_native_unit(state) for state in member_available_states]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/powercalc/sensors/group.py", line 610, in _get_state_value_in_native_unit
return Decimal(value)
^^^^^^^^^^^^^^
decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]
Reproduction steps
Debug logs
Diagnostics dump or YAML config