[APP][Pro] Somfy Tahoma & Connexoon (v3.0.35, test v4.0.2)

Ok, thank you very much. Looking forward to them :slight_smile:

So far everything is working fine again and I have set to the poll time to 180 seconds.
Hopefully that atleast makes the strain on their endpoint less of a problem.
And for now, my account isn’t migrated to oAuth… yet.

To prevent Homey users to hit the endpoint at the same time (assuming we all have a somewhat similar setting where-as a 10 sec. interval will coincide with 20sec. or 180sec. for example). Perhaps you can add a certain randomness to it? (e.g. when set to 10sec. the app will randomly poll at 9, 10 or 11 sec.)

Am I making any sense to you all? :sweat_smile:

I think there is already some randomness. I believe those seconds start to count the moment you press the save button or login or whatever. @Adrian_Rockall can confirm. So when a 10 sec sync speed is set and the save button is pressed at 10:00:23.123 then the next sync will be done at 10:00:33.123

From my point of view the 10 sec sync speed doesn’t mean everybody will get sync updates at 10:00:10.000, 10:00:20.000, 10:00.30.000 etc. You could verify it yourself in the information log panel.

Yeah, if that is the case, then it should be okay.
I am indeed trying to find out if it using an invoked timer or if it is using Homey’s ‘cron’.

It is as @rvdeijk states. The app uses the setTimeout function to set the interval so it will be as random as it can be.

2 Likes

I have published a test version that selects the login method automatically.

Tested (2.1.3), works perfect :smile:
Automatically logged in, using OAuth.

1 Like

My shutters weren’t automated today.
Apparently the app had crashed and needed to be restarted.

I’ve enabled some logging in case this happens again.

1 Like

Sorry for the issue. I’ve not had any notifications of a crash so a log would be good. Also, if it happens again then try the Create Diagnostics Report option in the standard app settings (where you see the Enabled, etc toggle).

I have published a test version that has a new action flow card that can switch the polling on and off.
As Somfy are concerned about third parties keeping connection open 24/7, this allows you to stop polling and close the connection when it is not required. Actions to control covers, etc, should still work but the status of devices will not be updated.
For example, I have set up flows to switch off polling when we all leave and turn it back on when someone gets home. I have another that turns off polling when I go to bed and back on when I get up.

Myself and the developers of the two plugins from HA are still in contact with Somfy to clarify the position but I am still trying every trick I can think off to reduce the traffic so we can stay under their radar.

3 Likes

Hi Adrian. I noticed my IF condition “blind not in state Up” reads the state of the blind wrong. It is not Up but it reads different.

Hmm, that’s possibly a tricky one. Some covers can only return Up or Down for the state so when it is neither up not down I think it is left at the last state when it was up / down.
The app does do a check on the position and if it is not 0 ro 100 hen it sets the state to idle. That worked fine on the old method where it had all the data in one go but now it gets each bit of information separately. So it might just be the order in which the information arrives.
Could you turn on the state log, then run the blind to the full down position, then to the middle, then to the full up and finally back to the middle (waiting for the blind to reach each position before executing the next). Hopefully, if I can see the exact order of the state updates and what each one is I can think of a fix.

I Have the same problem… no detect UP or DOWN

Nice, I made a simple flow as well:

|

Polling off:

  {
    "time": "2020-10-16T11:49:14.479Z",
    "source": "stopSync",
    "data": {
      "message": "Stopping Event Polling",
      "stack": ""
    }

Polling on:

  },
  {
    "time": "2020-10-16T11:52:05.155Z",
    "source": "Fetch Events",
    "data": {
      "message": "Starting",
      "stack": ""
    }
  },
  {
    "time": "2020-10-16T11:52:05.288Z",
    "source": "Fetch Events",
    "data": {
      "message": "Complete"
    }
  }

So between 1-15 minutes after the sun goes down, the flow is triggered (I might change it to something else) and between 1-60 seconds the polling will be turned off. Should be random enough :slight_smile: The same random number variable could be used to turn polling on again.

1 Like

Didn’t you like 100 posts ago state that they specifically would target apps that turns on and off polling on time?

Yep, so make sure it’s random :stuck_out_tongue_winking_eye:

@Adrian_Rockall I tested the flows but it seems when the polling is started that the current states remain. Although the log says fetch complete:

Scenario:

  1. Flow turned polling off
  2. Cover moved by remote
  3. Flow turned polling on
  4. Result:

So Homey didn’t see an update of the state. Even half an hour after the flow started the polling again. Also when I press login the state didn’t change, so maybe something broke?

I noticed the same when I got home this evening.
It’s the same problem I mentioned when the session timed out which I forgot about. There will be a fix tomorrow.

1 Like

New test version 2.1.5

  • Added flow card to change sync speed.
    With this action flow card, you can set different sync speed at will. For example, when everyone leaves home, I set my sync speed to 10 minutes. Then when the first person gets home, I set it back 15 seconds.
  • Forced refresh of status if login token expires.
    If the access / login token expires the event system stops recording state changes, so now the device state is refreshed when a new login is complete.
  • Fix for idle state when cover is partially open
    Some covers only report open or closed for the state, so they will always report open unless the cover position is exactly 0 or 100 depending on their concept of which position is open.
    The code now ignores the open / close state changed event unless the position is 0 or 100. It will set the state to idle if the reported position is not 0 or 100.
2 Likes

What is the dimension of the nummer you can insert. Is it seconds? So, in your case 600 (10 minutes x 60 seconds) and 15?