bramstroker / homeassistant-powercalc

Custom component to calculate estimated power consumption of lights and other appliances
MIT License
1.04k stars 266 forks source link

All groups are unavailable after HA 2024.4 beta #2163

Closed gieljnssns closed 8 months ago

gieljnssns commented 8 months ago

System Health details

System Information

version core-2024.4.0b0
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.2
os_name Linux
os_version 6.6.20-haos
arch x86_64
timezone Europe/Brussels
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4986 Installed Version | 1.34.0 Stage | running Available Repositories | 1486 Downloaded Repositories | 56 HACS Data | ok
Home Assistant Supervisor host_os | Home Assistant OS 12.1 -- | -- update_channel | beta supervisor_version | supervisor-2024.03.1 agent_version | 1.6.0 docker_version | 24.0.7 disk_total | 457.7 GB disk_used | 125.3 GB healthy | true supported | true board | generic-x86-64 supervisor_api | ok version_api | ok installed_addons | Samba share (12.3.1), AdGuard Home (5.0.5), AppDaemon (0.16.4), Caddy (1.6), Duck DNS (1.16.0), ESPHome (2024.3.1), Mosquitto broker (6.4.0), Studio Code Server (5.15.0), WireGuard (0.10.2), Advanced SSH & Web Terminal (17.2.0), Home Assistant Google Drive Backup (0.112.1), Frigate (Full Access) (0.13.2), Glances (0.21.1), Piper (1.5.0), Whisper (2.0.0), SQLite Web (4.1.2), Music Assistant BETA (2.0.0b125), openWakeWord (1.10.0), Assist Microphone (1.2.0), EMHASS (0.8.4)
Dashboards dashboards | 9 -- | -- resources | 26 views | 37 mode | storage
Recorder oldest_recorder_run | August 4, 2023 at 08:38 -- | -- current_recorder_run | March 28, 2024 at 11:57 estimated_db_size | 2011.39 MiB database_engine | sqlite database_version | 3.44.2
Solcast PV Forecast can_reach_server | ok -- | -- used_requests | 12 rooftop_site_count | 2
Xiaomi Miot Auto component_version | 0.7.17 -- | -- can_reach_server | ok can_reach_spec | ok logged_accounts | 1 total_devices | 2

Checklist

Describe the issue

I'm using the april beta and everyting from groups is unavailable

Reproduction steps

  1. Use HA beta
  2. ...

Debug logs

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:356
integration: Sensor (documentation, issues)
First occurred: 13:14:16 (6 occurrences)
Last logged: 13:14:16

Error while setting up powercalc platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/powercalc/sensor.py", line 335, in async_setup_entry
    entities = await create_group_sensors_gui(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/powercalc/sensors/group.py", line 160, in create_group_sensors_gui
    return await create_group_sensors(hass, group_name, sensor_config, power_sensor_ids, energy_sensor_ids)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/powercalc/sensors/group.py", line 176, in create_group_sensors
    create_grouped_power_sensor(
  File "/config/custom_components/powercalc/sensors/group.py", line 407, in create_grouped_power_sensor
    return GroupedPowerSensor(
           ^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/powercalc/sensors/group.py", line 482, in __init__
    self._prev_state_store: PreviousStateStore = PreviousStateStore(self.hass)
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/powercalc/sensors/group.py", line 774, in __init__
    self.store: Store = PreviousStateStoreStore(
                        ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/storage.py", line 271, in __init__
    self._manager = get_internal_store_manager(hass, config_dir)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/storage.py", line 107, in get_internal_store_manager
    if STORAGE_MANAGER not in hass.data:
                              ^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'data'

Diagnostics dump or YAML config

No response

gieljnssns commented 8 months ago

Full debug log 2024-03-28 13:14:16.log

bramstroker commented 8 months ago

Thanks, was able to reproduce already. Fixed with #2162

bramstroker commented 8 months ago

Are you able to verify by installing the master branch for powercalc (you can do with HACS). Click redownload and make sure to also check "beta version" checkbox.

gieljnssns commented 8 months ago

I've applied your changes and it is working again. Thanks

bramstroker commented 8 months ago

Thanks for reporting and testing! I'll issue a new release shortly.

bramstroker commented 8 months ago

Release 1.11.4 released yesterday.