BAXI TXM / RXM 10c OpenTherm thermostat - HA integration

How do you get all this information?

Googling and trying error :slight_smile:

Hi @Roto_Dos , try removing some of the links marked in red and add a debug output. Probably one of the objects is not received or has other name.

If it doesnā€™t help you send me a screenshot.

restful to read values from baxi API

# api baxi configuration.yaml
sensor:
  - platform: rest
    name: Baxi
    scan_interval: 600
    json_attributes:
      - roomTemperature
      - roomTemperatureSetpoint
      - outsideTemperature
    value_template: "OK"  
    resource_template: https://ruapi.remoteapp.bdrthermea.com/v1.0/central-heating-zone/1E10FFFFFFFF010/status
    headers:
      Authorization: >
        Basic cnVhcHA6V25AW1tjJF1QfjghM2AoW35BZiUnSDI/bEh3XWNpaXE6cn1MT3pqTGsueTVNSCtfcT0=
      X-Bdr-Pairing-Token: >
        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxyourTockenxxxxxxxxxxxxxxxx
      Accept: >
        application/json, text/plain, */*
        
  - platform: template
    sensors:
      temperaturaactual:
        friendly_name: "roomTemperature"
        value_template: "{{ state_attr('sensor.Baxi', 'roomTemperature')['value'] }}"
        device_class: temperature
        unit_of_measurement: "Ā°C"
      temperaturaconfigurada:
        friendly_name: "roomTemperatureSetpoint"
        value_template: "{{ state_attr('sensor.Baxi', 'roomTemperatureSetpoint')['value'] }}"
        device_class: temperature
        unit_of_measurement: "Ā°C"
      temperaturacarrer:
        friendly_name: "outsideTemperature"
        value_template: "{{ state_attr('sensor.Baxi', 'outsideTemperature')['value'] }}"
        device_class: temperature
        unit_of_measurement: "Ā°C"

climate:
  - platform: generic_thermostat
    name: termostatentrada
    heater: switch.setbaxitemp
    target_sensor: sensor.temperaturaactual
	
	
switch:
  - platform: command_line
    switches:
      setbaxitemp:
        friendly_name: "setbaxitemp:"
        command_on: "/usr/bin/curl -X PUT https://ruapi.remoteapp.bdrthermea.com/v1.0/central-heating-zone/1E10FFFFFFFF010/setpoint/manual -H 'Content-Length: 32' -H 'Accept: application/json, text/plain, */*' -H 'X-Bdr-Pairing-Token: xxxxxxxxxxxxxyourtokenxxxxxxxxx' -H 'Authorization: Basic cnVhcHA6V25AW1tjJF1QfjghM2AoW35BZiUnSDI/bEh3XWNpaXE6cn1MT3pqTGsueTVNSCtfcT0=' -H 'Content-Type: application/json' -H 'X-Requested-With: com.bdrthermea.roomunitapplication.baxi' -H 'Sec-Fetch-Site: cross-site' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Dest: empty' -H 'Accept-Encoding: gzip, deflate'  -d '{\"roomTemperatureSetpoint\":25}'"
        command_off: "/usr/bin/curl -X PUT https://ruapi.remoteapp.bdrthermea.com/v1.0/central-heating-zone/1E10FFFFFFFF010/setpoint/manual -H 'Content-Length: 32' -H 'Accept: application/json, text/plain, */*' -H 'X-Bdr-Pairing-Token: xxxxxxxxxxxxxyourtokenxxxxxxxxx' -H 'Authorization: Basic cnVhcHA6V25AW1tjJF1QfjghM2AoW35BZiUnSDI/bEh3XWNpaXE6cn1MT3pqTGsueTVNSCtfcT0=' -H 'Content-Type: application/json' -H 'X-Requested-With: com.bdrthermea.roomunitapplication.baxi' -H 'Sec-Fetch-Site: cross-site' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Dest: empty' -H 'Accept-Encoding: gzip, deflate'  -d '{\"roomTemperatureSetpoint\":15}'"

I have tried to change the temperature on the curl dynamicaly but it does not work
-d ā€˜{ā€œroomTemperatureSetpointā€:{{ state_attr(ā€˜climate.termostatentradaā€™ , ā€˜temperatureā€™)}}}ā€™"

Hello,
Based on the info that @ibernat and @Domaray provided (many thanks guys), I have created a custom integration for the baxi thermostat (GitHub - vipial1/BAXI_thermostat: Custom component for BAXI themostat integration). I think it is easier than relaying on node-red.
It allows to see some data and also change the target temperature from HA.
Please, be aware that a LOT of testing and refactoring is still pending, so test under your own risk.
I am also a bit stuck with additional functionality because I donā€™t know the need parameters for some API calls (for example, /setpoint/manual needs ā€œroomTemperatureSetpointā€ā€¦but what about /setpoint/schedule? ā€¦I donā€™t know how to get it)
It looks like this (I will add more useful attributes soon):

3 Likes

Other API parameters:

Gas consmumtion every day in kw, so you can see the price of the bill aproximately

GET /history/e380b792-94fa-4c79-9b8f-feea0a7673db/query?type=hotwater&from=2021-11-29&to=2021-12-05&groupBy=DAY

GET /history/e380b792-94fa-4c79-9b8f-feea0a7673db/query?type=heating&from=2021-11-29&to=2021-12-05&groupBy=DAY HTTP/1.1
Host: remoteapp.bdrthermea.com
Connection: keep-alive
Accept: application/json, text/plain, */*
amdatu_token: xxxxxxxxxxxxxxxxxxxxxx
User-Agent: Mozilla/5.0 (Linux; Android 10; Mi 9 Lite Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/96.0.4664.45 Mobile Safari/537.36
X-Requested-With: com.bdrthermea.roomunitapplication.baxi
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Accept-Encoding: gzip, deflate
Accept-Language: ca-ES,ca;q=0.9,en-US;q=0.8,en;q=0.7

HTTP/1.1 200 OK
Date: Thu, 02 Dec 2021 21:01:07 GMT
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: *, amdatu_token
Content-Type: application/json
Transfer-Encoding: chunked

[{"start":"2021-11-29","value":0,"prediction":false,"temperature":0.0},{"start":"2021-11-30","value":14,"prediction":false,"temperature":0.0},{"start":"2021-12-01","value":0,"prediction":false,"temperature":0.0},{"start":"2021-12-02","value":48,"prediction":false,"temperature":0.0},{"start":"2021-12-03","value":0,"prediction":false,"temperature":0.0},{"start":"2021-12-04","value":0,"prediction":false,"temperature":0.0},{"start":"2021-12-05","value":0,"prediction":false,"temperature":0.0}]

This is to configure the power of the heater, these values are from the tecnical spects of the boiler

PUT /v1.0/producers/1E10FFFFFFFF/parameters/power-settings HTTP/1.1
Host: ruapi.remoteapp.bdrthermea.com
Connection: keep-alive
Content-Length: 51
Accept: application/json, text/plain, */*
X-Bdr-Pairing-Token: xxxxxxxxxxxxxxxxxxxxxxxxx
Authorization: Basic cnVhcHA6V25AW1tjJF1QfjghM2AoW35BZiUnSDI/bEh3XWNpaXE6cn1MT3pqTGsueTVNSCtfcT0=
User-Agent: Mozilla/5.0 (Linux; Android 10; Mi 9 Lite Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/96.0.4664.45 Mobile Safari/537.36
Content-Type: application/json;charset=UTF-8
X-Requested-With: com.bdrthermea.roomunitapplication.baxi
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Accept-Encoding: gzip, deflate
Accept-Language: ca-ES,ca;q=0.9,en-US;q=0.8,en;q=0.7

{"minPowerCH":3.8,"maxPowerDHW":26,"maxPowerCH":20}

HTTP/1.1 204 No Content
Date: Thu, 02 Dec 2021 21:03:00 GMT
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: *, amdatu_token

GET /v1.0/producers/1E10FFFFFFFF/parameters/power-settings HTTP/1.1
Host: ruapi.remoteapp.bdrthermea.com
Connection: keep-alive
Accept: application/json, text/plain, */*
X-Bdr-Pairing-Token: xxxxxxxxxxxxxxxxxxxx
Authorization: Basic cnVhcHA6V25AW1tjJF1QfjghM2AoW35BZiUnSDI/bEh3XWNpaXE6cn1MT3pqTGsueTVNSCtfcT0=
User-Agent: Mozilla/5.0 (Linux; Android 10; Mi 9 Lite Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/96.0.4664.45 Mobile Safari/537.36
X-Requested-With: com.bdrthermea.roomunitapplication.baxi
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Accept-Encoding: gzip, deflate
Accept-Language: ca-ES,ca;q=0.9,en-US;q=0.8,en;q=0.7

HTTP/1.1 200 OK
Date: Thu, 02 Dec 2021 21:00:47 GMT
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: *, amdatu_token
Content-Type: application/json
Transfer-Encoding: chunked

{"minPowerCH":{"value":3.8,"unit":"kW","min":0.0,"max":50.0,"increment":0.1},"maxPowerCH":{"value":20.0,"unit":"kW","min":0.0,"max":150.0,"increment":0.1},"maxPowerDHW":{"value":26.0,"unit":"kW","min":0.0,"max":150.0,"increment":0.1}}

Configure the heating curve depending on outdoor temperature (boiler external temperature sensor must be installed)

GET /v1.0/central-heating-zone/1E10FFFFFFFF010/parameters/heating-curve HTTP/1.1
Host: ruapi.remoteapp.bdrthermea.com
Connection: keep-alive
Accept: application/json, text/plain, */*
X-App-Id: YWU5NmI3ODItNDdmNi00NmU1LWI4ZWQtZWM3NTkxMjdhZTQy
X-Bdr-Pairing-Token: xxxxxxxxxxxx
Authorization: Basic cnVhcHA6V25AW1tjJF1QfjghM2AoW35BZiUnSDI/bEh3XWNpaXE6cn1MT3pqTGsueTVNSCtfcT0=
User-Agent: Mozilla/5.0 (Linux; Android 10; Mi 9 Lite Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/96.0.4664.45 Mobile Safari/537.36
X-Requested-With: com.bdrthermea.roomunitapplication.baxi
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Accept-Encoding: gzip, deflate
Accept-Language: ca-ES,ca;q=0.9,en-US;q=0.8,en;q=0.7

HTTP/1.1 200 OK
Date: Thu, 02 Dec 2021 21:05:00 GMT
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: *, amdatu_token
Content-Type: application/json
Transfer-Encoding: chunked

{"maxFlowTemperatureSetpoint":{"value":80.31,"unit":"..C","min":15.0,"max":90.0,"increment":0.01},"heatCurveOffset":{"value":15.0,"min":15.0,"max":90.0,"increment":0.1,"unit":"..C"},"heatCurveSlope":{"value":1.5,"min":0.0,"max":4.0,"increment":0.1}}


PUT /v1.0/central-heating-zone/1E10FFFFFFFF010/parameters/heating-curve HTTP/1.1
Host: ruapi.remoteapp.bdrthermea.com
Connection: keep-alive
Content-Length: 80
Accept: application/json, text/plain, */*
X-App-Id: YWU5NmI3ODItNDdmNi00NmU1LWI4ZWQtZWM3NTkxMjdhZTQy
X-Bdr-Pairing-Token: xxxxxxxxxxxxxxxxx
Authorization: Basic cnVhcHA6V25AW1tjJF1QfjghM2AoW35BZiUnSDI/bEh3XWNpaXE6cn1MT3pqTGsueTVNSCtfcT0=
User-Agent: Mozilla/5.0 (Linux; Android 10; Mi 9 Lite Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/96.0.4664.45 Mobile Safari/537.36
Content-Type: application/json;charset=UTF-8
X-Requested-With: com.bdrthermea.roomunitapplication.baxi
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Accept-Encoding: gzip, deflate
Accept-Language: ca-ES,ca;q=0.9,en-US;q=0.8,en;q=0.7

{"maxFlowTemperatureSetpoint":80.31,"heatCurveOffset":15.1,"heatCurveSlope":1.5}

HTTP/1.1 204 No Content
Date: Thu, 02 Dec 2021 21:05:08 GMT
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: *, amdatu_token

water presure

GET /v1.0/system/water-pressure HTTP/1.1
Host: ruapi.remoteapp.bdrthermea.com
Connection: keep-alive
Accept: application/json, text/plain, */*
X-App-Id: YWU5NmI3ODItNDdmNi00NmU1LWI4ZWQtZWM3NTkxMjdhZTQy
X-Bdr-Pairing-Token: xxxxxxxxxx
Authorization: Basic cnVhcHA6V25AW1tjJF1QfjghM2AoW35BZiUnSDI/bEh3XWNpaXE6cn1MT3pqTGsueTVNSCtfcT0=
User-Agent: Mozilla/5.0 (Linux; Android 10; Mi 9 Lite Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/96.0.4664.45 Mobile Safari/537.36
X-Requested-With: com.bdrthermea.roomunitapplication.baxi
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Accept-Encoding: gzip, deflate
Accept-Language: ca-ES,ca;q=0.9,en-US;q=0.8,en;q=0.7

HTTP/1.1 200 OK
Date: Thu, 02 Dec 2021 21:04:51 GMT
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: *, amdatu_token
Content-Type: application/json
Transfer-Encoding: chunked

{"waterPressure":{"value":2.5,"unit":"bar","min":0.0,"max":2.0}}

Error history

GET /v1.0/system/errors/history HTTP/1.1
Host: ruapi.remoteapp.bdrthermea.com
Connection: keep-alive
Accept: application/json, text/plain, */*
X-App-Id: YWU5NmI3ODItNDdmNi00NmU1LWI4ZWQtZWM3NTkxMjdhZTQy
X-Bdr-Pairing-Token: xxxxxxxx
Authorization: Basic cnVhcHA6V25AW1tjJF1QfjghM2AoW35BZiUnSDI/bEh3XWNpaXE6cn1MT3pqTGsueTVNSCtfcT0=
User-Agent: Mozilla/5.0 (Linux; Android 10; Mi 9 Lite Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/96.0.4664.45 Mobile Safari/537.36
X-Requested-With: com.bdrthermea.roomunitapplication.baxi
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Accept-Encoding: gzip, deflate
Accept-Language: ca-ES,ca;q=0.9,en-US;q=0.8,en;q=0.7

HTTP/1.1 200 OK
Date: Thu, 02 Dec 2021 21:05:50 GMT
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: *, amdatu_token
Content-Type: application/json
Transfer-Encoding: chunked

{"errors":[{"errorCode":"H.02.57","dateTime":"2020-12-02T18:35:28.700","type":"blocking","deviceName":"GTW-16","occurrenceCount":1},{"errorCode":"H.02.57","dateTime":"--","type":"blocking","deviceName":"GTW-16","occurrenceCount":16},{"errorCode":"H.00.81","dateTime":"--","type":"blocking","deviceName":"GTW-16","occurrenceCount":1},{"errorCode":"H.02.57","dateTime":"--","type":"blocking","deviceName":"GTW-16","occurrenceCount":1},{"errorCode":"H.02.57","dateTime":"--","type":"blocking","deviceName":"GTW-16","occurrenceCount":16}]}

@ibernat would you be able to get the need payload for:

put /central-heating-zone/xxx/setpoint/schedule
put /central-heating-zone/xxx/setpoint/anti-frost
put /central-heating-zone/xxx/setpoint/temporary-override
put /central-heating-zone/xxx/setpoint/holiday

And maybe also how to change Off/Auto modeā€¦

I could add them to the custom integration.

Many thanks!

PUT /v1.0/central-heating-zone/1E10FFFFFFFF010/setpoint/schedule HTTP/1.1
Host: ruapi.remoteapp.bdrthermea.com
Connection: keep-alive
Content-Length: 31
Accept: application/json, text/plain, */*
X-App-Id: YWU5NmI3ODItNDdmNi00NmU1LWI4ZWQtZWM3NTkxMjdhZTQy
X-Bdr-Pairing-Token: xxxxxxxxxx
Authorization: Basic cnVhcHA6V25AW1tjJF1QfjghM2AoW35BZiUnSDI/bEh3XWNpaXE6cn1MT3pqTGsueTVNSCtfcT0=
User-Agent: Mozilla/5.0 (Linux; Android 10; Mi 9 Lite Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/96.0.4664.45 Mobile Safari/537.36
Content-Type: application/json;charset=UTF-8
X-Requested-With: com.bdrthermea.roomunitapplication.baxi
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Accept-Encoding: gzip, deflate
Accept-Language: ca-ES,ca;q=0.9,en-US;q=0.8,en;q=0.7

{"currentHeatingTimeProgram":1}

HTTP/1.1 204 No Content
Date: Thu, 02 Dec 2021 21:09:56 GMT
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: *, amdatu_token
PUT /v1.0/central-heating-zone/1E10FFFFFFFF010/setpoint/holiday HTTP/1.1
Host: ruapi.remoteapp.bdrthermea.com
Connection: keep-alive
Content-Length: 65
Accept: application/json, text/plain, */*
X-App-Id: YWU5NmI3ODItNDdmNi00NmU1LWI4ZWQtZWM3NTkxMjdhZTQy
X-Bdr-Pairing-Token: 
Authorization: Basic cnVhcHA6V25AW1tjJF1QfjghM2AoW35BZiUnSDI/bEh3XWNpaXE6cn1MT3pqTGsueTVNSCtfcT0=
User-Agent: Mozilla/5.0 (Linux; Android 10; Mi 9 Lite Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/96.0.4664.45 Mobile Safari/537.36
Content-Type: application/json;charset=UTF-8
X-Requested-With: com.bdrthermea.roomunitapplication.baxi
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Accept-Encoding: gzip, deflate
Accept-Language: ca-ES,ca;q=0.9,en-US;q=0.8,en;q=0.7

{"holiday":{"begin":"2021-12-02T12:00","end":"2021-12-03T12:00"}}

HTTP/1.1 204 No Content
Date: Thu, 02 Dec 2021 21:06:42 GMT
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: *, amdatu_token

Hi Vipial1, Congratulations for this addon!!. I am trying to configure the connection with BAXI, I have copied the folder baxi_thermostat in custom _components and I have included in configuration.yaml the entries to create the entity, indicating my BAXI user and password and the pairing code that I get as you indicate, but when I start HA I get the following error ā€œSetup failed for baxi_thermostat: Integration failed to initialize.
22:27:02 - (ERROR) setup.pyā€ and the entity is not created. can you help me?

Great job @vipial1 !! I was thinking on making an addon but I donā€™t have enough time for that. So, thanks for your work!!

Thanks also to @ibernat to provide the information about gas consumption. I will add to my Node-Red flow but I guess you will include also in the addon.

hi @Domaray,
yes, gas consumption is included in the last version, it add two sensors: one for heating consumption and another for hot water consumption.

It is on my plans to also create a device with all entities.

Hi @ibernat
Iā€™m trying to get the power consumption, Iā€™ve tried with the code you posted before, but Iā€™m getting a not authorised access (401) response.I think that the string after /history/ is related to your account.
How did you get that?

Thanks

Hi @Domaray ,
Were you able to read the consumption, with the information shared by @ibernat ?

If you did, how?

Hi @mossi ,
when you do the paring with the POST /v1.0/pairings
on the response from server is the field

gatewayUUID

Hi @ibernat ,
Iā€™m usig node red, when I paired it for the first time, I didnā€™t copy the gatewayUUID.

I have tried to get the code agay, but I canā€™t because node-red was already paired, I suppose.

Then, I went thru the mobile application, and using Settings/Connected devices and services, I disconnected the service associated to Node-red. And later, I did the pairing process again to get a new gatewayUUID.

Now Iā€™m trying to get the power consumption using my gatewayUUID, but Iā€™m still getting a 401.

Any suggestion?

Thanks

Hi all,

I am not able to get the consumption yet. I tried with Node-Red but I couldnā€™t. Neither using a web app:

I checked with @vipial1 that the ā€œcapabilitiesā€ request shows different options depeding on the thermostat. There are two TXM thermostates:

  • TXM: Which talks R-BUS directly with the boiler.
  • TXM 10c: Which talks R-BUS with the GTW-16 and this OpenTherm with the boiler.

Both could have the same firmware version but the capabilities change. Maybe the URL for the consumption is also different or needs an additional parameter.

I think that the url is ok, because we are getting a 401 not a 404 response.

Hi, great work that you did, I tried the two solutions and I have problems with both:

  • On Domaray website I cannot load the node-red json file, thereā€™s a ssl error on my browser. So I cannot not yet make it work. Would you be able to share the file another way please?

  • On vipial1 integration, that was much more easy to setup (Iā€™m absolute beginner with HA) and I entered the pairing code, all good, I got the connection and HomeAssistant appears in my connected services in the Baxi app. But since then, nothing works anymore, current temperature is still the initial one fetched on first connection. On rare occasions suddenly the temperature is set correctly, or the heating program is changed to the new selected one. Then nothing for several minutes. It is as if Baxiā€™s API was throttled to avoid too many successive commands. You experience that also or itā€™s just my setup?

Iā€™d be definitely interested by getting the historical consumption of the boiler!

Thanks for the great engagement!

Hi,

Sorry, my site was HTTPS and due to a problem with the hosting I had to change it to HTTP. You should be able to download the file now.

Thanks a lot I can get it now. I need to learn Node Red and see if I can make my way through your code!

Regarding vipial1 integration there was an authentication issue, the integration stopped working. Iā€™ve deleted it, revoked the authorisation in Baxi app and reinstalled from scratch and it works again at the moment. I have my phone and IFTTT connected to it and they never failed. I donā€™t understand why this oneā€™s authorisation expired. Maybe itā€™s an issue on the HomeAssistantā€™s side, Iā€™ll see if the issue occurs again.

So happy that it works!