core: Somfy integration problem

The problem

Covers somethimes working correctly, sometimes they doesn’t work at all.

Environment

  • Home Assistant Core release with the issue: 2020.12.7
  • Last working Home Assistant Core release (if known):
  • Operating environment (OS/Container/Supervised/Core): OS
  • Integration causing this issue: Somfy
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/somfy

Problem-relevant configuration.yaml

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url: example.duckdns.org:8123

# Text to speech
tts:
  - platform: google_translate
    language: 'pl'



group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml



sonoff:
  username: 
  password: 
  force_update: [temperature, power]
  scan_interval: '00:01:00'  # (optional) default 5 minutes
  sensors: [temperature, humidity, power, current, voltage]
hacs:
 token: 

vacuum:
  - platform: miio2
    host: 192.168.0.226
    token: 
    name: bignose

tuya:
  username: 
  password: 
  country_code: 48 # kod naszego kraju, to ten sam co w telefonie czyli 48
  platform: smart_life # wpisz: smart_life lub tuya w zależności do czego się logujesz

sensor:
  - platform: template
    sensors:
      weather_temperature:
        friendly_name: "Weather Temperature"
        unit_of_measurement: 'degrees'
        value_template: "{{ state_attr('weather.margo', 'temperature') }}"

Traceback/Error logs

Logger: homeassistant Source: components/somfy/init.py:164 First occurred: 2 stycznia 2021, 21:20:48 (131 occurrences) Last logged: 9:13:04

Error doing job: Task exception was never retrieved Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py”, line 119, in _handle_refresh_interval await self.async_refresh() File “/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py”, line 193, in async_refresh update_callback() File “/usr/src/homeassistant/homeassistant/components/somfy/init.py”, line 209, in _handle_coordinator_update self._create_device() File “/usr/src/homeassistant/homeassistant/components/somfy/cover.py”, line 70, in _create_device self.cover = Blind(self.device, self.api) File “/usr/src/homeassistant/homeassistant/components/somfy/init.py”, line 164, in device return self.coordinator.data[self._id] KeyError: ‘1b735bbc-65c07718-e52b29eb-5e13c798’


Additional information

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 28 (12 by maintainers)

Most upvoted comments

@efouret thx you very much for the explanation. It can explain indeed the behavior you met. Now I have to think about a nice fix.

@michalkujawa in the mean-time you could use https://github.com/imicknl/ha-tahoma, which makes use of the tahomalink.com server. Currently this is a custom component, but there is an open PR to get it back in Home Assistant as well. https://github.com/home-assistant/core/pull/43966

I am still waiting on the day that Somfy will extend their official API with all device support. And hopefully they will monitor their API and make sure it doesn’t fail as often as it does now. It is quite unreliable in automations at the moment, where the Somfy TaHoma integration doesn’t have those issues.

@tetienne after looking further into the homeassistant code I’m still wondering if the issue couldn’t be caused by the exception raised:

I’m not sure my analysis is correct but that would explain the behavior.

@tetienne when I look at the homeassistant history, I’ve got a lot of (short, 1-4 minutes) periods where all my covers are unavailable (capture of the last few hours): Homeassistant history extract When a script triggers during such a period it fails.

OK for the scan interval, thanks for your feedback.