[RELEASE] Somfy MyLink Hub V1.1 (Roller Shades)

motorizedshades
somfy
project_shades

(Ben Dews) #1

Preview of device page in SmartThings interface

This Device type allows the integration of Somfy Blinds operated via the Somfy MyLink hub.

It implements the SmartThings “Window Shade” and “Switch” capabilities, which means it will work with most Automations based on switching devices on/off, and will natively work with any Window Shade integrations.

Note that this is a WIP and there is still a lot to do :blush:

Here are some example automations that I have found work well:

  • Open blinds at sunrise
    • Don’t open eastern-facing blinds if the maximum forecast temp for the day is above 30°C
  • Close blinds at sunset
  • Close certain blinds when forecast or temperature sensor registers above xx°C
  • Close blinds when nobody is home

Features

v1.0

  • Automatically creates specified devices
  • Allows opening and closing of shades

v1.1

  • “My” button functionality (Preset Position)
  • “Stop” button functionality
  • Emulated level control (I.E Set blind to 60% open). This is not very accurate at small increments due to the SmartThings platform.

To Do

  • Automatically search and add devices
  • See if there is a possible way to read current state of device
  • Add support for Scenes
  • Add support for more device types (if requested)

To Install

Either copy the device handlers directly in to the IDE, or add the repo:

  • Owner: bendews
  • Name: smartthings-somfy-mylink
  • Branch: master

Ensure you add both Device Handlers present in the repo

Once the Device Handlers have been added, we can then add a virtual device via the IDE:

  • Login to the IDE @ https://graph.api.smartthings.com/
  • Click “My Devices”
  • Click the “New Device” Button
  • Enter a “Name” for the device, this can be whatever you want. (I.E “Somfy MyLink Hub”)
  • Enter a “Label” for the device, this is optional and can be whatever you want.
  • Enter a “Device Network Id” This can be anything, however it must be different from any other device. This ID will change once the device has been configured.
  • “Zigbee” Id should be left blank
  • Select a “Type” from the dropdown, this should be “Somfy MyLink Hub”
  • “Version” should be published
  • “Location” should be your hub location, probably “Home”
  • “Hub” should be your hub name
  • “Group” leave as is
  • Click Create

Once created, we can then open the settings for the device, and fill out the following values:

  • Somfy MyLink IP Address: The IP address of the MyLink hub (Can be found in the integration report in the Somfy App)
  • Somfy Mylink Port: Ensure this is set to 44100 if you are not sure
  • Somfy Mylink System ID: The System ID configured in the Somfy App (Can be found in the integration report in the Somfy App)
  • Device 1-5 Name: The human-readable name of the device you are adding
  • Device 1-5 ID: The Somfy targetID of the device you are adding (Can be found in the integration report in the Somfy App)

See the device types below and visit the Repo for more information:


Somfy myLink
(jkp) #2

You should consider editing your instructions above with the following link to IDE instead…
https://account.smartthings.com
:slight_smile:


(Ben Dews) #3

Thank you! Glad to see there’s finally a way around the whole API region thing. I’ll edit it :slight_smile:


(David Williams) #4

First time poster - really excited about this! I have a MyLink in my holiday home to control Somfy powered awnings on the terrace. Somfy’s own Alexa skill is pretty awful, using invocation phrases “ask MyLink to…”… I’m hoping that using this project and the Alexa Skill for Smart Things (and maybe eventually routines support?) might lead, finally, to a more natural language solution…

Will try it out when I’m down there for Easter. Thanks very much Ben!


(Ben Dews) #5

Thats great! Please let me know how it works out and if there are any ideas for improvements that can be added to the list. :slight_smile:


#6

I followed the instructions and set everything up. All the child devices got created, but when I try the open /close operations nothing happens.

I double checked and my somfy IP address is correct (I can telnet to port 44100 on that IP). My system id is correct as well.
The smartthings live log shows the following when I try to “open” my Family Room shades via smartthings:

SOMFY HUB (name of the virtual device I created)

10:18:26 PM: debug {“id”:“1”,“method”:“mylink.move.up”,“params”:{“auth”:“CC23318A”,“targetID”:“CC23318A.1”}}
10:18:26 PM: debug childOpen

Family Room (name of somfy child device)
10:18:34 PM: debug {“name”:“windowShade”,“value”:“open”}
10:18:34 PM: debug updateState
10:18:27 PM: debug {“name”:“switch”,“value”:“on”}
0:18:27 PM: debug updateState
10:18:27 PM: debug {“name”:“switch”,“value”:“on”}
10:18:27 PM: debug updateState
10:18:26 PM: debug Open


(Ben Dews) #7

Any chance you could PM me with the device page for the Somfy Hub in the IDE (My Devices>SOMFY HUB)? That all looks correct.

Another thing you could try doing is pasting {“id”:“1”,“method”:“mylink.move.up”,“params”:{“auth”:“CC23318A”,“targetID”:“CC23318A.1”}} in to the telnet prompt when you have connected to your hub and pressing enter. If that doesn’t work then it should tell you why, if it does work then I’m guessing its an issue with the DNI of the MyLink Hub. :slight_smile:


#8

sent to the email on your website.


(Ben Dews) #9

Hi Everyone,

I have updated this to v1.1 with the following improvements:

  • “My” button functionality (Preset Position)
  • “Stop” button functionality
  • Emulated level control (I.E Set blind to 60% open). This is not very accurate at small increments due to the SmartThings platform.

Unfortunately it looks like the feature I was most excited for (Automatic search and add devices) might not be possible due to SmartThings limitations. It requires the ability to read the response from a TCP stream which is unsupported at this time.

Let me know if there are any questions, comments or feature requests!


(David Williams) #10

Hi Ben

Thanks so much for working on this integration for smart things. I’ve given it a go but seem to have the same problem as the other guy - devices are set up correctly but don’t respond.

Here’s my MyLink integration and Smart Things config pages:

I can telnet to the MyLink using the above IP and port. When I trigger the command in Smart Things, I see this message indicating a parsing error, so at least we know it is sending it to the MyLink correctly:

{“jsonrpc”:“2.0”,“error”:{“code”:-32700,“message”:“Parse error”},“id”:“null”}

I have tried using both a name and instead a number for the SystemId but no difference, Any ideas of what else I might try - it’s my Easter weekend project :slight_smile:

thanks again,

David


(Ben Dews) #11

Hi David, really sorry to hear you’re having issues as well! I’ve sent through a PM with some troubleshooting steps, if you’re able to help go through them with me it would be greatly appreciated. Thanks!


(David Williams) #12

Just a quick message to thank Ben for his help and for producing this great project. It turns out all works perfectly - I simply had the dreaded encoding issue with parenthises between copy and pasting his code across a few editors.

This combined with the SmartThings Alexa integrations works far far better than somfy’s own attempt at a skill.

:+1:


(Chad Holovach) #13

Hi Ben,

I am getting and error when editing the settings in the mobile app. It says “Please fill out all required fields.”

I have completed everything as per your Install Instructions. what could I be missing?


#14

Can’t wait to use this! I’ve installed it using the repository, and followed all the directions to set up my windows, but when I select up (or down) on any window, I get the following error in IDE and of course nothing happens.

dc21a393-0edb-4fb9-bba9-4b81083f5a4c 9:11:07 PM: error java.lang.NullPointerException: Cannot invoke method toFloat() on null object @line 123 (open)
dc21a393-0edb-4fb9-bba9-4b81083f5a4c 9:11:07 PM: debug Open

Any ideas?


(Ben Dews) #15

Hey @Tylert, so sorry about that - I’ve been thinking about how to update this to make it clearer but haven’t had much time.

You need to set an estimated time to open/close (in seconds) in the settings for each device. This allows commands like “Set blind to 50%” to work through Homekit/Google/Alexa.

Unfortunately it isn’t very accurate so I might scrap the functionality entirely.

Let me know if that fixes it :slight_smile:


(Gabriel) #16

Hi Ben, can you share the Synergy Api Spec with me? I requested the spec from Somfy but didn’t hear from them for a couple of weeks.

I can’t control my Somfy Mylink using your DH. Firstly, my Somfy iPhone App doesn’t have an integration report, not sure if this is because it is the Asia version. I can only find the Device ID (CCCC0B50) and the IP address from another page.

I used WireShark to listen to the TCP/IP traffic of MyLink app to check the TCP/IP message and port. I found that it is communicating via port 44040 and the message is not JSON.

I also tried ‘1’ or ‘CCCC0B50’ as system ID and port 44100 / 44040 and it still doesn’t work…


(Vinny B) #17

Hi Ben,
This functionality is great, thank you! controlling devices natively without the need for “Alexa Skills” makes for a much more fluid experience.

With that set up in mind - is there anything I can do to change the commands from “on” and “off” to “open” and “close”?

Maybe something along the lines of changing from a switch to something else?


(Vinny B) #18

Hi Gabriel,
I’m not sure of the regional nuances but I had a similar issue until I updated the firmware of my MyLink.

You should be using the MyLink app version 5.6
(you can find this in the bottom center of the screen when the app is first opening)

and your device firmware version should be 4.92
(you can find this under the info tab)

hopefully that helps


#19

Thanks for your quick response Ben.

I got around this error by commenting out the line which the IDE was complaining about. I’m happy just to have basic open/close functionality for now through SmartThings!

Tyler


(Ben Dews) #20

Hey @VBodetti,

Unfortunately the commands you use are controlled by the platform you are integrating with.

  • Homekit: Open/Close is fully supported and recognises as a blind device type
  • Google Assistant: Open/Close works ~50% of the time. On/Off is fully supported. Works as a light.
  • Alexa: Doesn’t support Open/Close. Works as a light

The best advice I can give is submit a feature request to SmartThings or Amazon :slight_smile: Glad to hear it’s working and you’re enjoying it!