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
70.48k stars 29.41k forks source link

Netatmo integration stop working partially #79943

Closed Betacart closed 1 year ago

Betacart commented 1 year ago

The problem

When try to set temperature in Netatmo integration based on automation, 2 out of 3 valves not responding.

What version of Home Assistant Core has the issue?

2022.10.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Netatmo

Link to integration documentation on our website

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

Diagnostics information

config_entry-netatmo-4fcdf11f07945c5a07f3f16aee269f1c.json.txt

Example YAML snippet

alias: "***ložnice***"
description: ""
trigger:
  - type: opened
    platform: device
    device_id: ed45a75c11b32dd787129fc86d726f6b
    entity_id: binary_sensor.loznice_okno_opening
    domain: binary_sensor
    id: okno_open
  - type: opened
    platform: device
    device_id: eeec3856080fe61878b8cb402469916d
    entity_id: binary_sensor.loznice_balkon_opening
    domain: binary_sensor
    id: balkon_open
condition:
  - condition: state
    entity_id: climate.loznice_ventil
    attribute: preset_mode
    state: Schedule
action:
  - choose:
      - conditions:
          - condition: or
            conditions:
              - condition: trigger
                id: okno_open
              - condition: trigger
                id: balkon_open
        sequence:
          - service: climate.set_temperature
            data:
              temperature: 9
            target:
              entity_id: climate.loznice_ventil
          - service: light.toggle
            data:
              color_name: darkviolet
              brightness_pct: 100
              flash: long
            target:
              entity_id: light.loznice_lampa
mode: single

Anything in the logs that might be useful for us?

No response

Additional information

This automation simply checks opened window and door. If opened, and valůve is set to SCHEDULE before, it should change temperature of valve to 9 degrees and light up lamp. When run this automation, temperature is not changed and lamp not lit. If disable "service: climate.set_temperature", lamp does light. This problem occurs with 2 valves. Same automation for other valve is working well.

homeassistant commented 1 year 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! (message by CodeOwnersMention)


netatmo documentation netatmo source (message by IssueLinks)

cgtobi commented 1 year ago

Please provide logs and diagnostics output.

Betacart commented 1 year ago

Diagnostics information is already attached (https://github.com/home-assistant/core/files/9742049/config_entry-netatmo-4fcdf11f07945c5a07f3f16aee269f1c.json.txt).

Log is here: `Logger: homeassistant.components.automation.aaa Source: components/netatmo/climate.py:326 Integration: Automatizace (documentation, issues) First occurred: 17:25:24 (12 occurrences) Last logged: 19:04:36

aaa: Choose at step 1: choice 1: Error executing script. Unexpected error for call_service at pos 1: 406 - Not Acceptable - Nothing to update (7) when accessing 'https://api.netatmo.com/api/setstate' aaa: Error executing script. Unexpected error for choose at pos 1: 406 - Not Acceptable - Nothing to update (7) when accessing 'https://api.netatmo.com/api/setstate' While executing automation automation.aaa ložnice: Choose at step 1: choice 1: Error executing script. Unexpected error for call_service at pos 1: 406 - Not Acceptable - Nothing to update (7) when accessing 'https://api.netatmo.com/api/setstate' ložnice: Error executing script. Unexpected error for choose at pos 1: 406 - Not Acceptable - Nothing to update (7) when accessing 'https://api.netatmo.com/api/setstate' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 451, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 684, in _async_call_service_step await service_task File "/usr/src/homeassistant/homeassistant/core.py", line 1738, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1775, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 207, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 678, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 931, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 613, in async_service_temperature_set await entity.async_set_temperature(**kwargs) File "/usr/src/homeassistant/homeassistant/components/netatmo/climate.py", line 326, in async_set_temperature await self._room.async_therm_set( File "/usr/local/lib/python3.10/site-packages/pyatmo/room.py", line 114, in async_therm_set await self._async_therm_set(mode, temp, end_time) File "/usr/local/lib/python3.10/site-packages/pyatmo/room.py", line 137, in _async_therm_set return await self.home.async_set_state(json_therm_set) File "/usr/local/lib/python3.10/site-packages/pyatmo/home.py", line 207, in async_set_state resp = await self.auth.async_post_api_request( File "/usr/local/lib/python3.10/site-packages/pyatmo/auth.py", line 351, in async_post_api_request return await self.async_post_request( File "/usr/local/lib/python3.10/site-packages/pyatmo/auth.py", line 389, in async_post_request raise ApiError( pyatmo.exceptions.ApiError: 406 - Not Acceptable - Nothing to update (7) when accessing 'https://api.netatmo.com/api/setstate' `

cgtobi commented 1 year ago

Diagnostics information is already attached

I'm sorry, I missed that.

Betacart commented 1 year ago

No problem :)

cgtobi commented 1 year ago

Please try if 2022.10.2 resolves the issue.

giulio12 commented 1 year ago

Hi @cgtobi, this issue seems to be solved with 2022.10.2, but I am experiencing new issues. I will open a new one :)

Betacart commented 1 year ago

OK, I will try with new release. @giulio12 Can you point link to your issue here?

giulio12 commented 1 year ago

OK, I will try with new release. @giulio12 Can you point link to your issue here?

https://github.com/home-assistant/core/issues/79980

gieljnssns commented 1 year ago

Edit after 3 more restarts my thermostat is back

My netatmo thermostat stoped working since the update to 2022.10.2

Logger: homeassistant.components.netatmo
Source: components/netatmo/__init__.py:218
Integration: Netatmo (documentation, issues)
First occurred: 15:42:22 (1 occurrences)
Last logged: 15:42:22

Error during webhook registration - Webhook registration timed out
{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2022.10.2",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.10.5",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Brussels",
    "os_name": "Linux",
    "os_version": "5.15.72",
    "supervisor": "2022.10.0",
    "host_os": "Home Assistant OS 9.2",
    "docker_version": "20.10.17",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "xiaomi_cloud_map_extractor": {
      "version": "v2.2.0",
      "requirements": [
        "pillow",
        "pybase64",
        "python-miio",
        "requests",
        "pycryptodome"
      ]
    },
    "huawei_solar": {
      "version": "1.1.2",
      "requirements": [
        "pyserial==3.5",
        "pyserial-asyncio==0.6",
        "huawei-solar==2.1.2"
      ]
    },
    "buienalarm": {
      "version": "1.9",
      "requirements": [
        "pybuienalarm==0.1.1"
      ]
    },
    "ecopower_dynamic_grid_prices": {
      "version": "0.0.8",
      "requirements": []
    },
    "sunspec": {
      "version": "0.0.21",
      "requirements": [
        "pysunspec2==1.0.8"
      ]
    },
    "iphonedetect": {
      "version": "2.0.4",
      "requirements": [
        "pyroute2==0.6.9"
      ]
    },
    "afvalbeheer": {
      "version": "5.0.2",
      "requirements": [
        "rsa",
        "pycryptodome"
      ]
    },
    "frigate": {
      "version": "3.0.0",
      "requirements": []
    },
    "powercalc": {
      "version": "v1.0.0-beta.5",
      "requirements": [
        "numpy>=1.21.1"
      ]
    },
    "pirateweather": {
      "version": "0.1.0",
      "requirements": [
        "python-forecastio==1.4.0"
      ]
    },
    "adguard": {
      "version": "1.0",
      "requirements": [
        "adguardhome==0.5.1"
      ]
    },
    "mass": {
      "version": "2022.8.4",
      "requirements": [
        "music-assistant==1.8.7"
      ]
    },
    "solaredge_modbus_multi": {
      "version": "v2.2.5-pre.3",
      "requirements": [
        "pymodbus==2.5.3"
      ]
    },
    "solcast_solar": {
      "version": "3.0.22",
      "requirements": [
        "aiohttp>=3.6.2",
        "datetime>=4.3",
        "isodate>=0.6.0"
      ]
    },
    "hacs": {
      "version": "1.28.0",
      "requirements": [
        "aiogithubapi>=22.2.4"
      ]
    },
    "neerslag": {
      "version": "2022.07.07.1",
      "requirements": []
    },
    "weatherbit": {
      "version": "1.0.13",
      "requirements": [
        "pyweatherbitdata==1.0.13"
      ]
    },
    "ics_calendar": {
      "version": "3.1.3",
      "requirements": [
        "ics>=0.7.2",
        "recurring_ical_events>=1.0.2b0",
        "icalendar>=4.1.0"
      ]
    }
  },
  "integration_manifest": {
    "domain": "netatmo",
    "name": "Netatmo",
    "documentation": "https://www.home-assistant.io/integrations/netatmo",
    "requirements": [
      "pyatmo==7.1.1"
    ],
    "after_dependencies": [
      "cloud",
      "media_source"
    ],
    "dependencies": [
      "application_credentials",
      "webhook"
    ],
    "codeowners": [
      "@cgtobi"
    ],
    "config_flow": true,
    "homekit": {
      "models": [
        "Healty Home Coach",
        "Netatmo Relay",
        "Presence",
        "Welcome"
      ]
    },
    "iot_class": "cloud_polling",
    "loggers": [
      "pyatmo"
    ],
    "supported_brands": {
      "legrand": "Legrand",
      "bubendorff": "Bubendorff",
      "smarther": "Smarther",
      "bticino": "BTicino"
    },
    "is_built_in": true
  },
  "data": {
    "info": {
      "entry_id": "5a981e21a0b31d75284b8aad81f97329",
      "version": 1,
      "domain": "netatmo",
      "title": "Configuration.yaml",
      "data": {
        "auth_implementation": "netatmo",
        "token": {
          "scope": [
            "access_camera",
            "access_doorbell",
            "access_presence",
            "read_bubendorff",
            "read_camera",
            "read_carbonmonoxidedetector",
            "read_doorbell",
            "read_homecoach",
            "read_magellan",
            "read_mx",
            "read_presence",
            "read_smarther",
            "read_smokedetector",
            "read_station",
            "read_thermostat",
            "write_bubendorff",
            "write_camera",
            "write_magellan",
            "write_mx",
            "write_presence",
            "write_smarther",
            "write_thermostat"
          ],
          "access_token": "**REDACTED**",
          "expires_in": 10800,
          "expire_in": 10800,
          "refresh_token": "**REDACTED**",
          "restricted_access_token": "**REDACTED**",
          "restricted_refresh_token": "**REDACTED**",
          "expires_at": 1665410688.9764702
        },
        "webhook_id": "**REDACTED**"
      },
      "options": {},
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "homekit",
      "unique_id": "netatmo",
      "disabled_by": null,
      "webhook_registered": false
    },
    "data": {
      "account": {}
    }
  }
}
Betacart commented 1 year ago

After update to 2022.10.2, issue persists. After soft restart, it still not worked. So, I restarted HW, and after that, it start working as expected. I am closing this issue as resolved.