Closed BernieV1977 closed 16 hours ago
I have the same problem...
Hi thanks for reporting. Should be fixed with v1.15.3. It's because a new device type has been added to the library but code is not prepared for that. I will see how to make it more robust in the future, so the integration still keeps working regardless if a profile provides a device type which is not known to the code yet.
Still no luck with v1.15.3:
Logger: homeassistant.setup Bron: setup.py:416 Eerst voorgekomen: 17:35:43 (1 gebeurtenissen) Laatst gelogd: 17:35:43
Error during setup of component powercalc Traceback (most recent call last): File "/home/homeassistant/.pyenv/versions/3.12.7/lib/python3.12/site-packages/homeassistant/setup.py", line 416, in _async_setup_component result = await task ^^^^^^^^^^ File "/mnt/dietpi_userdata/homeassistant/custom_components/powercalc/init.py", line 228, in async_setup await discovery_manager.start_discovery() File "/mnt/dietpi_userdata/homeassistant/custom_components/powercalc/discovery.py", line 85, in start_discovery if not await self.is_entity_supported(entity_entry): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/dietpi_userdata/homeassistant/custom_components/powercalc/discovery.py", line 151, in is_entity_supported return power_profile.is_entity_domain_supported(source_entity) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/dietpi_userdata/homeassistant/custom_components/powercalc/power_profile/power_profile.py", line 257, in is_entity_domain_supported self.device_type == DeviceType.SMART_SWITCH and entity_entry and entity_entry.platform in ["hue"] and source_entity.domain == LIGHT_DOMAIN ^^^^^^^^^^^^^^^^ File "/mnt/dietpi_userdata/homeassistant/custom_components/powercalc/power_profile/power_profile.py", line 182, in device_type return DeviceType(device_type) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/homeassistant/.pyenv/versions/3.12.7/lib/python3.12/enum.py", line 757, in call return cls.new(cls, value) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/homeassistant/.pyenv/versions/3.12.7/lib/python3.12/enum.py", line 1171, in new raise ve_exc ValueError: 'vacuum robot' is not a valid DeviceType
Did some further changes with #2675, which should hopefully fix the issue. Also added code to prevent similar issue in the future. v1.15.4 just released. Sorry for the inconvenience.
Thx! Problem solved 👍
Glad its solved. Thanks for reporting and verification.
System Health details
System Information
Home Assistant Community Store
GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok HACS Data | ok GitHub API Calls Remaining | 5000 Installed Version | 2.0.1 Stage | running Available Repositories | 1468 Downloaded Repositories | 54Home Assistant Cloud
logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | okDashboards
dashboards | 4 -- | -- resources | 37 views | 11 mode | storageRecorder
oldest_recorder_run | 3 november 2024 om 13:19 -- | -- current_recorder_run | 13 november 2024 om 08:33 estimated_db_size | 1381.09 MiB database_engine | sqlite database_version | 3.40.1Spotify
api_endpoint_reachable | ok -- | --Checklist
Describe the issue
The Powercalc component failed to setup. Error in the log: ValueError: 'vacuum robot' is not a valid DeviceType I have some virtual power entities related to my vacuum robots, so maybe related?
Reproduction steps
After upgrading the Powercalc integration and a reboot -> failed to setup
Debug logs
Diagnostics dump or YAML config
platform: powercalc entity_id: vacuum.sarah ignore_unavailable_state: true standby_power: 2.2 fixed: power: 0.5 states_power: docked: > {% if state_attr('vacuum.sarah', 'battery_level') | int(0) == 100 %} 2.2 {% elif state_attr('vacuum.sarah', 'battery_level') | int(0) > 90 and state_attr('vacuum.sarah', 'battery_level') | int(0) < 100 %} 13 {% elif state_attr('vacuum.sarah', 'battery_level') | int(0) < 90 %} 20 {% endif %} cleaning: 0.5 paused: 0.5 idle: 0.5 returning: 0.5 error: 0.5
platform: powercalc entity_id: vacuum.james ignore_unavailable_state: true standby_power: 3 fixed: power: 0.5 states_power: docked: > {% if state_attr('vacuum.james', 'battery_level') | int(0) == 100 %} 3 {% elif state_attr('vacuum.james', 'battery_level') | int(0) > 95 and state_attr('vacuum.james', 'battery_level') | int(0) < 100 %} 15 {% elif state_attr('vacuum.james', 'battery_level') | int(0) < 95 %} 22 {% endif %} cleaning: 0.1 paused: 3 idle: 3 returning: 22 error: 3
platform: powercalc entity_id: vacuum.max ignore_unavailable_state: true standby_power: 0 fixed: power: 0 states_power: cleaning: 85 paused: 3.5 idle: 3.5 error: 3.5