Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Not working any more with core 2024.1.0 #67

Open
acdcnow opened this issue Jan 1, 2024 · 31 comments
Open

Not working any more with core 2024.1.0 #67

acdcnow opened this issue Jan 1, 2024 · 31 comments

Comments

@acdcnow
Copy link

acdcnow commented Jan 1, 2024

Logger: homeassistant.loader
Source: loader.py:842
First occurred: 07:40:00 (1 occurrences)
Last logged: 07:40:00

Unexpected exception importing platform custom_components.climate_group.climate
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 842, in get_platform
cache[full_name] = self._import_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 859, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/config/custom_components/climate_group/climate.py", line 66, in
SUPPORT_TARGET_TEMPERATURE | SUPPORT_TARGET_TEMPERATURE_RANGE | SUPPORT_PRESET_MODE | SUPPORT_SWING_MODE | SUPPORT_FAN_MODE
^^^^^^^^^^^^^^^^^^^^^^^^^^
NameError: name 'SUPPORT_TARGET_TEMPERATURE' is not defined

@erikpendragon
Copy link

erikpendragon commented Jan 1, 2024

Delete the integration in HACS, and add this fork https://github.com/IIsSchulstad/climate_group, I didn't need to change anything else in my config

@trivi
Copy link

trivi commented Jan 4, 2024

None of the forks are working properly for me, attempting to interact with it using Lovelace controls never successfully turns it off. @erikpendragon could you test it? please

@erikpendragon
Copy link

I am running 1.0.0-rc6 and it works as expected

@msaphoto06
Copy link

Same here. disabled status does not work..

@lweberru
Copy link

lweberru commented Jan 4, 2024

`For the fork, log says:

TypeError: argument of type 'State' is not iterable
2024-01-04 10:38:58.885 ERROR (MainThread) [homeassistant.helpers.event] Error while dispatching event for climate.handtuchwarmer_2 to
 <Job track state_changed event ['climate.bad_heizung', 'climate.handtuchwarmer_2'] HassJobType.Callback <function ClimateGroup.async_
added_to_hass.<locals>.async_state_changed_listener at 0x836fe398>>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 296, in _async_dispatch_entity_id_event
    hass.async_run_hass_job(job, event)
  File "/usr/src/homeassistant/homeassistant/core.py", line 715, in async_run_hass_job
    hassjob.target(*args)
  File "/config/custom_components/climate_group/climate.py", line 179, in async_state_changed_listener
    and "attributes" in event.data["new_state"]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'State' is not iterable 

@thordi55
Copy link

thordi55 commented Jan 4, 2024

`For the fork, log says:

TypeError: argument of type 'State' is not iterable
2024-01-04 10:38:58.885 ERROR (MainThread) [homeassistant.helpers.event] Error while dispatching event for climate.handtuchwarmer_2 to
 <Job track state_changed event ['climate.bad_heizung', 'climate.handtuchwarmer_2'] HassJobType.Callback <function ClimateGroup.async_
added_to_hass.<locals>.async_state_changed_listener at 0x836fe398>>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 296, in _async_dispatch_entity_id_event
    hass.async_run_hass_job(job, event)
  File "/usr/src/homeassistant/homeassistant/core.py", line 715, in async_run_hass_job
    hassjob.target(*args)
  File "/config/custom_components/climate_group/climate.py", line 179, in async_state_changed_listener
    and "attributes" in event.data["new_state"]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'State' is not iterable 

I have the same Error code every time the thermostate gets controlled...

@jafar-atili
Copy link

Same for me:

Logger: homeassistant.config
Source: config.py:1483
First occurred: January 3, 2024 at 11:08:48 PM (2 occurrences)
Last logged: January 3, 2024 at 11:08:48 PM

Platform error: climate - Exception importing custom_components.climate_group.climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 842, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 859, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/climate_group/climate.py", line 66, in <module>
    SUPPORT_TARGET_TEMPERATURE | SUPPORT_TARGET_TEMPERATURE_RANGE | SUPPORT_PRESET_MODE | SUPPORT_SWING_MODE | SUPPORT_FAN_MODE
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
NameError: name 'SUPPORT_TARGET_TEMPERATURE' is not defined

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config.py", line 1483, in async_process_component_config
    platform = p_integration.get_platform(domain)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 851, in get_platform
    raise ImportError(
ImportError: Exception importing custom_components.climate_group.climate

@cobirnm
Copy link

cobirnm commented Jan 4, 2024

I tryed to install 1.0.0-rc6 and all modes work except turning off. Has anyone found a solution since this is not maintained?

@MacrosorcH
Copy link

Since 1.0.0-rc6 is not working well for me either, I started from 0.6.0 and edited climate.py fixing all the errors reported by HA. The resulting version is attached below and works well for me.
To use it, rename it to climate.py and overwrite /homeassistant/custom_components/climate_group/climate.py with this version.
climate.py.txt

@snigehere
Copy link

snigehere commented Jan 4, 2024

Thanks for doing this - Installed and working again
One of the issues that 1.0.0-rc6 was supposed to address was being able to assign a unique ID to the config so that some of the UI functions worked .. although 006 added this it broke other stuff so was not usable.
eg:
#group living room rad trv's - hacs integration
- platform: climate_group
name: "Living room radiator"
# uuid generated by https://www.uuidgenerator.net/version4
unique_id: 664a190f-cf35-4347-aa52-b4657b05f36f
# need new release of code to make this work - beta 6 failed
temperature_unit: C # default to celsius, 'C' or 'F'
entities:
- climate.living_room_main_radiator
- climate.living_room_side_radiator

@bjrnptrsn
Copy link

I only use heating thermostats and have found a solution that works for me (https://github.com/bjrnptrsn/climate_group)

@B1199
Copy link

B1199 commented Jan 5, 2024

I only use heating thermostats and have found a solution that works for me (https://github.com/bjrnptrsn/climate_group)

This also works for me now. Thanks

@cobirnm
Copy link

cobirnm commented Jan 5, 2024

Since 1.0.0-rc6 is not working well for me either, I started from 0.6.0 and edited climate.py fixing all the errors reported by HA. The resulting version is attached below and works well for me. To use it, rename it to climate.py and overwrite /homeassistant/custom_components/climate_group/climate.py with this version. climate.py.txt

This correction worked like a charm for me!!! Thank you!!!!

@the-baumis
Copy link

I only use heating thermostats and have found a solution that works for me (https://github.com/bjrnptrsn/climate_group)

Hey bjrnptrsn,

thank you very much for your help. The integration also works for me

@MacrosorcH
Copy link

Update: with HA 2024.1.1, Climate Group version 0.6.0 works again without any modifications.
It just raises a number of deprecation warnings at startup, to be addressed before 2025.1.
By then, hopefully this super-useful integration will have found its way into HA-core. Fingers crossed!

@jokerigno
Copy link

Here's there is a change in the code that can be merged.

home-assistant/core#107024 (comment)

@erikpendragon
Copy link

does https://github.com/bjrnptrsn/climate_group this fix the unique ID that 1.0.0-rc6 was supposed to fix?

@bjrnptrsn
Copy link

does https://github.com/bjrnptrsn/climate_group this fix the unique ID that 1.0.0-rc6 was supposed to fix?

Yes, unique_id works as this version is based on 1.0.0-rc6
I have just released version 1.0.2 with minor changes and updated README

@alexeiw123
Copy link

does https://github.com/bjrnptrsn/climate_group this fix the unique ID that 1.0.0-rc6 was supposed to fix?

Yes, unique_id works as this version is based on 1.0.0-rc6 I have just released version 1.0.2 with minor changes and updated README

Oh I'm having trouble keeping up.

So this repository we're commenting is deprecated right?

I moved to https://github.com/IIsSchulstad/climate_group as requested earlier, and made some tweaks to .py to allow the rounding of figures to .5 accuracy, to avoid errors when changing the temperature of a group. For anyone else that has the same issue, the code below fixes it for me. Perhaps this could be added to the right repository as a PR but I figure it needs to configurable to different accuracy to be user friendly.

        # Temperature settings
        self._attr_target_temperature = round(
            reduce_attribute(states, ATTR_TEMPERATURE, reduce=lambda *data: mean(data)) * 2
        ) / 2

Sounds like I should move again to https://github.com/bjrnptrsn/climate_group to remove the errors in the HA logs?

@bjrnptrsn
Copy link

...and made some tweaks to .py to allow the rounding of figures to .5 accuracy, to avoid errors when changing the temperature of a group. For anyone else that has the same issue, the code below fixes it for me. Perhaps this could be added to the right repository as a PR but I figure it needs to configurable to different accuracy to be user friendly.

        # Temperature settings
        self._attr_target_temperature = round(
            reduce_attribute(states, ATTR_TEMPERATURE, reduce=lambda *data: mean(data)) * 2
        ) / 2

Thanks for that idea, I implemented it with Version 1.0.3

@alexeiw123
Copy link

Thanks for that idea, I implemented it with Version 1.0.3

@bjrnptrsn - on v1.0.3, I'm no longer able to use service: climate.turn_on on the climate group entity anymore. I can use service: climate.set_hvac_mode to turn it on but it adds a lot of complication to set the right mode. This used to work previously for me.
Failed to call service climate.turn_on. Entity climate.climate_all_zones does not support this service

I know this isn't the right place for it but your fork https://github.com/bjrnptrsn/climate_group doesn't have an issues or discussions page on it.

@msaphoto06
Copy link

HS with 2024.4 😞

@alexeiw123
Copy link

HS with 2024.4 😞

Not sure what HS is but, yes, 2024.4 has some sort of breaking change for this (note I'm using https://github.com/bjrnptrsn/climate_group).

Platform error: climate - cannot import name 'GroupEntity' from 'homeassistant.components.group' (/usr/src/homeassistant/homeassistant/components/group/__init__.py)

@lweberru
Copy link

lweberru commented Apr 4, 2024

I am no python expert, but I think the import should be from homeassistant.component.group.entity

@BWFCGUIXT
Copy link

BWFCGUIXT commented Apr 4, 2024

You are 100% correct :) just changed it and my climate groups are working again.

Opened a Pull Request.

@UlrichThiess
Copy link

homeassistant.components.group.entity

you forgotten the s

@alexeiw123
Copy link

@bjrnptrsn I just made a fork of your fork to submit a PR for your version but see you're all over it :) You must have just merged the changes because I checked for an update before doing it!

@bjrnptrsn
Copy link

you were all much faster, i hadn't even installed the latest HA version at the time :)

@lweberru
Copy link

lweberru commented Apr 9, 2024

Just have seen the following repro:
https://github.com/tetele/hvac_group
anyone has tested it already. Is it similar to this one? Has a helper integration, so could be a replacement for this one here.

@AngeloAna
Copy link

Just have seen the following repro: https://github.com/tetele/hvac_group anyone has tested it already. Is it similar to this one? Has a helper integration, so could be a replacement for this one here.

Tried testing with Honeywell thermostats. The high and low temp keep changing to 35 and 35 degrees no matter what I do.

@bcutter
Copy link

bcutter commented Aug 7, 2024

Thanks for that idea, I implemented it with Version 1.0.3

@bjrnptrsn - on v1.0.3, I'm no longer able to use service: climate.turn_on on the climate group entity anymore. I can use service: climate.set_hvac_mode to turn it on but it adds a lot of complication to set the right mode. This used to work previously for me. Failed to call service climate.turn_on. Entity climate.climate_all_zones does not support this service

I know this isn't the right place for it but your fork https://github.com/bjrnptrsn/climate_group doesn't have an issues or discussions page on it.

Discovered the same just today accidentally (late to the party, I know). This bug and the lack of "continue_on_error: true" created some serious security issues in my coming/leaving home automations for 6 days now... -.-

Just to be clear:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests