Overkiz API and Somfy API

Hi @tetienne, thanks for the quick response.
Yes I saw these HTTP 404 und 50x reponses from the Somfy API.

There are also a lot of these errors (~10 errors per hour).
Are they a followup issue of not being able to connect to the somfy endpoint correctly?

Logger: homeassistant
Source: components/somfy/__init__.py:164
First occurred: 8:06:21 (54 occurrences)
Last logged: 12:55:06

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: '6b0d5b11-eb766146-995cdac9-7e471798'

This error is an other issue. From time to time, Somfy returns an empty list of devices. They will check the reason.
I will submit a fix to handle properly this case. You will still see the error but not a huge stack trace like today. We talked about this few posts above.

Basically the KLF200 API allows this, just someone has extend the current pyvlx implementation. The API is very powerfull, see https://velcdn.azureedge.net/-/media/com/api/klf200/technical%20specification%20for%20klf%20200%20api-ver3-18.pdf

I think this is just a question of implementation work, as already mentioned, the API allows a lot of functions, but currently only a few are implemented in the HA used pyvlx module.

Okay let we hope that somebody in the community build this soon.

It’s a good opportunity for you to learn python :wink:

Maybe :grinning:

Did you ever get anywhere with this?

I’ve just installed my RTS blinds and none of them show up in the official integration, but then I’ve also tried the Somfy Tahoma application and that doesnt seem to accept my credentials. From what I gather, being in Australia, our blinds are pretty much useless?

Hi,

At the moment no, but I’ve started some discussions with the author of the tahoma integration and we will see if we can find the right URL to login with. I think this link will give you the hassio thread.

https://community.home-assistant.io/t/re-somfy-tahoma-official-api/250234?u=ddp

Imick is on vacation, so this will be something I’ll try later in Jan.

Here’s hoping we can get them working in hassio soon


1 Like

Sounds good, let me know if you need any help?

When I open that link, " Oops! That page doesn’t exist or is private."

I never got my rts cover good working with the api or tahoma plugin.
So eventualy i bought a rfxcom RFXtrx433e, and that’s working great and its al local solution without the cloud.

1 Like

Is it Z-Wave only, or can you actually attach it via USB for just the 433MHz part?

Rfxcom is an 433 mhz usb device, the RFXtrx433e has somfy support and the XL version. It is not a zwave device.

OK, strangely some stores show it as a Z-Wave to 433MHz bridge.

I’m trying to execute my roller shutters by Home Assistant and with Apple Homekit safely. That means that when a window is open the shutter should not go down and not execute an position change what results in going down (so gowing up with a position change should be allowed).I have Somfy RS100 IO motors which have obstacle detection, but offcourse I dont want to happen this because it is not good for the motors and the other materials. So the software should implement this smart operation.

I have a window sensor to test if the window is open or closed.

In my configuration.yaml I have this template cover:

cover:
  - platform: template
    covers:
      safe_1e_etage_cover:
        device_class: shutter
        friendly_name: "SAFE - Hal 1e etage"
        position_template: "{{ state_attr('cover.05_hal_1e_etage', 'current_position' ) | int }}"
        open_cover:
          service: cover.open_cover
          data:
            entity_id: cover.05_hal_1e_etage
        close_cover:
          service: script.safe_close_cover
          data:
            entity_id: cover.05_hal_1e_etage
        stop_cover:
          service: cover.stop_cover
          data:
            entity_id: cover.05_hal_1e_etage
        set_cover_position:
          service: script.safe_set_cover_position
          data_template:
            entity_id: cover.05_hal_1e_etage
            position: "{{position | int}}"

I have created 2 scripts:

safe_close_cover:
  alias: Closing the cover safely
  sequence:
  - condition: and
    conditions:
    - type: is_not_open
      condition: device
      device_id: f82f0d142f6d366f36876045f7dac11e
      entity_id: binary_sensor.window_hal_1e_etage
      domain: binary_sensor
  - service: cover.close_cover
    data: {}
    entity_id: cover.05_hal_1e_etage
  mode: single
safe_set_cover_position:
  alias: Set the position of the cover safely
  sequence:
  - condition: and
    conditions:
    - type: is_not_open
      condition: device
      device_id: f82f0d142f6d366f36876045f7dac11e
      entity_id: binary_sensor.window_hal_1e_etage
      domain: binary_sensor
  - service: cover.set_cover_position
    data:
      entity_id: cover.05_hal_1e_etage
      position: '{{position}}'
  mode: single

So what works?

  • Controlling from Home Assistant:

Closing the shutter when the window is open is blocked (GOOD)
Closing the shutter when the window is closed is working (GOOD)
Opening the shutter when the window is open is working (GOOD)
Opening the shutter when the window is closed is working (GOOD)
Changing position of the shutter (shutter going down) when the window is open is blocked (GOOD)
Changing position of the shutter (shutter going down) when the window is closed is working (GOOD)
Changing position of the shutter (shutter going up) when the window is open is blocked (NOT CORRECT, I want to have this always working)
Changing position of the shutter (shutter going up) when the window is closed is working (GOOD)

  • Controlling home Apple HomeKit on an iOs device:

When the window is closed every works correctly.
When the window is open, everythings doesn’t works. I think because HomeKit is always using the set cover position services and not the open and close services.
Another thing what you see in the HomeKit app is that the gear stays turing around on the icon of the cover and doesn’t stops. So maybee Home Assistant should send a stop cover command so that the UI of HomeKit stops turing the gear.

So my questions are:

  1. The way I do it now with the template cover and scripts is this the correct way to go?
  2. How can I allow a cover set position change (which results the shutter to go up, so the window will more open) even when the window is open?
  3. How can I solve the issue in HomeKit of continious turing gear on the cover icon?

Hey Martin
I have isolated the covers in HA completely by using input_number as helpers. Whenever the input number slider is changed, an automation is triggered to move the cover. Here you can limit the movements or deny the cover actuation completely. Expose the input_numbers to homekit instead of the covers and the same automation is triggered by homekit than within home assistant.

Eventually, I have moved all cover automation to appdaemon. Whenever an input_number slider is changed, python takes over and has some very complex algorithm to determine the next move. :wink:

I hope I trigger some thoughts

@Rhadamantys

Hi Rhadamantys,

How have you done this by using an slider with an input_number helper? Is it not triggered to much when changing the slider?

How is your input_number presented in HomeKit?

And when you change it from HomeKit and your logic doesn’t allow it, what happens in Homekit? You don’t have a contineous turning gear?

I have also made some progress. I have now moved my code to Node-RED and there I can allow action that will move the shutter up and deny when the action should move the roller down. The only thing what still is the case, is that the gear is never stop turning on the icon in HomeKit.

Hi all,

I’m new on Home Assistant
I just installed the SOMFY Integration yesterday.
I made a group with 10 I/O covers. When I use the open_cover on my group, some cover stay closed (it’s random). Do you have an idea of the problem?

VR_sejour:
  name: VR séjour
  entities: 
   - cover.oximo_s_auto_io
   - cover.buanderie
   - cover.cuisine
   - cover.coulissant_cuisine
   - cover.coulissant_salon
   - cover.fixe_baie
   - cover.fixe_salon
footer:
  type: buttons
  entities:
    - entity: group.vr_sejour
      icon: 'mdi:transfer-up'
      name: Ouvrir séjour
      tap_action:
        action: call-service
        service: cover.open_cover
        service_data:
          entity_id: group.vr_sejour
    - entity: group.vr_sejour
      icon: 'mdi:transfer-down'
      name: Fermer séjour
      tap_action:
        action: call-service
        service: cover.close_cover
        service_data:

An other question : Is there a way to control the speed (slow open / fast open) of opening like in the “Tahoma application”

Thanks
Jérémy

Your first issue is a know one. I’m waiting an answer from Somfy support. My contact is currently in Christmas holidays.

For the speed, I haven’t yet add the modification in the Core repository, I’ve made an experiment with a custom component: https://github.com/tetienne/somfy-custom-component/blob/c0db6075f135b9c03863a8a57ab2c751bec6c759/custom_components/somfy/services.yaml

I’m following this architecture issue https://github.com/home-assistant/architecture/issues/479 to implement it nicely later.

2 Likes

Hello all!

Thanks for the great work. I have Somfy Tahoma box and have the integration setup and working, but its very intermittent. I have lots of this in the logs:

requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://api.somfy.com/api/v1/device/6320de78-7cdae954-88764c56-82c78b8c/exec

Now, I know this is likely from the Somfy side, but any other controls I have using the somfy apps seem to work reliably (Alexa, or directly through the app). Not sure where to log an issue for this one, so thought I would post here first.