hi that don’t work for me :
INFO:homeassistant.util.package:Attempting install of colorlog==4.0.2
Testing configuration at /config
Failed config
General Errors:
- Component not found: somfy
Successful config (partial)
however when I test config that’s ok !?!
i’ve copied all the files!
Add a new App (for testing, redirect url should be your local subnet HA url like http://xxx.xxx.xxx.xxx:yyyy/auth/somfy/callback and don’t forget port number )
Keep info for next.
Then, you need to go to you HA “/config” directory and create a folder named “custom_components” and then a “somfy” subfolder.
You should now have “/config/custom_components/somfy”
In this path, download every file from https://github.com/tetienne/home-assistant/tree/somfy-open-api/homeassistant/components/somfy (verify that you download the “Raw” version of each files)
Now you need to edit 2 files :
in __init__.py :
change from homeassistant.components.somfy import config_flow
to from custom_components.somfy import config_flow
and in cover.py :
change from homeassistant.components.somfy import DOMAIN, SomfyEntity, DEVICES, API
to from custom_components.somfy import DOMAIN, SomfyEntity, DEVICES, API
On the first start, you’ll have a “Somfy Card” with a “Link” where you’ll be redirected to somfy, to make the OAuth2 process (you’ll need to login to make the link approved from HA to Somfy API)
Now you should have every known components in your UI.
Hope that everything is understandable, and that will work for you.
Important notice, you need to have a recent HA, i’ve just tested this procedure on my fresh new 0.87.1
Hi, Thanks very good instruction.
All is OK till the last auth when I receive:
{“error”:“redirect_uri_mismatch”,“error_description”:“The redirect URI provided does not match registered URI(s).”}
Many thanks @koomik for this explanation. It’s almost perfect, except for the redirect part. I guess i’s why @robertpe got his error.
@robertpe, Somfy returns this message when the redirect uri you set does not match your home assistant uri. The redirect uri must be <your hass uri>/auth/somfy/callback.
Keep in mind this component is not yet perfect, I got several remarks on my pull request.
Sorry for my mystake.
This is what i used on the Somfy Dev App http://192.168.98.20:8123/auth/somfy/callback
This is the internal IP of the Docker instance hosting HA, with the TCP port 8123
Hi @robertpe , have you tried the test platform https://developer.somfy.com/somfy-open-api/apis
You first need to use the “GET /site” to obtain your “Site ID” (you’ll have to click at least one time on the “OAuth2” button and then “Try it out”. The response is in JSON format
With your SiteID, go back and use the “GET /site/{siteid}/device”
Put your Site_ID in the “Ressource URL” and Click on “Try it out”
The JSON result will give you every device recognized by the Somfy Open API.
You should have your hub and your 2 devices.
If not, maybe the “type” of the second cover is not yet included in the API (but it’s weird if they are strictly the same)
Log Details (ERROR)
Mon Feb 18 2019 09:34:10 GMT+0100 (CET)
Unexpected error generating auth url
Traceback (most recent call last):
File “/config/custom_components/somfy/config_flow.py”, line 99, in async_step_auth
url = await self._get_authorization_url()
File “/config/custom_components/somfy/config_flow.py”, line 114, in _get_authorization_url
from pymfy.api.somfy_api import SomfyApi
ModuleNotFoundError: No module named ‘pymfy’
Could you reboot your HA ? Which version of HA do you have ?
I thought that the pymfi component was downloaded because of the requirements.
If reboot doesn’t help, you will need to run this in your HA : pip install https://github.com/tetienne/somfy-open-api/archive/0.5.1.tar.gz
Do you have a “Bell” icon at (top right) ? Maybe the configuration card is there
To run pip, you need to have access to a command line (via ssh, or terminal in docker)