few days after I published this integration, Smart activated the CAPTCHA protection (Google Captcha v3 Enterprise) to the login screen. Looks like that do not like that Car Owners use the data of their own car.
I have no plans to work on this component further.
Hi,
There are multiple ways. But each of them needs some IT knowledge and the code of the integration needs some changes
Idea 1:
You can “steal” the refresh_token from the IOS/Android App.
Install a reverse proxy like Burp (community edition is enough)
Install the root certificate from Burp into IOS and trust the the certificate
Change the code of the config_flow.py and remove the Auth-Checks
3a. Add the integration without any login
3b. Stop HA
3c. Create a .smarteqconnect-token-cache file (see content below)
Add the Burp Proxy Address as manual proxy in your IOS
Look for the refresh token in the Burp Logs (is requested every two hours)
Add the refresh token in to your smarteqconnect-token-cache file.
What is expires_in : 7199 (what this number means?) seconds? 120 mins?
expires_at - timestamp format as I suppose - should be let say 1.1.2026 ???
A file .smarteqconnect-token-cache should be placed in HA config root or in custom_components/smarteqconnect directory? Should file include . (dot) in his name?
But I’m lost in “Change the code of the config_flow.py and remove the Auth-Checks”. I can modify these files but what to remove???
Restart HA.
Add the integration and put any value into username and pin.
This will add the integration without a valid auth. please ignore the errors and ignore the reauth task.
Then
stop HA
Copy the result of the request “grant_type=refresh_token” into your .smarteqconnect-token-cache file
Add the attribute , "expires_at": 1640871271 to it (this means the access token is not valid anymore and the integration will request a new access_token with the refresh token
Save the file into your HA-Config root folder
Start HA (The integration will request a new access token and it should work) - at least in my test this was successful
Because I found there is a new version of app - I do not know if this matters or not???
So I can finally show car battery also on my Apple Watch
Rene do you think that there is some possibility to star Pre-Conditioning? Can I help somehow with that? With some logs or access to my car? Your code showed to me how terrible programmer I am
I was able to add the integration without the hassle of using burp.
I added the EQ integration, when asked for the pin I went on the smart website to login. I chose to login with the PIN and the PIN I received worked for HA. I did this in the same browser.
For sure, I was also thinking the same browser would have little impact as the request would come from the HA host and the other from my browser… So their security is not so strong. Lucky us
I am just trying to get this to run using the PIN/TAN created from the mercedes website.
Do I have to repeat this procedure each time I restart HASS, since the integration has to login again?
Another thing I do not understand: the mercedes website asks for password AND pin.
The smarteq integration only asks for the pin, how can this work?
Hi, I can confirm that even in Italy this Custom Component works perfectly.
I also received the same sensors using the MercedesMe2020 component and using my Mercedes Me account.
Using MercedesMe2020 it is possible to have more information, for example the charge_power attribute in kW visible in the image.
Apologies for my google translate english.