Page 6 of 7

Re: Remeha eTwist

Posted: Tuesday 14 January 2025 16:36
by RolandJ
Sorry you have to explain me how to do this.
I do have all electric indeed

Re: Remeha eTwist

Posted: Tuesday 14 January 2025 18:27
by Tuk90
RolandJ wrote: Tuesday 14 January 2025 16:36 Sorry you have to explain me how to do this.
I do have all electric indeed
Do what, can you be more specific? Getting an access token or calling the api or both?

Re: Remeha eTwist

Posted: Tuesday 14 January 2025 19:43
by RolandJ
I have a Elga ace hybrid heatpump maybe you see different stuff if you have an all electric heatpump, if so please share the response body with me.

This is what you asked me to do. Can you let me know how and what you need? Calling api?

Re: Remeha eTwist

Posted: Monday 20 January 2025 9:51
by Tuk90
RolandJ wrote: Tuesday 14 January 2025 19:43 I have a Elga ace hybrid heatpump maybe you see different stuff if you have an all electric heatpump, if so please share the response body with me.

This is what you asked me to do. Can you let me know how and what you need? Calling api?
In the https://github.com/tuk90/RemehaHome-Domoticz page there is a file called Remehatest.py in line 245 and 246 you can fill in your username and password. After that put a # in front of line 151 to out comment that piece of code. Fill in the following line below the outcommented code: print(access_token)

Then run the python code and the access token is printed. If you use a Raspberry pi you can go to the folder of where the script is located and do this: python3 Remehatest.py.

Now you have an access token and this can be used to call all Remeha API's. The apis that you need to call are the following.

Start by doing this get call: https://api.bdrthermea.net/Mobile/api/homes/dashboard, from the response get the applianceid and fill it in in below get call

https://api.bdrthermea.net/Mobile/api/a ... 00:00.000Z.

The easiest way to do this API calls are by using the application Postman

If you can post the response of this call in this topic I am greatfull :).

Re: Remeha eTwist

Posted: Monday 20 January 2025 10:37
by Tuk90
BTW, I updated the plugin to include the 'activeComfortDemand' this states wheter the heatpump is producing heat or not, I use it to dynamically turn on and off my radiator fans

Re: Remeha eTwist

Posted: Wednesday 12 February 2025 12:39
by jvdz
@Tuk90, I just created an issue in github of an error I get since this morning:

Code: Select all

2025-02-12 11:06:06.370 Error: HK-ThermoRemeha: Error making GET request: 'outdoorTemperature'
Maybe others have the same issue?

EDIT Created a PR with the changes I made to accommodate the returned JSON changes and make it work again.

Re: Remeha eTwist

Posted: Wednesday 12 February 2025 14:46
by Tuk90
jvdz wrote: Wednesday 12 February 2025 12:39 @Tuk90, I just created an issue in github of an error I get since this morning:

Code: Select all

2025-02-12 11:06:06.370 Error: HK-ThermoRemeha: Error making GET request: 'outdoorTemperature'
Maybe others have the same issue?

EDIT Created a PR with the changes I made to accommodate the returned JSON changes and make it work again.
I have the same issue, I am short of time today and tomorrow but I will have a look on Friday

Re: Remeha eTwist

Posted: Wednesday 12 February 2025 15:23
by Tuk90
Tuk90 wrote: Wednesday 12 February 2025 14:46
jvdz wrote: Wednesday 12 February 2025 12:39 @Tuk90, I just created an issue in github of an error I get since this morning:

Code: Select all

2025-02-12 11:06:06.370 Error: HK-ThermoRemeha: Error making GET request: 'outdoorTemperature'
Maybe others have the same issue?

EDIT Created a PR with the changes I made to accommodate the returned JSON changes and make it work again.
I have the same issue, I am short of time today and tomorrow but I will have a look on Friday
My other sensors are up again but my outdoor sensor is still down, I will check my JSON response on friday. Is it working for you again?

Re: Remeha eTwist

Posted: Wednesday 12 February 2025 15:30
by jvdz
The PR changes are making it work for me yes.
I have included my JSON response in the PR so you can check and compare with yours. :-)

Re: Remeha eTwist

Posted: Friday 14 February 2025 13:50
by Tuk90
I put out a new version wich solves the outdoortemperature for both Boilers (CV) and Heatpumps (thanks jvzd!), furthermore I added the seasonal efficiency (SCOP) for heatpumps as a new device.

Re: Remeha eTwist

Posted: Friday 14 February 2025 14:13
by RolandJ
Works like a charm! Thanks for the fix. Also the SCOP is present.

Re: Remeha eTwist

Posted: Monday 05 May 2025 10:08
by jvdz
I am getting the following error for the Remeha plugin since 9:25 this morning:

Code: Select all

2025-05-05 09:40:26.538 Error: HK-ThermoRemeha: Call to function 'onHeartbeat' failed, exception details:
2025-05-05 09:40:26.542 Error: HK-ThermoRemeha: Traceback (most recent call last):
2025-05-05 09:40:26.542 Error: HK-ThermoRemeha: File "/home/pi/domoticz/plugins/remeha/plugin.py", line 585, in onHeartbeat
2025-05-05 09:40:26.543 Error: HK-ThermoRemeha: _plugin.onheartbeat()
2025-05-05 09:40:26.543 Error: HK-ThermoRemeha: File "/home/pi/domoticz/plugins/remeha/plugin.py", line 531, in onheartbeat
2025-05-05 09:40:26.544 Error: HK-ThermoRemeha: result = self.resolve_external_data()
2025-05-05 09:40:26.544 Error: HK-ThermoRemeha: File "/home/pi/domoticz/plugins/remeha/plugin.py", line 112, in resolve_external_data
2025-05-05 09:40:26.545 Error: HK-ThermoRemeha: "signUp": "False",
2025-05-05 09:40:26.545 Error: HK-ThermoRemeha: File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 600, in get
2025-05-05 09:40:26.546 Error: HK-ThermoRemeha: return self.request("GET", url, **kwargs)
2025-05-05 09:40:26.546 Error: HK-ThermoRemeha: File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 587, in request
2025-05-05 09:40:26.547 Error: HK-ThermoRemeha: resp = self.send(prep, **send_kwargs)
2025-05-05 09:40:26.548 Error: HK-ThermoRemeha: File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 723, in send
2025-05-05 09:40:26.548 Error: HK-ThermoRemeha: history = [resp for resp in gen]
2025-05-05 09:40:26.549 Error: HK-ThermoRemeha: File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 723, in <listcomp>
2025-05-05 09:40:26.549 Error: HK-ThermoRemeha: history = [resp for resp in gen]
2025-05-05 09:40:26.550 Error: HK-ThermoRemeha: File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 274, in resolve_redirects
2025-05-05 09:40:26.550 Error: HK-ThermoRemeha: **adapter_kwargs,
2025-05-05 09:40:26.551 Error: HK-ThermoRemeha: File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 695, in send
2025-05-05 09:40:26.551 Error: HK-ThermoRemeha: adapter = self.get_adapter(url=request.url)
2025-05-05 09:40:26.552 Error: HK-ThermoRemeha: File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 792, in get_adapter
2025-05-05 09:40:26.552 Error: HK-ThermoRemeha: raise InvalidSchema(f"No connection adapters were found for {url!r}")
2025-05-05 09:40:26.552 Error: HK-ThermoRemeha: requests.exceptions.InvalidSchema: No connection adapters were found for 'com.b2c.remehaapp://login-callback/?error=server_error&error_description=AADB2C90027%3a+Basic+credentials+specified+for+%27SecureREST-AccessToken%27+are+invalid.+Check+that+the+credentials+are+correct+and+that+access+has+been+granted+by+the+resource.%0d%0aCorrelation+ID%3a+68dad916-cab5-40ce-bffe-cb27d5e1ec24%0d%0aTimestamp%3a+2025-05-05+07%3a40%3a26Z%0d%0a&state=WxxxxxxxxuQ'
Is this a generic issue and are others having this issue too ?

Maybe it's an idea to add a try: around this call to avoid the tracestack to be displayed each minute, and just display the lastline error.

Code: Select all

        try:
            response = self._session.get(
                "https://remehalogin.bdrthermea.net/bdrb2cprod.onmicrosoft.com/oauth2/v2.0/authorize",
                params={
                    "response_type": "code",
                    "client_id": "6ce007c6-0628-419e-88f4-bee2e6418eec",
                    "redirect_uri": "com.b2c.remehaapp://login-callback",
                    "scope": "openid https://bdrb2cprod.onmicrosoft.com/iotdevice/user_impersonation offline_access",
                    "state": random_state,
                    "code_challenge": code_challenge_sha256,
                    "code_challenge_method": "S256",
                    "p": "B2C_1A_RPSignUpSignInNewRoomV3.1",
                    "brand": "remeha",
                    "lang": "en",
                    "nonce": "defaultNonce",
                    "prompt": "login",
                    "signUp": "False",
                },
            )
            response.raise_for_status()
        except requests.exceptions.RequestException as e:
            Domoticz.Error(f"Error during GET request to authorize endpoint: {str(e)}")
            return None
        except Exception as e:
            Domoticz.Error(f"Unexpected error during GET request: {str(e)}")
            return None

Re: Remeha eTwist

Posted: Monday 05 May 2025 10:59
by gizmocuz
Same issue, maybe server has issues....

Re: Remeha eTwist

Posted: Monday 05 May 2025 12:12
by RolandJ
I have the same issues.

2025-05-05 12:01:11.629 Error: Remeha: Call to function 'onHeartbeat' failed, exception details:
2025-05-05 12:01:11.630 Error: Remeha: Traceback (most recent call last):
2025-05-05 12:01:11.630 Error: Remeha: File "/opt/domoticz/userdata/plugins/RemehaHome-Domoticz-main/plugin.py", line 595, in onHeartbeat
2025-05-05 12:01:11.630 Error: Remeha: _plugin.onheartbeat()

Re: Remeha eTwist

Posted: Monday 05 May 2025 13:15
by Tuk90
Hi,

It seems that the authentication method has changed:

2025-05-05 13:10:39.428 Error: Remeha Home: requests.exceptions.InvalidSchema: No connection adapters were found for 'com.b2c.remehaapp://login-callback/?error=server_error&error_description=AADB2C90027%3a+Basic+credentials+specified+for+%27SecureREST-AccessToken%27+are+invalid.+Check+that+the+credentials+are+correct+and+that+access+has+been+granted+by+the+resource.

Re: Remeha eTwist

Posted: Monday 05 May 2025 13:45
by jvdz
Just got a notification that it is working again ... so seems it was a Server issue. :-)
jvdz wrote: Monday 05 May 2025 10:08 Maybe it's an idea to add a try: around this call to avoid the tracestack to be displayed each minute, and just display the lastline error.

Code: Select all

        try:
            response = self._session.get(
                "https://remehalogin.bdrthermea.net/bdrb2cprod.onmicrosoft.com/oauth2/v2.0/authorize",
                params={
                    "response_type": "code",
                    "client_id": "6ce007c6-0628-419e-88f4-bee2e6418eec",
                    "redirect_uri": "com.b2c.remehaapp://login-callback",
                    "scope": "openid https://bdrb2cprod.onmicrosoft.com/iotdevice/user_impersonation offline_access",
                    "state": random_state,
                    "code_challenge": code_challenge_sha256,
                    "code_challenge_method": "S256",
                    "p": "B2C_1A_RPSignUpSignInNewRoomV3.1",
                    "brand": "remeha",
                    "lang": "en",
                    "nonce": "defaultNonce",
                    "prompt": "login",
                    "signUp": "False",
                },
            )
            response.raise_for_status()
        except requests.exceptions.RequestException as e:
            Domoticz.Error(f"Error during GET request to authorize endpoint: {str(e)}")
            return None
        except Exception as e:
            Domoticz.Error(f"Unexpected error during GET request: {str(e)}")
            return None

Re: Remeha eTwist

Posted: Monday 05 May 2025 13:50
by RolandJ
Yes working again.

Re: Remeha eTwist

Posted: Monday 05 May 2025 19:25
by jvdz
It is down again as of 17:44 for me with the same messages.

Re: Remeha eTwist

Posted: Monday 05 May 2025 19:33
by Tuk90
Hi,

It is a general system failure, if I logout and try to login again in the app it fails.

Re: Remeha eTwist

Posted: Tuesday 06 May 2025 8:51
by Tuk90
And it is working again. For the future I might need to implement to use the refresh token instead of a fresh authentication when the access token is expired