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

That’s exactly what I said:

I thought it was after I controlled the cover once, but maybe it’s indeed when the next poll (sync time) happens. In my case also 10 sec.

just a tiny bug to solve on restart, and it’s all good :slight_smile: (at least for us)

1 Like

Indeed and let’s hope that the remaining 401 error issue is Somfy related and not app related.

Thanks for the input guys, that information has been very helpful.
I am now in the process of adding more ‘locks’ in the code to make sure the startup order is well controlled. The joys of an asynchronous system without proper semaphores and locks.
The old /setup endpoint method had the advantage of one global collector function that then distributed the data. The way the new method has evolved by discovering new parts of the secrets over a few days has fragmented the operations. So, time to, almost, start over with all the new knowledge.

The Somfy API actually seems pretty good. If only they would make it official and publish some of the documents I have come across, the third party systems that have been built would probably be a lot more friendly to their servers. They could also hand out official OAuth2 IDs and secrets that allowed basic access to the system, while protecting more sensitive stuff.

1 Like

Have you send @iMick a direct message? I thought he wanted to send you some documention of the full API:

Yes I did that and the document is the one I have mentioned. It has been very useful.

1 Like

Just out of interest, what Homey’s are people using that are having the startup problem?

I have a Homey Pro so I am wondering if it can start the various parts of the system more efficiently with the 2 core CPU’s.

I have an Homey Pro (early 2019) together with a Somfy Connexoon.

Well that rules out my theory :slight_smile:

1 Like

there are a lock mecanism in homey.
Syntax is something like this :
private static Lock = new Mutex();

@synchronize(VirtualThermostat.Lock)
public async onDeleted() {

edit: make me think I need update several apps to the new beta version :frowning:

That sounds interesting.

Is that a Homey function or Node.js?
Is it documented somewhere?

Version 2.0.11 is now in test. I have added flags around functions and retry methods to control the startup sequence.
Hopefully now the app should finish the log in procedure before the devices start trying to communicate with Tahoma.

I installed 2.0.11, then I cleared the logs.
I restarted the app and moved my cover with the connexoon app. In homey the position state didn’t change. Also the info and state log are empty.

When I manually login then everything works fine.
I have send the info log. It starts with 2020-10-10T18:01:22.887Z

So unfortunately nothing changed. Except that I see Tahoma login in the log instead of Simple login.

Just to make sure I understand, after starting the app the information log was completely empty?
The when you logged in manually it filled with the data you sent?

The app automatically clears the information log when it initialises. So after restarting it you should see it fill up.
If it’s not showing anything then something is interupting the initialisation. I will add yet more logging earlier in the process.
One thing you could try is, after starting the app and waiting a few minutes, then tap on the Create Diagnostic Report. If the app has consumed an error then it might show something.

Correct.

I restarted the app and after 2 hours it is still completely empty.

If it’s not showing anything then something is interupting the initialisation.

So this seems to be the case.
diagnostic report:
f2265f00-d19b-45ed-94df-666f90b3eed6

Where did you read that? Node.js runs JS-code single-threaded (unless you use worker threads, but they are explicit and weren’t introduced until Node v14, which Homey doesn’t run).

Thanks for the report. It did indeed pin point an error in the app init function (linkUrl instead of linkurl) that stopped the function in it’s tracks. It was fine on mine because the setting had been saved and therefore bypassed the placed it was used.

1 Like

I tested 2.0.12 and now directly after the update the log is filled. I also tried a restart and the log is filled immediately :smiley:

When I change the position of the roller shutter with connexoon, then Homey shows the state.

So great job, problem solved!!

1 Like

Will you let us know when you have a reply from Somfy what an acceptable sync/poll value is.

I will pass it on if they let me know. I’m still not sure how much they will communicate with me as I am using the unofficial api. I have a suspicion they will tolerate it, provided it doesn’t stress their servers, but give no specific guidance in case that implies permission.
I have been informed by a Homey user who works for Somfy that they received a company email. It basically said they are aware of our situation and are hopeful it will be resolved by the deadline. The user also thanked me for my work. So I took that as a positive.
My feeling is 30 seconds should be safe and possibly as low as 10 seconds. I don’t know if they will give heavy users a warning first or just block them.