question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[somfymylink] Add Somfy MyLink Binding

See original GitHub issue

The Somfi MyLink device has an TCP/IP interface that supports the Somfy Synergy API. You send json over a TCP socket connection.

e.g. { "id": 1, "method": "mylink.move.down", "params": { "targetID": "CC104A28.1", "auth": "foobar" } }

The MyLink will send responses as well as keep alive messages in json format also.

I have not obtained API documentation from Somfy for this API yet, however have found some examples of others calling it.

e.g. https://community.smartthings.com/t/somfy-mylink/81197/23

There is also an existing integration for smartthings that might be helpful. https://github.com/bendews/smartthings-somfy-mylink

I am a developer (but not done any Java in 10+ years) , and could look at building this binding … but thought i would post here first in case someone had looked at this already or has any guidance.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:35 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
mhilbushcommented, May 26, 2019

Nice! I’ll give it a whirl this week. Actually getting blinds installed on Tuesday, so I’ll be able to do more with the MyLink. It’s pretty useless if you don’t have any motors to pair with it, as it’s not possible to complete the setup without at least one motor to pair.

1reaction
mhilbushcommented, May 20, 2019

@LoungeFlyZ A couple other things I noticed…

  • Improve how you deal with error responses from device
    2019-05-20 08:12:51.250 [DEBUG] [nal.handler.SomfyMyLinkBridgeHandler] - Starting keepalive job in 2 min, every 2 min
    2019-05-20 08:12:51.251 [DEBUG] [nal.handler.SomfyMyLinkBridgeHandler] - Connecting to mylink at 192.168.x.x
    2019-05-20 08:12:51.252 [DEBUG] [nal.handler.SomfyMyLinkBridgeHandler] - Sending: mylink.status.ping Target: *.*
    2019-05-20 08:12:51.252 [DEBUG] [nal.handler.SomfyMyLinkBridgeHandler] - Getting connection to mylink on:192.168.x.x Post: 44100
    2019-05-20 08:12:52.169 [DEBUG] [nal.handler.SomfyMyLinkBridgeHandler] - Got response. Len: 75
    2019-05-20 08:12:52.169 [DEBUG] [nal.handler.SomfyMyLinkBridgeHandler] - got message: {"jsonrpc":"2.0","error":{"code":-32652,"message":"Invalid auth"},"id":496}
    2019-05-20 08:12:52.170 [DEBUG] [nal.handler.SomfyMyLinkBridgeHandler] - Trouble parsing message received. Message:java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 27 path $.error
    2019-05-20 08:13:01.250 [DEBUG] [ry.SomfyMyLinkDeviceDiscoveryService] - Starting scanning for things...
    2019-05-20 08:13:01.251 [INFO ] [ry.SomfyMyLinkDeviceDiscoveryService] - Skipping device discover as bridge is INITIALIZING
    2019-05-20 08:13:07.173 [ERROR] [nal.handler.SomfyMyLinkBridgeHandler] - Timeout sending command to mylink: mylink.status.pingMessage: Read timed out
    2019-05-20 08:13:07.174 [DEBUG] [nal.handler.SomfyMyLinkBridgeHandler] - Problem connecting to mylink, bridge OFFLINE

Other things I noticed in the above log: - fromJason throws a JsonSyntaxException, so you never get to the code that checks for error - perhaps inspect the response for the presence of “error” (Gson has APIs for that), then handle as an error, otherwise call fromJson using the response type you expect - Why is it timing out even though it gets a response? - Reduce log level from ERROR in above (ERROR is reserved for Framework-level errors). This is probably an INFO - Reduce log level from INFO in above (these types of messages are usually logged at DEBUG).

  • Why return something from sendPing if you don’t intend to check it. Make it void?

  • Consider reducing read timeout when waiting for a response from mylink, since openHAB and MyLink will be on a fast network

Read more comments on GitHub >

github_iconTop Results From Across the Web

Somfy myLink - Bindings - openHAB
This binding supports the Somfy myLink (opens new window) device for control of Somfy RTS blinds/shades. # Supported Things. Currently these things are ......
Read more >
How do I add motorized products to my existing myLink? - Somfy
First, go to the main menu of your myLink app and click EDIT. If you have multiple myLinks, select the one you wish...
Read more >
Developers - [somfymylink] Add Somfy MyLink Binding -
The Somfi MyLink device has an TCP/IP interface that supports the Somfy Synergy API. You send json over a TCP socket connection.
Read more >
Somfy myLink Binding missing in 2.5.6 feature.xml · Issue #8008
The add-on Somfy myLink (Binding #5652) is missing a feature.xml file and this prevents the binding from showing up in both paperUI and...
Read more >
Control4 Integration - Screen Innovations
Select and double-click the “Somfy. myLink-UAI- PoE-TaHoma Blind V4” driver from the list. This will add the driver to the currently selected room....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found