Overkiz API and Somfy API

The Tahoma component uses the unofficial Somfy API. tahomalink.com uses this API. This component supports almost all devices. The Official API is really limited. For instance, the scenarii are not exposed as discovered. Not because I’m lazy, but because of Somfy… I’m also involved in this component. See the related topic: Tahoma Integration Refactored

Anyway, I will still try to fix the “official” component to handle your case. You are the 2nd user that apparently lives in a castle (20 covers!!!) with this issue. You can also try to contact their support.

Hahaha, I wish I’d live in a castle. It’s just an old house with a “Veranda” of 8 covers, so it goes up to twenty covers.

I’ll stick to the unofficial addon, hoping it won’t get deprecated by somfy anytime soon. I wish they could add the scenario feature to their official API, it would fix my problems.

I’ve tried to register an app on their developpers portal but I can’t even get an OAuth token, I get a 404 error. I’ve reached their support, and here’s their answer (french) :

Bonjour,

Merci de nous avoir contacté.

Le problème se trouve chez nous. Certaines apps créées de puis notre portail API ne se synchronisent pas correctement.

Je vois que vous essayez de lier à home-assistant. Sachez que vous n'êtes pas obligez de créer d'app si vous utilisez le composant officiel (https://www.home-assistant.io/integrations/somfy)/ Celui-ci intègre un service d'account linking natif d'Home Assistant.

Cordialement

:frowning:

Thanks for your help tetienne

Yes their app system is a shame. It’s why I suggest to use the native HA account already setup and tweak by Somfy.
But IMO, the fact they cannot handle 20 requests is not something normal. I will contact them. But I don’t know if they will do anything, they clearly told me several times that they haven’t any resources allocated to their official API.

If only we could get rid of the tahoma box and send directly the radio signal ourselves through an RF emitter.

I don’t get the point of setting up an officlal API that is buggy and way much behind in terms of feature to the unofficial one used in ahomalink.com.

Hopefully it will remain usable for as long as the official one gets all the features from the unofficial.

Hey Martin,
Just a comment: you could always set the trigger with “from:” state and “to:” state. So you could only trigger an automation, if a shutter state changes “from: closed” -> “to: open” and ignore the trigger, if “from:” is something else, i. e. unavailable.

1 Like

That’s exactly what I do for most of my automation today avoid surprise.

@tetienne I can confirm that the slowly services are working on my side. Thanks for that!

Oh nice! In one shot :smiley: I will see to add it in the Core project.

@tetienne : Oh…I see some errors in the log:

Logger: homeassistant
Source: custom_components/somfy/init.py:163
First occurred: 8:55:38 (17 occurrences)
Last logged: 10:12:15

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 “/config/custom_components/somfy/init.py”, line 203, in _handle_coordinator_update
self._create_device()
File “/config/custom_components/somfy/cover.py”, line 94, in _create_device
self.cover = Blind(self.device, self.api)
File “/config/custom_components/somfy/init.py”, line 163, in device
return self.coordinator.data[self._id]
KeyError: ‘64a30328-6be429be-bce09b3c-7783c0b9’

I saw it too. I will try to fix this.

Okay thanks

The issue is due to Somfy not returning the devices from time to time:

2020-12-15 13:28:21 DEBUG (MainThread) [custom_components.somfy] Number of devices: 8
2020-12-15 13:28:21 DEBUG (MainThread) [custom_components.somfy] Finished fetching somfy device update data in 0.795 seconds
2020-12-15 13:29:21 DEBUG (MainThread) [custom_components.somfy] Number of devices: 8
2020-12-15 13:29:21 DEBUG (MainThread) [custom_components.somfy] Finished fetching somfy device update data in 0.741 seconds
2020-12-15 13:30:21 DEBUG (MainThread) [custom_components.somfy] Number of devices: 8
2020-12-15 13:30:21 DEBUG (MainThread) [custom_components.somfy] Finished fetching somfy device update data in 0.630 seconds
2020-12-15 13:31:53 DEBUG (MainThread) [custom_components.somfy] Number of devices: 0
2020-12-15 13:31:53 DEBUG (MainThread) [custom_components.somfy] Finished fetching somfy device update data in 32.193 seconds
2020-12-15 13:31:53 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved

Oh really…damn the official Somfy CLOUD API is very very very bad.

It’s time to buy soon the Velux KLF200 and run everything locally…

The somfy cloud is totally unreliable.

Does the Velux KLF200 work fine with the somfy covers ? No issue whatsoever ?

What I read in this topic is that there are users that are working with the Velux KLF 200 and that everything is working correctly.

But maybe those persons could tell us there real experience with us.

The box is € 160,-. But if with this box everything is working reliable, it is worth the price. Also it should then be possible (I think) to poll locally every x seconds. So much more then now, i believe 60 seconds with the offical plugin and 30 seconds with the unofficial?

We reduce the official component to 60 seconds (or 60 minutes if you have only RTS devices), and the unofficial component 30 seconds once we got an agreement with Somfy.

By the way, you can update the custom component, I’ve fixed the error message you reported. Now you will still have an error, but this one is nicely handled.

@tetienne I still get this error:

Logger: custom_components.somfy
Source: helpers/update_coordinator.py:166
Integration: Somfy (documentation)
First occurred: 16:11:19 (1 occurrences)
Last logged: 16:11:19

Error fetching somfy device update data: No devices returned.

Now you will still have an error, but this one is nicely handled.

It’s what I told you. I don’t want to hide the error. But now this one is caught, and nicely handled.

I do agree, 160€ is worth it if I get a reliable way to use my somfy covers through Home Assistant. I’ve read that you can be limited to 5 devices though, so I will wait to get some feedback from real users of the Velux KLF 200…

Okay I understand.

But it is funny to have some automations with Home Assistant. Now you can see (with the official somfy tahoma app you see sometimes some errors) every time when the cloud api is not working.

I get at this moment a lot of not available states from somfy