[ST Edge] Somfy Connexoon Edge Driver

Hi Damien.

What speed!

I did some tests with a shutter, everything works fine.

As long as I don’t touch the pane in SmartThings, I have a connected status because I haven’t received any information yet. Is there a status refresh frequency?

I tested every type of somfy device I own to see the results with the API. I took the opportunity to add some notes in the json files:

https://drive.google.com/drive/folders/1iMXey-EIch7rhBkZSz7OFtBESkSbr-jH?usp=sharing

Here are 2 screenshots with the different sensors (the second screenshot is in the link) :

Hi @P_vC , @jdefr42x,

The preset position should be relatively straight forward. I will work on that next.

In the meantime I will have a think about how to implement the sensors. I can get the values from the API without an issue. The easiest way would be to poll the somfy hub at a set inteval (eg. 30 seconds) for device state changes. This could be user configurable in device preferences. This inteval may be acceptable for your light and temperature sensors, but may be a problem for your contact sensors and smoke detector where you would want to know a state change instantly.

I’ll see what i can find in the documentation. The hub may have event publications I can subscribe to.

Hi Damien,

That is good news. Thanks for all the effort you are putting into this. I really appreciate it.

Peter

1 Like

@P_vC @jdefr42x

I have implemented the preset position functionality.
New Version 2024-05-22T09:48:40.933399004

Actually, you can press the preset button when the device is open, closed, partially open, or even moving, and it should return to the preset position.

I am currently still loking into how I can save preset positions in the app. It looks like the command may be different between IO and RTS devices, so i will have to re-engineer the code a bit so it better supports both types of devices.

In the meantime, if you can help me out by testing a few commands on you IO device to see which one sets the position (I only have RTS devices so need your help!). You will need to set your device in a new preset position then send an API command to /exec/apply and see if it saves. The body of the command will be in the following format:

{
"label": "string",
  "actions": [
    {
      "commands": [
        {
          "name": "string",
        }
      ],
      "deviceURL": "string"
    }
  ]
}

You will need to specify the label and deviceURL from the device config you shared earlier.
The command name is probably either going to be setPosition or setMemorizedPosition.

Here is an example:

{
"label": "Woonkamer groot",
  "actions": [
    {
      "commands": [
        {
          "name": "setPosition",
        }
      ],
      "deviceURL": "io://2052-4864-2475/3350886"
    }
  ]
}
{
"label": "Woonkamer groot",
  "actions": [
    {
      "commands": [
        {
          "name": "setMemorizedPosition",
        }
      ],
      "deviceURL": "io://2052-4864-2475/3350886"
    }
  ]
}

If you can test both and tell me if either saves the new preset position that would be great.

Hi Damien,

I would very much like to help test your code but I don’t have any experience with this and don’t know where to run this. If you could provide some guidance I will give it a try (I am not a developer).

Although I appreciate that you are trying to be thorough, the setting of the preferred position is not all that important for me. The Somfy Tahoma app does not support this either and it therefore has to be done with the remote. It is typically something you set once and rarely change. Never the less I will help with the testing if you can tolerate my ignorance.

I still don’t have the new driver (2024-05-22T09:48:40.933399004) on my SmartThings app. I usually try to force the update by rebooting the hub but after several attempts the new driver did not install. Could there be an issue with this or is there another way to force the update?

Peter

Hi Damien,

Here is the code to set the “my” position (visible in this state: Memorized1PositionState) :

{
  "label": "command smartthings",
  "actions": [
    {
      "commands": [
        {
          "name": "setMemorized1Position",
          "parameters": [80]
        }
      ],
      "deviceURL": "io://0000-0000-0000/3693985"
    }
  ]
}

Great - Thanks. Ill look into that further.

@P_vC - The driver should update automatically in time I’ve redeployed it just in case to see if that helps.

Version 2024-05-22T22:23:43.378064127

You will know when you have it. It will have a preset button like in the screenshot. Let me know how you get on.

Worst case scenario you will have to remove all the somfy devices including the somfy connexoon hub device, remove the driver manually from your hub and reinstall it.

Hi Damien,

Thanks, I got the latest driver now. I tested the new go to preset position button and it works perfectly. The only thing I noticed now is that the shade status (open, closed or partial) often get muddled up. You did warn me about this but is there anything you can do (perhaps a refresh button)? I can always use the pesky Tahoma app to see the status but that’s not ideal.

Peter

HI @P_vC @jdefr42x

I’ve changed the code to access event publications which will enable (near) realtime device state changes.

You should see your devices have ‘opening’ and ‘closing’ states now while in operations.

I will expand on event publications to support your sensors, but i need some help running some API calls. Here’s a recap on how to do it…

  1. Go to Swagger UI
  2. Enter your PIN (Located on the under side of your Somfy Box)
  3. Enter your port (8443 by default)
  4. Click on Authorize, enter your token, and click authorize.
  5. Scroll down to ‘Event’ and select ‘events/register’
  6. Click ‘Try it Now’
  7. Click execute
  8. Copy the Curl command and run it. I like to use Postman. You can download it for free and it’s easy to import Curl commands and run them.

An ID will be returned. Copy that ID and repeat steps 5 to 9 executing ‘events/{listenerID}/fetch’ instead.

You will need to perform some tests then fetch the events.

  1. Open, close, pause, and ‘my’ your device.
  2. Get your sensors to change states. Open/Close, Light vs Dark, etc.

If you can share the events, that would be great.

Hi @damien1

I don’t see any change in the condition of the shutters. I am fine with the latest drivers with a Refresh Interval setting.

For the events, I captured a lot of information except with the light sensors (I didn’t manage to trigger any events, I’ll see tomorrow) and the smoke detectors (I prefer to test their integration when the rest will be functional).

But I have problems sharing the json files with a Google Drive link on the forum. My previous posts have been hidden. Do you have a solution? (I have 13 json files with events)

contact sensor open:

{
  "deviceURL": "io://0000-0000-0000/15425585",
  "deviceStates": [
    {
      "type": 3,
      "name": "core:ContactState",
      "value": "open"
    }
  ],
  "name": "DeviceStateChangedEvent"
}

contact-sensor-closed:

{
  "deviceURL": "io://0000-0000-0000/15425585",
  "deviceStates": [
    {
      "type": 3,
      "name": "core:ContactState",
      "value": "closed"
    }
  ],
  "name": "DeviceStateChangedEvent"
}

temperature sensor:

{
  "deviceURL": "io://0000-0000-0000/15573513",
  "deviceStates": [
    {
      "type": 2,
      "name": "core:TemperatureState",
      "value": 16.1
    }
  ],
  "name": "DeviceStateChangedEvent"
}

Hi Damien,

I think I have created the output that you requested (I can’t make heads or tails of it). I have run the command through Postman as per your instructions with the shades in the various positions. In this process I presume the sun sensor readings were captured as well and, since the light intensity is always changing, there will be some different values there too. Please let me know if there is anything else you require.

You can find the output in text files in the following shared folder: https://drive.google.com/drive/folders/10psQKP76V2J1NzzF0iJEP1qlOqC5PjDK?usp=sharing

Peter

Hello,
Thank you for your job it is working very well!
Do you think it is possible to add the windowShadeLevel capability to IO blinds?
Have a nice day!

Hi @romrom21

Great i dea. Ill look into this once I have implemented the sensors and garage door control :slight_smile:

Hi, thanks !
Do you have a git ?
I could check to add more devices :hugs:
Have a nice day !

Hi everyone,
I have released a new version of the driver (2024-06-01T21:47:39.974643976) and it now supports light, temperature, and contact sensors as well as the garage door control.

Thanks to @jdefr42x and @P_vC for you help with testing.

Hi Damien,

Thanks very much. I have configured some routines and it works perfectly. Just some minor remarks:

  • For the sun shades (or awnings as Somfy likes to call them), the open / closed icons should be reversed because for the open position (deployed in Somfy terms) the shades are down and the closed position (retracted) the shades are up. It’s a bit confusing but if you reverse the icons it reflects the physical state. Not very important if it’s a lot of work.

  • I had to move the Tahoma switch and after the reboot the sun sensor and the Somfy Connexoon reconnected but the shades remained off-line. The shades only came back on line after I removed them in SmartThings and clicked the Discovery button on Connexoon. Not a big issue either because I guess one would rarely reboot but I thought I would mention it.

The reported position of the shades still gets messed up quite easily but I understand from your previous post that you will still try to fix this.

In any case, I am quite happy with the way it works now and anything more would just be icing on the cake. Thanks again.

Peter

@damien1 Hey, is there a way to add more capabilities and devices? Do you have a github to help you ?
Thanks :wink:

Hey @romrom21

That would be great. Send me your git username and I’ll add you as a collaborator.

Hey @damien1 , you can use this account: romrom21

hi @romrom21

I have added the windowShadeLevel to IO-Homecontrol blinds, awnings, and shutters.
You will need to remove the devices and add them again to get the latest device profiles.

I have also added the functionality to set the preset position in the device settings.

Let me know if you have any problems.

Damien