Somfy Tahoma Official API


#21
[email protected]:~ $ wget https://github.com/tetienne/somfy-open-api/archive/master.zip
--2018-11-18 13:02:19--  https://github.com/tetienne/somfy-open-api/archive/master.zip
Herleiden van github.com (github.com)... 140.82.118.4, 140.82.118.3
Verbinding maken met github.com (github.com)|140.82.118.4|:443... verbonden.
HTTP-verzoek is verzonden; wachten op antwoord... 302 Found
Locatie: https://codeload.github.com/tetienne/somfy-open-api/zip/master [volgen...]
--2018-11-18 13:02:19--  https://codeload.github.com/tetienne/somfy-open-api/zip/master
Herleiden van codeload.github.com (codeload.github.com)... 192.30.253.120, 192.30.253.121
Verbinding maken met codeload.github.com (codeload.github.com)|192.30.253.120|:443... verbonden.
HTTP-verzoek is verzonden; wachten op antwoord... 200 OK
Lengte: niet-opgegeven [application/zip]
Wordt opgeslagen als: ‘master.zip’

master.zip                                     [ <=>                                                                                    ]  26,07K  --.-KB/s    in 0,1s

2018-11-18 13:02:20 (227 KB/s) - '‘master.zip’' opgeslagen [26696]
[email protected]:~ $ unzip master.zip
Archive:  master.zip
d6bf3e9a01a7a7281914b0f9415a81375c8d74b5
   creating: somfy-open-api-master/
  inflating: somfy-open-api-master/.gitignore
  inflating: somfy-open-api-master/.travis.yml
 extracting: somfy-open-api-master/CHANGELOG.md
  inflating: somfy-open-api-master/LICENSE
 extracting: somfy-open-api-master/MANIFEST.in
  inflating: somfy-open-api-master/README.md
   creating: somfy-open-api-master/pymfy/
 extracting: somfy-open-api-master/pymfy/__init__.py
  inflating: somfy-open-api-master/pymfy/__version__.py
   creating: somfy-open-api-master/pymfy/api/
 extracting: somfy-open-api-master/pymfy/api/__init__.py
   creating: somfy-open-api-master/pymfy/api/devices/
 extracting: somfy-open-api-master/pymfy/api/devices/__init__.py
  inflating: somfy-open-api-master/pymfy/api/devices/base.py
  inflating: somfy-open-api-master/pymfy/api/devices/blind.py
  inflating: somfy-open-api-master/pymfy/api/devices/category.py
  inflating: somfy-open-api-master/pymfy/api/devices/roller_shutter.py
  inflating: somfy-open-api-master/pymfy/api/model.py
  inflating: somfy-open-api-master/pymfy/api/somfy_api.py
  inflating: somfy-open-api-master/requirements.txt
  inflating: somfy-open-api-master/setup.py
   creating: somfy-open-api-master/tests/
 extracting: somfy-open-api-master/tests/__init__.py
  inflating: somfy-open-api-master/tests/get_device.json
  inflating: somfy-open-api-master/tests/get_devices_1.json
  inflating: somfy-open-api-master/tests/get_devices_2.json
  inflating: somfy-open-api-master/tests/get_site.json
  inflating: somfy-open-api-master/tests/get_sites.json
  inflating: somfy-open-api-master/tests/test_command.py
  inflating: somfy-open-api-master/tests/test_somfy_api.py
  inflating: somfy-open-api-master/tests/test_somfy_device.py
  inflating: somfy-open-api-master/tox.ini
[email protected]:~ $ cd somfy-open-api-master
[email protected]:~/somfy-open-api-master $ sudo python setup.py install
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'long_description_content_type'
  warnings.warn(msg)
running install
running bdist_egg
running egg_info
creating pymfy.egg-info
writing requirements to pymfy.egg-info/requires.txt
writing pymfy.egg-info/PKG-INFO
writing top-level names to pymfy.egg-info/top_level.txt
writing dependency_links to pymfy.egg-info/dependency_links.txt
writing manifest file 'pymfy.egg-info/SOURCES.txt'
file src/api.py (for module src/api) not found
reading manifest file 'pymfy.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pymfy.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
file src/api.py (for module src/api) not found
file src/api.py (for module src/api) not found
warning: install_lib: 'build/lib.linux-x86_64-2.7' does not exist -- no Python modules to install

creating build
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying pymfy.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pymfy.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pymfy.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pymfy.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pymfy.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/pymfy-0.1.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing pymfy-0.1.0-py2.7.egg
Copying pymfy-0.1.0-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adding pymfy 0.1.0 to easy-install.pth file

Installed /usr/local/lib/python2.7/dist-packages/pymfy-0.1.0-py2.7.egg
Processing dependencies for pymfy==0.1.0
Searching for typing
Reading https://pypi.python.org/simple/typing/
^Cinterrupted
[email protected]:~/somfy-open-api-master $ sudo python3 setup.py install
/usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
  warnings.warn(msg)
running install
running bdist_egg
running egg_info
writing requirements to pymfy.egg-info/requires.txt
writing dependency_links to pymfy.egg-info/dependency_links.txt
writing pymfy.egg-info/PKG-INFO
writing top-level names to pymfy.egg-info/top_level.txt
file src/api.py (for module src/api) not found
reading manifest file 'pymfy.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pymfy.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
file src/api.py (for module src/api) not found
file src/api.py (for module src/api) not found
warning: install_lib: 'build/lib' does not exist -- no Python modules to install

creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying pymfy.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pymfy.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pymfy.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pymfy.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pymfy.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/pymfy-0.1.0-py3.5.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing pymfy-0.1.0-py3.5.egg
Copying pymfy-0.1.0-py3.5.egg to /usr/local/lib/python3.5/dist-packages
Adding pymfy 0.1.0 to easy-install.pth file

Installed /usr/local/lib/python3.5/dist-packages/pymfy-0.1.0-py3.5.egg
Processing dependencies for pymfy==0.1.0
Searching for typing
Reading https://pypi.python.org/simple/typing/
Downloading https://files.pythonhosted.org/packages/bf/9b/2bf84e841575b633d8d91ad923e198a415e3901f228715524689495b4317/typing-3.6.6.tar.gz#sha256=4027c5f6127a6267a435201981ba156de91ad0d1d98e9ddc2aa173453453492d
Best match: typing 3.6.6
Processing typing-3.6.6.tar.gz
Writing /tmp/easy_install-9ixm8e3a/typing-3.6.6/setup.cfg
Running typing-3.6.6/setup.py -q bdist_egg --dist-dir /tmp/easy_install-9ixm8e3a/typing-3.6.6/egg-dist-tmp-pc_9csg9
zip_safe flag not set; analyzing archive contents...
Moving typing-3.6.6-py3.5.egg to /usr/local/lib/python3.5/dist-packages
Adding typing 3.6.6 to easy-install.pth file

Installed /usr/local/lib/python3.5/dist-packages/typing-3.6.6-py3.5.egg
Searching for requests-oauthlib==0.7.0
Best match: requests-oauthlib 0.7.0
Adding requests-oauthlib 0.7.0 to easy-install.pth file

Using /usr/lib/python3/dist-packages
Finished processing dependencies for pymfy==0.1.0
[email protected]:~/somfy-open-api-master $ cd ..
[email protected]:~ $ cd Downloads
[email protected]:~/Downloads $ python3 contribution.py
Traceback (most recent call last):
  File "contribution.py", line 1, in <module>
    from pymfy.api.somfy_api import SomfyApi
ImportError: No module named 'pymfy'

#22

@johndoe I was able to reproduce your issue. The package uploaded on pypi was… empty. Now if you upgrade pymfy to 0.2.1, it should be OK.

@gieljnssns Your first issue is linked to the python version you use. Minimum version has to be 3.4. For the second error, upload the package as explain just above.

Thx you guys for your feedback.


#23

[SOLVED]
Can I get some explanation about the full callback URL?
I can not get this working…

I used https://hassio.com like above.
When u use the contribute code, you get an URL, paste this in a browser.
Then you have to authorise and your browser will go to another URL, paste this one in the contribute script…


#24

Somfy made a nice schema to explain the flow: https://developer.somfy.com/apis-docs
Later, this callback URL will be replace by the HomeAssistant public url.


#25

Somfy support has been really nice. After some exchange with them, they sent me all the currently supported type. I’ve created an issue for each category: https://github.com/tetienne/somfy-open-api/issues
Their documentation will be soon updated.


#26

With the latest project version, all the devices supported by the Somfy API can be manipulated: blind, roller shutter, camera protect and thermostat.


#27

Hello, aby progress? I realy need orientation of slats (0-100%) my blinds. Openhab can do that, but i dont want OH. :-\ Please, do this function fór as.


#28

Currently I’ve started the development of the new somfy component. But it’s no so easy to understand. The dev documentation is really great but no complete. So I have to look at components such abode or wink to progress. I really want to understand what I do and not simply perform a copy paste. It will ease maintenance later.
About the orientation, I think I will add it as a service. Cover platform does not support it.


#29

Thank you for your answer. Great to hear it. Think you, if tilt will be avalible in this year? Little Jesus or Santa have Google home for me and I want play with it. :wink:
You create tahoma component for hassio?


#30

I cannot give you any deadline. I’m doing this on my freetime, and I have no idea of the amount of code I have to do yet.
I’m not the related to the Tahoma component.


#31

FYI, with the latest version of my client API, I greatly improved the token management. It will help a lot for the Home Assistant component developpment.


#32

I’ve create a first version of the Somfy component and of the Somfy cover platform. You can see my commits here. It’s still a work in progress. I think there is still a lot of improvement to do.


#33

Hello, how can i add component to Hassio RPi? https://www.home-assistant.io/components/cover.somfy/ Doesnt work. :frowning: