Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication issue after app migration #151

Open
smart opened this issue Dec 4, 2024 · 27 comments
Open

Authentication issue after app migration #151

smart opened this issue Dec 4, 2024 · 27 comments
Labels
bug Something isn't working

Comments

@smart
Copy link

smart commented Dec 4, 2024

I just migrated from the north america app to the new "Somfy" app, it had my account do a transfer. When I try to setup the cloud or local api integration in home assistant I get an Unexpected Error. I'm wondering if the migration changed any api endpoints? Issue is here home-assistant/core#132228

@lbreggi
Copy link

lbreggi commented Dec 4, 2024

same for me

@magurac
Copy link

magurac commented Dec 4, 2024

Add me to the list. It doesn’t work after the app update. The good news is the app will allow me to control the blinds until this integration is fixed.

@llavorel-somfy
Copy link
Contributor

Hello @smart
Can you be more explicit about the error you get when using TaHoma developer mode ?

@llavorel-somfy llavorel-somfy added the question Issue to ask support on API usage label Dec 5, 2024
@iMicknl
Copy link

iMicknl commented Dec 5, 2024

@llavorel-somfy did the server URL change for North America users after the migration to the new TaHoma app?

@magurac
Copy link

magurac commented Dec 5, 2024

Not sure how much this will help. I can't recall exact details, but there are messages about migrating you to a new server (don't think they showed details). I can say that it's a new app (on iPhone). If I try to use the old app with the same logon credentials, it fails. However, using the same credentials on their new app works just fine.

@magurac
Copy link

magurac commented Dec 5, 2024

Here's what was sent out:

Screenshot 2024-12-05 at 08 47 19

@smart
Copy link
Author

smart commented Dec 5, 2024

Hello @smart Can you be more explicit about the error you get when using TaHoma developer mode ?

Wish, I could, here is what's in the logs below. I also enabled debug mode and saw nothing else. I tried to manually edit the code for the post request in the client library to show response logs, but didn't get them to show up in home assistant logs (no python experience). I think local authenticates then exchanges for a token? So both modes are failing with Unexpected update since the migration from north america to Somfy app. There was a transfer process when using the new Somfy app that took a few minutes to complete. If you do that yourself you may end up in this state. If the endpoint didn't change, maybe the response payload did, causing the error.

Logger: homeassistant.components.overkiz
Source: components/overkiz/config_flow.py:148
integration: Overkiz (documentation, issues)
First occurred: December 3, 2024 at 5:34:14 PM (6 occurrences)
Last logged: 6:06:31 AM

Unknown error
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/overkiz/config_flow.py", line 148, in async_step_cloud
await self.async_validate_input(user_input)
File "/usr/src/homeassistant/homeassistant/components/overkiz/config_flow.py", line 64, in async_validate_input
await client.login(register_event_listener=False)
File "/usr/local/lib/python3.12/site-packages/pyoverkiz/client.py", line 229, in login
response = await self.__post("login", data=payload)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyoverkiz/client.py", line 924, in __post
await self.check_response(response)
File "/usr/local/lib/python3.12/site-packages/pyoverkiz/client.py", line 1041, in check_response
raise OverkizException(result)
pyoverkiz.exceptions.OverkizException: {'errorCode': 'AUTHENTICATION_ERROR', 'error': 'An API key is required to access this setup'}

@lrixford
Copy link

lrixford commented Dec 5, 2024

@llavorel-somfy Loaded Postman to diagnose. The first call:

POST https://ha401-1.overkiz.com/enduser-mobile-web/enduserAPI/login with proper application/x-www-form-urlencoded userId & userPassword

Returns

{
"errorCode": "AUTHENTICATION_ERROR",
"error": "An API key is required to access this setup"
}

Screenshot 2024-12-05 115738

If you supply incorrect credentials, you get a different error.

Response w/ Bad Credentials

{
"errorCode": "AUTHENTICATION_ERROR",
"error": "Bad credentials"
}

@crutch68k
Copy link

Same here, just started after I did the new Tahoma app migration, broke ability to use the local API:

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" \
	-d '[email protected]&userPassword=xxxxxxxxxxxxxxxx' \
	https://ha401-1.overkiz.com/enduser-mobile-web/enduserAPI/login

Using proper credentials:

{"errorCode":"AUTHENTICATION_ERROR","error":"An API key is required to access this setup"}

Using bad credentials:

{"errorCode":"AUTHENTICATION_ERROR","error":"Bad credentials"}

@llavorel-somfy
Copy link
Contributor

Hello everyone,
No server change but a new authentication policy. Indeed, this might affect the login procedure to generate a token for the developermode.
I'll mark this thread as a bug.
Sorry for the inconvenience !

@llavorel-somfy llavorel-somfy added bug Something isn't working and removed question Issue to ask support on API usage labels Dec 6, 2024
@llavorel-somfy
Copy link
Contributor

llavorel-somfy commented Dec 6, 2024

In the meantime, if you need a token to access the developerMode, you can reach out to [email protected] providing your gateway_pin and mentioning this issue #151

@lbreggi
Copy link

lbreggi commented Dec 10, 2024

thanks @llavorel-somfy! any idea when is it going to be solved? It is very challenging to do manually in Home Assistant. really appreciate your help!

@llavorel-somfy
Copy link
Contributor

Hi @lbreggi
We want to provide a new way to generate token that will not interfer with migrations.
We target to deliver this new feature during the 1st semester of 2025

@erikvaliquette
Copy link

Same issue with me after migration to the new app. Tried with the North American server, via local or cloud, then Europe server, local or cloud and I can't authenticate. I get a "Your Somfy Protect hardware is not supported by this integration" error. Do blinds fall under protect?

@llavorel-somfy
Copy link
Contributor

Hello @erikvaliquette

Where du you get this message from ?

@erikvaliquette
Copy link

erikvaliquette commented Jan 2, 2025 via email

@brettautrey
Copy link

Hi @lbreggi We want to provide a new way to generate token that will not interfer with migrations. We target to deliver this new feature during the 1st semester of 2025

This will be a fantastic day when we can reconnect HA to Somfy (either cloud or local). Thanks!

@llavorel-somfy
Copy link
Contributor

Hi @brettautrey

The TaHoma developer Mode is still available. Only misses the possibility to generate a token autonomously for users in North America that migrated to the new App (issue #151)

@magurac
Copy link

magurac commented Jan 23, 2025

I agree and would love to have the ability to connect Somfy back to HA. Unfortunately for me, I am in North America and I did migrate to the new app. Are there any detailed steps on how to use the developer mode and does that work with a Beacon? I thought I read somewhere that it didn't support developer mode?

@BernoldNL
Copy link

I agree and would love to have the ability to connect Somfy back to HA. Unfortunately for me, I am in North America and I did migrate to the new app. Are there any detailed steps on how to use the developer mode and does that work with a Beacon? I thought I read somewhere that it didn't support developer mode?

There is a workaround you can use. It has already been described on December 6. Ask the HA guys how to import the received token into HA. Users of my (non HA) integration have confirmed that works, also for TaHoma Beecon. Developer Mode has been added for it about 2 months ago, so you may want to make sure it has a recent firmware.

@magurac
Copy link

magurac commented Jan 23, 2025

Thanks for the feedback, @BernoldNL. I'll take another look.

@mcyberg
Copy link

mcyberg commented Feb 12, 2025

I contacted Somfy support and they answered:" Tahoma is not designed to work with Home Assistant here in the U.S. as we do not have a way to generate a token. We reply on our partnership with various 3rd party integration companies as well as Google and Alexa. If Home Assistant can tie into Alexa or Google Home, I would see if we could use that as a meeting point for the two systems." Anyone in US able to complete this integration?

@davekolm
Copy link

I've just recently started working with Home Assistant, and loving it. I can't thank the community enough for all the integrations and the level of support given -- both on issues like this, and answering newbie questions. I was using IFTTT until recently and imo there is simply no comparison...

As an FYI, I was using IFTTT for Somfy (North America TaHoma) cloud integration, and it also broke in December -- I'm sure due to the same Somfy API changes. IFTTT told me Somfy will not support them, and they've now removed this integration from their offering.

I haven't tried the HA / TaHoma developer mode integration yet (likely will soon), but the response Somfy gave @mcyberg (above) makes me worry about relying on it long term. And even if someone can backwards engineer the cloud API, it's clearly unsupported by Somfy and subject to future issues. On the other hand, @knwpsk on THIS thread had good things to say about Somfy support so fingers crossed...

While I'm hoping the above will all get resolved, having a "plan b" seems like a good idea to me. Thus, I'm now working on an HA integration that requires ZERO Somfy API support -- cloud or local. Specifically, I found an integration that uses a super-cheap RF emitter to mimic a Somfy remote: Nickduino's Pi-Somfy.

You do need to do a small amount of soldering (actually, it's the required unsoldering that's the hard part), but the site has great instructions. The software does need to have a few tweaks to run on python3, but it even has an MQTT integration w/ HA. I'm currently running this on a Raspberry Pi Zero 2 W (about $30 all-in). I'm unsure about being able to run this on my HA Yellow as it does rely on having a GPIO pin available. I've only had a chance to do some very basic testing, but so far, so good. I still have some automation work to do before I can really stress test it with day-to-day automations.

@llavorel-somfy
Copy link
Contributor

Hi @mcyberg @davekolm

I understand that the answer from my colleague in the US can be confusing. Indeed, Somfy has not developed any integration for Home Assistant. We simply provide what we call here the TaHoma Developer Mode that enable a local API on the different TaHoma gateways that users are free to use to integrate in the manner they want. We do not have ownership of this integrations so we can't provide support about. Nevertheless, we do provide support regarding this local API on this github project.

As said in this thread, if you need to generate a token for using the Developer Mode you can reach out at the given email address ⬆️before we provide a new way to authenticate for users who migrated to the new App.

@mcyberg
Copy link

mcyberg commented Feb 14, 2025

Hello @llavorel-somfy Im reaching out per message above to generate a token for developer mode. If this is not the proper method please provide the email address to send.

@mcyberg
Copy link

mcyberg commented Feb 14, 2025 via email

@llavorel-somfy
Copy link
Contributor

Proper method : #151 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests