Integrate Somfy in Hubitat

Roman (@defunctzombie), thanks for doing this. I had started, but got sidelined with chemo and recovery, plus other health issues. You will understand when you are in the “over 70” bracket.

@supergolfstick, Perhaps it will help if I provide these install/configure instructions I wrote:

Installation/configuration

(1) install Somfy myLink mobile app on a mobile device. Configure myLink app according to Somfy instructions, if not previously done.

(2) on the myLink mobile app’s myLink Settings > Info page, note the ID (an eight-character alphanumeric identifier). Now, go to the myLink Settings > Integration page, choose an integration other than Alexa or IFTTT(e.g., Control 4 (preferred) or any of the following integrations). You may initially get an error message because the Current System ID is not set. Click Change System ID, enter a new System ID. It’s probably easiest to choose, for consistency, the same ID shown on the Info page, which will become the System ID used by the Hubitat integration. After setting the System ID, it will appear as the Current System ID.

(3) Click Generate Integration report, and an Integration report page will be generated by the app. Click Send, and an email will be generated with the contents of the Integration report. Send this email to yourself and print it out - it will be needed when configuring the Hubitat parent virtual device, below.

(4) install via Hubitat Package Manager using the “From a URL” install link

https://raw.githubusercontent.com/defunctzombie/hubitat-somfy-mylink/master/packageManifest.json

provided above by @defunctzombie in his GitHub repository. Alternatively, for a manual install, add Somfy MyLink Hub groovy code from @defunctzombie’s repository to Hubitat Drivers Code, then add Somfy MyLink Shade groovy code to Hubitat Drivers Code.

(5) Create the parent device for the myLink hub: on Devices page, Add Virtual Device, Type: Somfy MyLink Hub (from User drivers at bottom of Type drop-down). Enter some Device Name (e.g., Somfy myLink Hub). Optionally, enter a Device Label that will be displayed on the Devices page, otherwise, the Device Name will be used. Click Save Device, and a table of Preferences will appear.

(6) Enter the Preferences: IP address of the Somfy myLink hub, don’t change the myLink port (default 44100), enter the myLink System ID from the Integration report, enter the Device 1 Name (which will be the Hubitat child device name, does not have to match the name on the Integration report, but probably should be the same to avoid confusion when switching from the Somfy myLink mobile app to the Hubitat platform) and Device 1 ID (will be the same as the System ID with an appended “.1”). Repeat for all Somfy device names found in the Integration report.

(7) Click Save Preferences, then click createChildDevices.

(8) go back to Devices page, then to each child, adjust the Time (in sec) for the device to open when the open button is pressed.

EDIT: @supergolfstick, if you want to use multiple MyLink hubs, the way to do that would be, after you have done one of them according to the above installation/configuration instructions, would be to repeat steps (5) through (8) in the setup (i.e., create a second virtual device of type Somfy MyLink Hub). I haven’t done so, or tested that approach, though.

My approach, instead, is to only have a single MyLink hub and put Somfy RTS repeaters (Somfy part 1810791, available on eBay) where needed to extend the signal. It took two strategically-placed repeaters for our 1900 square foot two-story house. The advantage of this approach is that you don’t have to keep switching hubs in the Somfy app (if you use it, I don’t), and you can use a Somfy 5-channel Decoflex RTS wall switch (or two or three, in a multi-gang wallbox, depending on how many devices you have) in each room to control all the devices in your home. Whatever.

I was reading that MyLink is US only.
I'm in the UK and I have a somfy Tahoma.
Any luck using these latest drivers or is it a completely different platform?

Thank you very much

The drivers know nothing about the country/region (except that messages are in English). They are just standard drivers that communicate with a device by WiFi.

The issue is with the Somfy RTS (Radio Technology Somfy) radio system, there is the issue of the radio frequency used by the Somfy devices to communicate with the Somfy MyLink hub, and whether the particular radios/frequencies have been approved for use in each region. I know that the RTS systems sold in the US operate at 433.42 MHz, and that RTS in Asia operates at 409, 426, 447 MHz. I don’t know about other regions. Somfy devices are designed in Europe.

But the drivers will work fine as long as you can get a Somfy MyLink hub that is permissible in your country, with shade/awning/drapery motors for your country.

These drivers were written to the Somfy API Rev. 19 (2016), which was removed from the Somfy website a couple of years ago, right around the time that the Tahoma device was introduced. The Tahoma device is fairly new. I would assume, but do not know, that the Tahoma device responds to the same API commands as the MyLink. If the same Somfy devices are controlled by the Tahoma hub, it would seem, if some API change has been purposely introduced by Somfy for the Tahoma to prevent non-Somfy devices/software from communicating with the Tahoma hub, that, at worst, you could simply get a MyLink hub.

Assuming that the MyLink WiFi (supports both 2.4 and 5 GHz) and RTS (433.42 MHz) frequencies are the same in UK as in US, it would seem that the obstacle would be the plug (voltage and physical configuration) for the mains socket. The MyLink hub has a standard two-blade US plug on the back, 120 V AC, 50/60 Hz. I believe that there are adapters, commonly used by travelers, that would adapt the MyLink for a UK mains socket.

Why don’t you install the drivers and see if they can control devices on your Tahoma hub?

1 Like

@672southmain thanks for the instructions! I've adapted their general flow to the README in the repository.

1 Like

Thank you for that, I tried but there doesn't seem to be any system Id for the tahoma, so I'm stuck there.
I think it's completely different.
But that's fine, I control it with the Google assistant integration now and it's been reliable.

1 Like

Thanks for the information. I wanted to confirm it as I did this for my Homeseer system and wanted to make sure the same steps applied. Appreciate the feedback.

Thanks @defunctzombie for picking this up!

As mentioned earlier, I had switched over to using a Bond Bridge and it has been working well for me. I wanted to share this pull request that I made to the hubitat-bond project to add support for sending the Preset command which moves a shade to the My Position. It works.

Hopefully you guys can figure out how to get that working in this project! AFAIK the MyLink API is not public and I was never able to figure out how to send a preset command. The Bond Bridge API is open so it was easy to figure out how to do this on Bond Bridge.

1 Like

Thanks for your initial work in porting the driver over to hubitat!

My crude understanding about the "My Position", pieced together from some readings online, is that it can be invoked by sending the "stop" command to the API. If the shades are moving the stop command stops the shades. If the shades are stopped, the stop command sends them to the preset position. I've not tested this hypothesis yet tho.

1 Like

It’s correct. It’s not a hypothesis, it’s a fact. I use it every day. It’s absolutely the worst design decision I have ever seen.

Justin Walker (@augoisms) uses it in his Somfy ZRTSI Hubitat Z-Wave driver with a, um, hack, to allow Alexa to command his driver to send the MyPosition (Stop) command when the device, exposed to Alexa as a dimmer, is set to 50%. Alexa can only control a limited set of device types, including dimmers, so this was a reasonable way to do it. Denny Page (@dennypage) added this to his ZRTSI driver for the same reason.

Makes sense! These established conventions that @672southmain mentions (mapping 50% to the MY button) inspired what I added to hubitat-bond to have consistency across the Somfy integrations. In addition to Alexa, the magic position value makes it possible to trigger the MY button through Rules and other automation triggers.

1 Like

Based on the comments around "My Position" as a supported function, is this something you are looking to integrated into your driver as we know others have done this for the ZRTSI controller as mentioned inside the post. Please advise.

@supergolfstick the driver I've shared supports "My Position" via the "stop" command. If you invoke the "stop" command while the shades are already stopped, this will send them to "My Position".

Thanks. What I observe In your setup is that when the shade is in a closed state, when you execute a “stop” command to get the shade into the preset position that “my position” is set for, the state of the shade does not indicate partially open but still “closed”

Please advise.

This is great! I installed this without an issues. I have four blinds and an "all blinds" on the remote. in the devices I can control all blinds individually, the all blinds function doesn't seem to work though. It has its own device id. It work in the Smartthings implementation. Have I missed something when I I set it up?

Actually, “partially open” is not correct, either. The position is any of “open”, “partially open”, or “closed”. Again, it’s the preset “my position”.

The problem here is that the Somfy motors (awnings, drapes, shades), do not provide any position information. The only “right” way is either:

(a) have the user input, as a preference parameter, the position to which “my position” has been set, or, better,

(2) have the driver make a calibration run to have the user enter the time to “my position” from closed (just as the driver does to get the “time to open” as a preference parameter.

Because users seem to want the Somfy driver to be able to open to, e.g., 10% or 40% or 80%, which the Somfy controls (Decoflex, Telis, etc.) do not permit (only up, down, my position), the driver calculates the time (distance) to go from current position to desired position and sends “stop” to the moving drapes/shades/awnings at the calculated time. But “my position “ could be open, closed, or any point in between, and, to make it more problematic, the user could change the “my position” setting without telling the Hubitat driver, or manually open or close the awnings/drapes/blinds without Hubitat’s knowledge. It’s a mess. Using the Hubitat driver, whether ZRTSI or MyLink, means that you have to give up ever using the manual Somfy controls if you expect the Hubitat driver to be able to move to a % open position (i.e., to anything other than full open, full closed, or “my position”) unless you are willing, when the driver goes to any specified position, to have it go full closed then, after waiting the open/close time, to move a calculated open time from there, with a “stop” at the right moment. That’s the problem with wanting the driver to do something (move to a % position) for which the Somfy interface provides no capability.

Because the motors provide no position information whatsoever, if “my position” command is to show any position whatsoever, unless the user has entered a preference parameter that provides the driver with the preset “my position” percentage open, the only correct displayed position would be “unknown” or “my position” if the driver is asked to do a Stop (“My Position”), because that could put the motor to open, closed, or any position in between.

You probably set “All Blinds” as a Somfy Group, right? In that case, you have an RTS device that is that group, and all blinds respond both to their device and to the group device. You should see it in your integration report in the setup process. It just involves specifying that group as one of the devices, just as you did for each of your blinds.

Point being, if you can see the group in the Somfy mobile app, then you will see the group in the integration report, and you can add it in the Hubitat driver. I know it works because I have our two Bedroom drapes as a Somfy group, and they work in this driver.

672southmain provided a good explanation regarding why having the state status be accurate is challenging for the driver. The somfy api interface provides only three commands: up, down, stop. It provides no status feedback to the driver. This makes implementing features like "go to position" a best effort based on the assumption that only the driver controlled the blinds.

One workaround that would be more robust for position control would be to move the shade to open or closed and then to the desired position. I suspect this would be annoying in practice if you wanted to adjust the position between different amounts.

I am interested in suggestions folks have for maintaining better state synchronization between the driver and the actual position of the shades when a remote or the MyLink app is used.

I don't know what happened. I set this up yesterday and it was working wonderfully, even with Alexa. Now today I tried to ask Alexa to open the shades and it did nothing. I went to the device in Hubitat and tried to open/close or turn on/off manually, and still not working. Any suggestions?

Is it possible that the MyLink changed IP or stopped responding? If so, set up a DHCP lease reservation for it on your router and power cycle the MyLink. Mine goes deaf every few months.

Also, there are two Somfy Alexa skills for MyLink that allow Alexa to control My Link without going through Hubitat.

Finally, your Hubitat may have had lots of reboots during the past week with all the firmware updates. Anything in the Hubitat logs?