core icon indicating copy to clipboard operation
core copied to clipboard

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

Open Tagliax opened this issue 1 year ago • 34 comments

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

Tagliax avatar May 28 '24 23:05 Tagliax

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)

home-assistant[bot] avatar May 28 '24 23:05 home-assistant[bot]

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.

Tagliax avatar Jun 07 '24 22:06 Tagliax

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

cgtobi avatar Jun 09 '24 07:06 cgtobi

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.

cgtobi avatar Jun 09 '24 07:06 cgtobi

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

I sent you a request on Discord 👍🏻

Tagliax avatar Jun 09 '24 22:06 Tagliax

@cgtobi Hi Tobias, how's it going? Feel free to update me on discord too 🙂

Tagliax avatar Jun 21 '24 19:06 Tagliax

Hi all, do you have some news about this?

Gioez73 avatar Jun 25 '24 14:06 Gioez73

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.

Danton73 avatar Jun 26 '24 09:06 Danton73

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…

Tagliax avatar Jun 27 '24 08:06 Tagliax

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.

Danton73 avatar Jun 27 '24 09:06 Danton73

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! 🙂

Tagliax avatar Jul 08 '24 13:07 Tagliax

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.

Danton73 avatar Jul 10 '24 06:07 Danton73

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

bluesaphire76 avatar Jul 21 '24 13:07 bluesaphire76

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! 🙂

Tagliax avatar Jul 22 '24 14:07 Tagliax

Does anyone know if the problem has been solved?

Danton73 avatar Aug 20 '24 05:08 Danton73

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...

Tagliax avatar Aug 20 '24 09:08 Tagliax

@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)

softwarebloat avatar Aug 20 '24 09:08 softwarebloat

@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.”

Tagliax avatar Aug 20 '24 10:08 Tagliax

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! 🙏

softwarebloat avatar Aug 21 '24 07:08 softwarebloat

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

Tagliax avatar Sep 06 '24 23:09 Tagliax

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

cgtobi avatar Sep 07 '24 07:09 cgtobi

@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 avatar Sep 07 '24 08:09 softwarebloat

@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

softwarebloat avatar Sep 07 '24 08:09 softwarebloat

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.

cgtobi avatar Sep 07 '24 09:09 cgtobi

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

softwarebloat avatar Sep 07 '24 09:09 softwarebloat

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

Tagliax avatar Sep 07 '24 13:09 Tagliax

: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.

kamaradclimber avatar Sep 20 '24 14:09 kamaradclimber

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.

llo871 avatar Sep 26 '24 08:09 llo871

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.

Danton73 avatar Sep 26 '24 09:09 Danton73

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.

llo871 avatar Sep 26 '24 09:09 llo871