[APP][Cloud & Pro] Somfy Tahoma & Connexoon (v4.0.37, test v4.0.75)

2.0.7 is in test:

1 Like

Hi Adrian,

Is the source of the Homey app on GitHub? I am one of the developers of the Home Assistant integration and we moved away from calling /setup for each device state in favour of an event polling approach. tahomalink.com provides an event listener that you can poll to receive the latest state updates. According to their docs, you are allowed to pull this every second if you want.

I can understand that that would be a big change for now, but maybe good to have a look at for the future. This should respect the Somfy API limits and avoid bans if I am correct.

5 Likes

Hi Mick,
The app is located at https://github.com/AdyRock/com.somfy.tahoma
The event listener sounds very appealing. What is the endpoint to poll that?
Do you have a link to the HA repository and do you mind if I take ā€˜advantageā€™ of it :slight_smile:?

Edit: I have found it. Thanks for the tip, I will implement that ASAP.

4 Likes

Is it also meant for connexoon? Cause Iā€™m unable to login to that webpage. Or itā€™s my fault and I forgot my password. :thinking:

Status update
The events feature that @iMick told me about is look very promising. Using this should greatly reduce the load on the Somfy server even when compared to the last update.

I have also had a response from somfy via @tetienne that sounds very promising:

Adrian, I am pleased to e-meet you. Hopefully, we will be able to guide you to find a common ground with the Homey plugin as well.

I have taken a day off work to implement the event method so I should have an new test version soon.

9 Likes

The tahomalink.com is the url that is used by the app for all the current communications with the server so it should be OK.

1 Like

Great to hear! Could you possibly send me a DM? I would like to share the full API documentation with you privately, but I am not able to send a DM. (I guess since I am a new user here :smiley: )

Yes, you cannot login on the tahomalink.com website, but the tahomalink.com API is available using your Somfy account.

2 Likes

Unfortunately today an 401 again.
Doesnā€™t work at all again.

:grimacing:

Thx so much for your efforts!

4 Likes

I just upgraded to latest (test) version and all is now working as it should again. This with a load of velux windows, velux internal blinds, external shade blinds , so it should be a good test.

I had to change login method for Somfy but all worked seamlessly.

Great job by Adrian!

1 Like

With an event listener, no polling is needed anymore. I think thats the best solution, but till then, letā€™s set the polling to 300 or so.

is ā€œpollingā€ the sync speed in the config tab?

yep

thanks

Just to clear up any confusion as a lot has been happening. The events method still requires polling as it not a push event system. But the polling just involves one small request packet to obtain an array of state changes that have occured since the last request. Most of the time it just returns an empty array as nothing has changed.
Obviously I donā€™t know the actual internal workings of the Somfy server, but as the event notifications have to be registered, I presume the server will be creating the array as each event occurs so the work required to return the array should be minimal.
To put that into context, the old method of using the /setup endpoint probably required the server to do a lot of database lookups and returned a large amount of data. That large data block was also putting a load on Homey, both memory and CPU, so this new method is a win for everyone.

3 Likes

Version 2.0.8 is now available for testing ( https://homey.app/a/com.somfy.tahoma/test/

So this is quite a big change to use Tahoma events as the method of updating capabilities.
The change involved a lot of copy and paste so I might have missed some detail changes. I have test all the devices that I have and itā€™s looking good but I donā€™t have any IO covers.
If you find that devices are not updating then switch on the log in the state log tab, operate the devices, wait for a minute and then copy the log and send it to me.

I have also made some changes with the login functions to prevent any race conditions of multiple logins.

3 Likes

Installed and testing. I can open, close, set position of my shutters. But if I update the position manually, it doesnā€™t update on Homey side. No log at all (no error log, no state log).

That is what I always had :slight_smile:

Same for me with IO shutters, workā€™s fine except for the position displayed on Homey when I set the shutters position with Tahoma.

What do you have the sync speed set too?
Is the 'error ā€™ log completely empty?