I have done the same mistake as you, deleting the integration! Bloody hell, this service is so unreliable… We will have to wait days for it to suddenly work again T-T
The weird thing is that I have a secondary setup (Hassio on Docker, beta channel) which does not seem to have any token expiration problem. Both apps are OK in Somfy developer web site.
My regular setup is a Raspberry Pi 3b+ with Hassio (stable channel).
using hass.io on pi3. using the HACloud and added it with integrations using the OAuth2 account linking service.
yesterday i deleted the integration. if i want to add it now i get an error after logging in that says (simply translated) “error. try again. if it doesn´t work contact support.”
Same problem here, token expired, I deleted the integration and tried adding again. Somfy oauth website says “An error has occurred. Please try again. If the problem persists, please contact our technical support team.”
I had the same problem as everyone since yesterday.
Today I don’t have the same Somfy error message as I can get to the autorisation page but I get the URLs mismatched error :
{"error":"redirect_uri_mismatch","error_description":"The redirect URI provided does not match registered URI(s)."}
The weird thing is that when I set the integration with “Home Assistant Cloud” it is working ! But I would much prefer to make it work with the configuration.yaml as a standalone solution.
On my second instance (Docker), I’m now getting the following error and I cannot control the blind anymore:
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 408, in _async_add_entity
await entity.async_update_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 286, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 327, in _async_write_ha_state
attr.update(self.state_attributes or {})
File "/usr/src/homeassistant/homeassistant/components/cover/__init__.py", line 198, in state_attributes
current = self.current_cover_position
File "/usr/src/homeassistant/homeassistant/components/somfy/cover.py", line 69, in current_cover_position
position = 100 - self.cover.get_position()
TypeError: unsupported operand type(s) for -: 'int' and 'str'
Back for me to, for those that could help, I had to make a change (open/close) to my cover before HA was being able to see them again correctly and I’m using a connexoon box.
What is working for you? I’m still seeing the issue:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 408, in _async_add_entity
await entity.async_update_ha_state()
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 286, in async_update_ha_state
self._async_write_ha_state()
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 327, in _async_write_ha_state
attr.update(self.state_attributes or {})
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/cover/__init__.py", line 198, in state_attributes
current = self.current_cover_position
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/somfy/cover.py", line 69, in current_cover_position
position = 100 - self.cover.get_position()```
I checked a few things about the URI errors (which I still have):
{"error":"redirect_uri_mismatch","error_description":"The redirect URI provided does not match registered URI(s)."}
In the OAuth request URL, I can find the callback URL and it’s exactly the same as the one I declared in the app on Somfy Dev web site.
Does anyone know how to contact Somfy support? It looks like something is wrong here.
Has anyone managed to redo an integration successfully over the last days?
I tested a little patch in somfy/cover.py and it works for me:
old: cover.py vs. new cover.py
70c70
< position = 100 - self.cover.get_position()
---
> position = 100 - int(self.cover.get_position())
The problem is: I don’t know, if this is the only position in the code, where this issue exists. I am sure @tetienne has a better overview and perhaps a more elegant way to fix it
I suggest you to use the cloud solution, instead of the custom one. Somfy tweak the application used by HA to be more robust.
If you really want to use the custom application, you will have perhaps to wait. They have a sync process to propagate the application. So between the moment where you create the app and the moment where this one is enabled, there is a delay.
If after several hours, you still have the issue, you can contact them through the contact form on the somfy dev portal.