home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.98k stars 31.03k forks source link

Error of entity climate thermostat (bticino smarther 2) when it’s in cooling mode #118336

Open Tagliax opened 6 months ago

Tagliax commented 6 months ago

The problem

Entity stop working when the mode change from heating to cooling (set by home+ control app).

This is in heating mode (note that the cooling mode is missing): IMG_1372

After change mode: IMG_1371

The entity stop to work (see log) home-assistant_netatmo_2024-05-28T23-02-27.466Z.log

What version of Home Assistant Core has the issue?

core-2024.5.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Netatmo, Climate

Link to integration documentation on our website

https://www.home-assistant.io/integrations/netatmo/

Diagnostics information

config_entry-netatmo-e3eb476d5a41a767418bdf6427036a50.json

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 6 months ago

Hey there @cgtobi, mind taking a look at this issue as it has been labeled with an integration (netatmo) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `netatmo` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign netatmo` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


netatmo documentation netatmo source (message by IssueLinks)

Tagliax commented 5 months ago

Does anyone have the same problem in cooling mode? I know it's not used much but I need it for fan cooling with a heat pump.

cgtobi commented 5 months ago

The integration is just missing a matching preset. I'll take a look later.

cgtobi commented 5 months ago

Would it be possible to provide me the results from homestatus and homesdata? Feel free to PM me on Discord since those data contains sensitive data.

Tagliax commented 5 months ago

Feel free to PM me on Discord since those data contains sensitive data.

I sent you a request on Discord πŸ‘πŸ»

Tagliax commented 5 months ago

@cgtobi Hi Tobias, how's it going? Feel free to update me on discord too πŸ™‚

Gioez73 commented 5 months ago

Hi all, do you have some news about this?

Danton73 commented 5 months ago

Hello everyone, I have also noticed that the Smarther device no longer works when switching to cooling mode. This issue only occurs on Home Assistant (I'm using the Netatmo integration), while Alexa and the mobile apps continue to function as before.

Tagliax commented 5 months ago

Hi all, do you have some news about this?

I sent the logs to @cgtobi, I think he's working on it. He told me (last week) on Discord that the problem takes time to fix…

Danton73 commented 5 months ago

Hello, I conducted some tests: by setting the Smarther to heating mode and restarting Home Assistant, everything works correctly. If it is set to cooling mode, the Lovelace dashboard does not display the state change (it continues to show it as heating), and if Home Assistant is restarted, it does not reconnect even for viewing. It reconnects when switched back to heating mode and restarting Home Assistant.

Tagliax commented 4 months ago

Hi everyone. @cgtobi just updated me about the developments. He’s more or less done with the library and need to implement the HA part! πŸ™‚

Danton73 commented 4 months ago

Hi everyone. @cgtobi just updated me about the developments. He’s more or less done with the library and need to implement the HA part! πŸ™‚

Hi, thanks for the update. When there are any news, let us know. At the moment, I have an unknown device.

bluesaphire76 commented 4 months ago

Hi everyone, same issue here like @Tagliax on my HA (with the latest update: core 2024.7.3, supervisor 2024.06.2)

Tagliax commented 4 months ago

Hi everyone, same issue here like @Tagliax on my HA (with the latest update: core 2024.7.3, supervisor 2024.06.2)

Hi, yes, it is a systematic error that occurs only for those who use the thermostat in cooling mode. @cgtobi is working on it and we hope he will release the bugfix soon! πŸ™‚

Danton73 commented 3 months ago

Does anyone know if the problem has been solved?

Tagliax commented 3 months ago

Does anyone know if the problem has been solved?

Hi! Not yet, let's hope for a response from @cgtobi, unfortunately I haven't heard from him for almost a month...

softwarebloat commented 3 months ago

@Tagliax do you know if there's already a branch pushed or an opened PR for this? (i can't find it but maybe there is one)

Tagliax commented 3 months ago

@softwarebloat Hi!

@cgtobi just wrote to me on discord: β€œHi, sorry for not getting back earlier. The pyatmo part is done but can't be released currently. I've talked to the ower to help out. Once that is done we can continue testing and brinigng this to HA.”

softwarebloat commented 3 months ago

the pyatmo part has been merged and released in v8.1.0!! πŸ₯³ @cgtobi let me know if you need any help in testing this when integrating with homeassistant! πŸ™

Tagliax commented 2 months ago

Hi! v8.1.0 was released in 2024.9! What are the next steps? @cgtobi

cgtobi commented 2 months ago

First step would be to see if the error is still the same. Since this issue was created a while back, please provide a fresh error log so I can fix the remaining issue within HA. Thanks

softwarebloat commented 2 months ago

@cgtobi i can see this two errors:

first:

Logger: homeassistant
Source: components/netatmo/climate.py:412

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 190, in async_update
    error = await self.async_fetch_data(publisher)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 248, in async_fetch_data
    update_callback()
  File "/usr/src/homeassistant/homeassistant/components/netatmo/climate.py", line 412, in async_update_callback
    self._attr_preset_mode = NETATMO_MAP_PRESET[
                             ^^^^^^^^^^^^^^^^^^^
KeyError: None

second:

Logger: homeassistant
Source: components/climate/__init__.py:323

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 1047, in _async_update_entity_states
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 960, in async_update_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state
    self.__async_calculate_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1069, in __async_calculate_state
    if state_attributes := self.state_attributes:
                           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 323, in __getattribute__
    return super().__getattribute__(__name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 561, in state_attributes
    data[ATTR_PRESET_MODE] = self.preset_mode
                             ^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 323, in __getattribute__
    return super().__getattribute__(__name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/functools.py", line 995, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 643, in preset_mode
    return self._attr_preset_mode
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 323, in __getattribute__
    return super().__getattribute__(__name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 323, in __getattribute__
    return super().__getattribute__(__name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NetatmoThermostat' object has no attribute '__attr_preset_mode'. Did you mean: '__attr_preset_modes'?
softwarebloat commented 2 months ago

@cgtobi i've started this but yeah, i'd like to help but totally new to home assistant project so probably my help isn't really needed here. still learning/reading the integration code

cgtobi commented 2 months ago

Any contribution is greatly appreciated. I'll take a look shortly. I assume this fixes the issue for you locally? Happy to chat about it on discord if you like.

softwarebloat commented 2 months ago

having some troubles setting up home assistant locally. i think that requires more work and also adding tests. i started the draft just not to lose what i think should fix my error logs but probably isn't enough

Tagliax commented 2 months ago

Any contribution is greatly appreciated. I'll take a look shortly. I assume this fixes the issue for you locally? Happy to chat about it on discord if you like.

Hi Tobias, here is the log when I activate the climate entity home-assistant_netatmo_2024-09-07T13-34-37.424Z.log

kamaradclimber commented 2 months ago

:wave: Β I face the same issue on https://github.com/kamaradclimber/heishamon-homeassistant/issues/250 and can reproduce it with the following code:

from homeassistant.components.climate import ClimateEntity

class ChildClass(ClimateEntity):
    def __init__(self):
        super().__init__()
        print("After this, the bug:")
        print(self._attr_min_temp)
        print("this displays if we don't have the bug")

a = ChildClass()

I think the bug happens only if the attribute in question has not been set first, but the error message is confusing.

llo871 commented 2 months ago

Hi,

In my case, also, the cooling/heating programme switch menu was missing on the Bticino Control app (Home + Control) on my Android phone. It was showing on an iPhone, but it would not work at all. Hence, I had no way of switching between heating and cooling programmes on the thermostats. I don't really know whether this is relevant or not to this particular issue, but I also have been having the same problem on Homeassistant as everyone is reporting here.

I called the Bticino support, and after 15 minutes on the phone, they told me that there is a known issue, where your door camera (Bticino Classe 300EOS, in my case), interferes with the API somewhere inside the guts of Bticino/Netatmo servers. This wouldn't make any sense to me, as I control the door camera with the separate Home + Security app.

Following their instructions, I just removed all the door camera references from my app, and magically, in a minute, all went back as expected, both in the Android App, and on the Homeassistant integration into the API. I can now switch heating/cooling modes, both from the phone app, and HA.

Hope this helps, if not on the development (as it may be a Bticino internal issue), at least to have a walkaround and not have cold winter days at homes.

Regards.

Danton73 commented 2 months ago

Hi,

In my case, also, the cooling/heating programme switch menu was missing on the Bticino Control app (Home + Control) on my Android phone. It was showing on an iPhone, but it would not work at all. Hence, I had no way of switching between heating and cooling programmes on the thermostats. I don't really know whether this is relevant or not to this particular issue, but I also have been having the same problem on Homeassistant as everyone is reporting here.

I called the Bticino support, and after 15 minutes on the phone, they told me that there is a known issue, where your door camera (Bticino Classe 300EOS, in my case), interferes with the API somewhere inside the guts of Bticino/Netatmo servers. This wouldn't make any sense to me, as I control the door camera with the separate Home + Security app.

Following their instructions, I just removed all the door camera references from my app, and magically, in a minute, all went back as expected, both in the Android App, and on the Homeassistant integration into the API. I can now switch heating/cooling modes, both from the phone app, and HA.

Hope this helps, if not on the development (as it may be a Bticino internal issue), at least to have a walkaround and not have cold winter days at homes.

Regards.

Hi, thanks for your interesting explanation. I have the same setup as you, except for the iPhone. I would be interested in understanding how you removed all door cameras to see if I can also resolve the "unknown object" issue when my Bticino Smarther is configured for cooling.

llo871 commented 2 months ago

Hi, thanks for your interesting explanation. I have the same setup as you, except for the iPhone. I would be interested in understanding how you removed all door cameras to see if I can also resolve the "unknown object" issue when my Bticino Smarther is configured for cooling.

My setup is in not in English language, however, I'll try to translate the buttons, sorry if the menu descriptions don't fully match. First click on the gear icon on the lower right, and the first option should be "Manage Home", or something alike. There you shall see the rooms. open each room, and just choose all items that are not the thermostats, and with the three dots on the upper right, remove them, especially the cameras.

That did the trick.

Tagliax commented 1 month ago

Hello everyone!

I'll update you about the problem, @cgtobi has solved the problem, I think it's close to release.

Danton73 commented 1 month ago

Hello everyone!

I'll update you about the problem, @cgtobi has solved the problem, I think it's close to release.

I have updated my Home Assistant core to version 2024.10.0, but I still have the Smarther entity as unknown (set to cooling mode). Is there something that needs to be done to make it work?

softwarebloat commented 1 month ago

@Danton73 i don't think it has been released yet

llo871 commented 1 month ago

I received a notification update on my HA for the netatmo_custom (latest version c373fc9). Does this solve the issue?

Seems that my removal of the doorbell camera made it work for a while, but the option to change the heating program is gone again :(

Tagliax commented 3 weeks ago

Guys @cgtobi didn't answer me anymore on Discord, he had worked on the problem solving it, I don't know what happened to him...😞

softwarebloat commented 2 weeks ago

Guys @cgtobi didn't answer me anymore on Discord, he had worked on the problem solving it, I don't know what happened to him...😞

hopefully he's all right do you know if the changes were pushed? i can't find anything 😞

Tagliax commented 2 weeks ago

hopefully he's all right do you know if the changes were pushed? i can't find anything 😞

No he didn’t unfortunately...😞