tetele / hvac_group

Group together `climate` components for easy control
MIT License
25 stars 5 forks source link

Error while setting up hvac_group platform for climate #42

Closed BenJamesAndo closed 8 months ago

BenJamesAndo commented 8 months ago

System Health details

System Information

version core-2024.1.0
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.11.6
os_name Linux
os_version 6.1.70-haos
arch x86_64
timezone Australia/Brisbane
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4754 Installed Version | 1.33.0 Stage | running Available Repositories | 1390 Downloaded Repositories | 43 HACS Data | ok
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 11.3.rc2 -- | -- update_channel | beta supervisor_version | supervisor-2023.12.1 agent_version | 1.6.0 docker_version | 24.0.7 disk_total | 125.3 GB disk_used | 66.0 GB healthy | true supported | true board | ova supervisor_api | ok version_api | ok installed_addons | Samba share (12.2.0), Filebrowser (2.23.0_10), AdGuard Home (5.0.1), Advanced SSH & Web Terminal (17.0.1), FTP (4.7.3), Firefox (1.0.7), Gitea (1.21.3), Guacamole Client (testnoupload-4), Home Assistant Google Drive Backup (0.112.1), MariaDB (2.6.1), Node-RED (16.0.2), Rclone Backup (3.0.1), ResilioSync (2.7.3-12), Simple Scheduler (2.2.1), Syncthing (1.17.0), wgeasy (9), ESPHome (2023.12.5), TasmoAdmin (0.28.0), Mosquitto broker (6.4.0), Uptime Kuma (0.10.1), Zigbee2MQTT (1.35.0-1), Terminal & SSH (9.8.1), Home Panel (2.7.0), Apache2 Minimal with MariaDB Client (2.7.8)
Dashboards dashboards | 2 -- | -- resources | 28 views | 5 mode | storage
Recorder oldest_recorder_run | December 26, 2023 at 7:37 PM -- | -- current_recorder_run | January 4, 2024 at 9:26 AM estimated_db_size | 350.90 MiB database_engine | sqlite database_version | 3.41.2

Checklist

Describe the issue

Hello. Thanks for making this. I'm keen to give it a whirl. I've tested it on HA 2023.12 and 2024.01 and it doesn't work on either. I set up the HVAC Group helper and it then shows a red exclamation icon next to it. Checking log shows errors. No climate entity is created to control the group.

image

image

Reproduction steps

  1. Install integration via HACS
  2. Set up helper ...

Debug logs

DEVICE_CLASS_TEMPERATURE was used from hvac_group, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.TEMPERATURE instead, please create a bug report at https://github.com/tetele/hvac_group/issueshttps://github.com/tetele/hvac_group/issues

Logger: homeassistant.components.climate
Source: helpers/entity_platform.py:360
Integration: Climate (documentation, issues)
First occurred: 9:31:05 AM (1 occurrences)
Last logged: 9:31:05 AM

Error while setting up hvac_group platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 360, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/hvac_group/climate.py", line 109, in async_setup_entry
    heaters=hvac_actuator_entity_ids[CONF_HEATERS],
            ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'heaters'

Logger: homeassistant.config_entries
Source: config_entries.py:406
First occurred: 9:33:09 AM (1 occurrences)
Last logged: 9:33:09 AM

Error setting up entry House Climate for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 213, in async_setup_entry
    return await component.async_setup_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 188, in async_setup_entry
    raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!

Logger: homeassistant.components.sensor
Source: helpers/deprecation.py:204
Integration: Sensor (documentation, issues)
First occurred: 9:28:29 AM (2 occurrences)
Last logged: 9:28:29 AM

Diagnostics dump

No response

tetele commented 8 months ago

Thanks for the report! The main purpose of this was to group together a heater and an AC, so I never thought to allow the usage of only coolers, such as in your case.

Anyway, it's not a complicated fix, expect a new release in the next week or so. Until then, if you want to test things out, you can create a group containing a heater, too. Mind you, an AC unit which can do heating can be both a heater and a cooler, in case you don't have any other climate entities.

BenJamesAndo commented 8 months ago

Ah I see, that makes sense. Yes my use case is similar to what climate_group offers. But I see now this project is quite different. Very cool what it can do though.

Until then, if you want to test things out, you can create a group containing a heater, too.

I tried that and it's working now, thanks.