core: Somfy : Cannot update devices: 404
The problem
Error when setup Somfy integration with Developper Account : no entities are imported and an error “Cannot update devices: 404” is raised
Environment
- Home Assistant Core release with the issue: 0.117.0 (same issue on 0.116)
- Last working Home Assistant Core release (if known): NA
- Operating environment (OS/Container/Supervised/Core): HassOS 4.15 on Pi3
- Integration causing this issue: Somfy
- Link to integration documentation on our website: https://www.home-assistant.io/integrations/somfy/
Problem-relevant configuration.yaml
somfy:
client_id: XXXX
client_secret: YYYY
Traceback/Error logs
2020-10-28 22:02:54 INFO (MainThread) [homeassistant.components.somfy.config_flow] Successfully authenticated
2020-10-28 22:02:58 WARNING (MainThread) [homeassistant.components.somfy] Cannot update devices: 404
Additional information
I have a Connexoon bridge. I tried manually to call Somfy API from https://developer.somfy.com/somfy-open-api/apis/get/site and I successfully accessed to my Sites and Devices :
GET https://api.somfy.com/api/v1/site
[
{
"id": "XXX",
"label": "Maison XXX"
},
{
"id": "YYYY",
"label": "Maison YYY"
},
{
"id": "ZZZ",
"label": "Connexoon"
}
]
GET https://api.somfy.com/api/v1/site/ZZZZ/device
[
{
"id": "AAAAAA",
"type": "roller_shutter_positionable_stateful_rs100",
"parent_id": "BBBBB",
"categories": [
"actuator",
"roller_shutter"
],
"states": [
{
"name": "position",
"value": 100,
"type": "integer"
}
],
etc...
I have 6 Roller Shutter available in Somfy API.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 24 (9 by maintainers)
Commits related to this issue
- Handle error 404 when looping on the sites - See https://github.com/home-assistant/core/issues/42526 — committed to tetienne/somfy-open-api by tetienne 4 years ago
- Handle error 404 when looping on the sites (#57) See home-assistant/core#42526 — committed to tetienne/somfy-open-api by tetienne 4 years ago
Thx @BenFR23 I’m working on a fix. Should be easy to do it 😉
@tetienne here is the result from developer website :
GET /api/v1/site/XXXX-XXXXX-XXXXX-XXXXX/device HTTP/1.1Ok I have found the cause. It’s related to the pymfy lib. I have tested this lib with my credential according to the example usage and I get the same error 404.
My analysis : I have multiple siteId in my account. But I don’t have devices available for all sites.
So the request GET /site/XXXXX/device fails with a 404 error. But the pymfy lib stops and raise this 404 error. (See here).
@tetienne I think that is an issue with pymfy lib ? Do you want me to create an issue on the lib side ?
@totothekiller Issue has been fixed on Somfy side. You can now close this ticket if you can confirm it works for you. On my side, it’s good.
for me it’s the side Id we get when we use the site API GetAllUserSite this API returns to me the two sites (tahoma + alarm)
[ { “id”: “XXXXXXXXXXXXXXXXXX”, “label”: “TaHoma” }, { “id”: “YYYYYYYYYYYYYYYYYY”, “label”: “Alarme” } ]
Hello, I have updated to HA 0.117.5, deleted the Somfy, and retry to add… still same issue
Same as @BenFR23 , it’s working on developer.somfy.com
It is possible to show the exact URL that raise the 404 error ?
Wait for the next release, there was a refactor of the component. Perhaps it will help in your case.