Setting up the plugin

howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Setting up the plugin

Post by howartp »

Thanks, I’ll take a look.


Sent from my iPhone using Tapatalk Pro
gt3mike
Posts: 225
Joined: Sun Dec 31, 2017 2:01 pm
Location: Colorado

Re: Setting up the plugin

Post by gt3mike »

The continuous ping seems to keep the MyLink "awake" most of the time. With it running, the shade almost always responds to the Indigo command. Occasionally it won't respond to the Indigo command, and when I check the terminal window I can see "FAIL" messages indicating that the MyLink is offline for some reason. It almost always comes back online by itself. Only once every couple of months do I find that I need to power cycle the MyLink.
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Setting up the plugin

Post by howartp »

Hi Mike.

I've just pushed https://github.com/howartp84/SomfyManag ... /tag/1.0.4

There's an optional Keep Alive in the plugin config, which pings every 0 seconds then silently (debug mode) suceeds or throws red Error in the log if it fails.

I can't test the actions of the MyLink or motors, so could you try it out with debug mode on, then paste the logs of what each function returns - once they "work" I want to represent the status etc in the indigo device states/properties but I can't read back what's happening without the unit to test.

Peter
rgspb
Posts: 220
Joined: Fri Apr 24, 2009 8:42 am
Location: Florida

Re: Setting up the plugin

Post by rgspb »

So I'm really over my head with this one but i'm trying. Here's what I get when I try to run the close script:

Action Group Master Large Window Shade Close
Embedded script executor host1 started
Error because embedded scripts execute sequentially they must complete their execution within 10 seconds.
Error modify the script to exit quickly or convert it to an external file (not embedded).
Stopping embedded script executor host1 (pid 90065)
Script Error embedded script: [Errno 4] Interrupted system call
Script Error Exception Traceback (most recent call shown last):

embedded script, line 3, at top level
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/telnetlib.py", line 211, in __init__
self.open(host, port, timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/telnetlib.py", line 227, in open
self.sock = socket.create_connection((host, port), timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 575, in create_connection
raise err
error: [Errno 4] Interrupted system call

Stopped "embedded script executor host1"
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Setting up the plugin

Post by howartp »

Is that definitely the plugin?

I'm confused as it's referring to an embedded script but the plugin isn't running embedded scripts?

Peter
rgspb
Posts: 220
Joined: Fri Apr 24, 2009 8:42 am
Location: Florida

Re: Setting up the plugin

Post by rgspb »

Apologies, I’m running a script from another post because I never really figured out how to use the plugin. Sorry for the confusion. Is there a step by step somewhere on how to set things up using the plugin?
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Setting up the plugin

Post by howartp »

Ah :)

Install the plugin, create a Somfy MyLink device with the IP of your MyLink, then a Somfy Motor device with the ID of your blind (something like AABBCCDD.1)

Then create an Action > Somfy MyLink > Open Blind and point it at the motor device.

Run the action.

Peter
rgspb
Posts: 220
Joined: Fri Apr 24, 2009 8:42 am
Location: Florida

Re: Setting up the plugin

Post by rgspb »

So what exactly goes in the MyLink Password field? I remember before when I set this up it was the name of the MyLink setup as opposed to the password for the account. And where do I find the actual numbers for each device, I have four?
rgspb
Posts: 220
Joined: Fri Apr 24, 2009 8:42 am
Location: Florida

Re: Setting up the plugin

Post by rgspb »

Here's what I get when I try to setup a Somfy MyLink device:

Somfy Manager Connecting to MyLink: 192.168.1.60
Somfy Manager Error Error in plugin execution ServerReplacedElem:

Traceback (most recent call last):
File "/Library/Application Support/Perceptive Automation/Indigo 7.4/IndigoPluginHost.app/Contents/Resources/PlugIns/plugin_base.py", line 1179, in deviceUpdated
File "plugin.py", line 85, in deviceStartComm
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/telnetlib.py", line 211, in __init__
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/telnetlib.py", line 227, in open
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 575, in create_connection
error: [Errno 61] Connection refused
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Setting up the plugin

Post by howartp »

Hi

I've stolen this from the SmartThings integration of MyLink:
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)
Does that help?

Peter
rgspb
Posts: 220
Joined: Fri Apr 24, 2009 8:42 am
Location: Florida

Re: Setting up the plugin

Post by rgspb »

Definitely, but what goes into the "MyLink Password" field? Here's what I get now when I setup the Somfy MyLink device:

Somfy Manager Connecting to MyLink: 192.168.1.50
Somfy Manager Debug <telnetlib.Telnet instance at 0x109a55710>
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Setting up the plugin

Post by howartp »

MyLink password is the MyLink system ID referred to in the quoted Smartthings docs.

The API calls it a password but if users are more familiar with it being called the system ID then i'll change the wording (and the description now i've found those notes) in the plugin itself.

That telnetlib looks ok, it sounds like it's successfully made a connection to the MyLink, at a network level - once the password/system ID is correct, the MyLink should start accepting up/down commands.

Peter
rgspb
Posts: 220
Joined: Fri Apr 24, 2009 8:42 am
Location: Florida

Re: Setting up the plugin

Post by rgspb »

That did it! Yes it's confusing when it calls for a "Password" when it really wants the ID. After that everything was really simple, just as you described.

Thanks!
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Setting up the plugin

Post by howartp »

Hooray!

Is the log reporting any feedback from the blind? Can you paste the debug log when it's running an action?

Peter
rgspb
Posts: 220
Joined: Fri Apr 24, 2009 8:42 am
Location: Florida

Re: Setting up the plugin

Post by rgspb »

Here's what the log shows to place one blind in the "favorite" position:

Action Group Master Bath Shade Favorite
Somfy Manager Debug myLinkCmdSingle action called:
Somfy Manager Debug Target device: CC1049A9.4
Somfy Manager Sending payload: { "id":680, "method": "mylink.move.stop", "params": { "auth": "bayfront", "targetID" : "CC1049A9.4"} }
Somfy Manager Debug Reply from 680: {"jsonrpc":"2.0","result":true,"id":651}{"method":"mylink.status.keepalive"}{"method":"mylink.status.keepalive"}{"method":"mylink.status.keepalive"}{"method":"mylink.status.keepalive"}
Post Reply

Return to “Somfy Manager”