Skip to content

BDR91 Overriding TPI behaviour

lloyda edited this page Nov 28, 2023 · 32 revisions

Note : The behaviour of ramses_cc has changed with respect to addr0 and the sentinel gateway address. This Wiki is a WIP.

There are some circumstances where you may want to override the TPI behaviour of a BDR91, such as when using one for UFH, or when you have a S-plan configuration with OpenTherm.

This can be done by adding the gateway (the USB dongle, aka HGI80, evofw3) as a second binding to the BDR91, which can then be controlled by Home Assistant. The result is that the relay will be activated whenever either Evohome or Home Assistant enables it - effectively a logical OR.

Do not reset the BDR91 before adding a binding for the gateway unless you only want Hone Assistant to control the BDR's TPI.

To achieve this you need to know the ids, and their hex equivalent, of the BDR91 and the gateway (the HGI80, evofw3-compatible dongle).

The hex equivalent can be found with MS Excel. With the id of the device in cell A1 (e.g. 18:136212), this formula in A2 will give you the hex equivalent (4A1414):

=DEC2HEX(BITLSHIFT(LEFT(A1,2),18)+VALUE(RIGHT(A1,6)))

Alternatively, use this python code:

device_id = '18:136212' # a.k.a. 4A1414
print(f"{(int(device_id[:2]) << 18) + int(device_id[-6:]):0>6X}")

In the details below, the following example device ids are used:

  • The BDR91 Relay used for appliance control, e.g. 13:197705 (370449), a.k.a. boiler relay
  • The actual gateway id, e.g. 18:136212 (4A1414)

Initial setup - Binding

The binding process involves sending a command, waiting for a response, and then sending an acknowledgment. The two strings you need to send are of the form below, where xxxxxx represents the hex device identifier of the HGI80/SSM.

If instead of the BDR91 you are using the older relay HC60NG then you only need the first bind command.

I --- 18:000730 --:------ 18:136212 1FC9 012 000008xxxxxx001FC9xxxxxx
I --- 18:000730 13:197705 --:------ 1FC9 006 00FFFFxxxxxx
  1. Do not clear the BDR91 bindings, you would normally do (we want the Evohome controller to remain bound)
  2. Prepare the two strings that are required in a text editor you can cut and paste from. For the example devices these would be
 I --- 18:000730 --:------ 18:136212 1FC9 012 0000084A1414001FC94A1414
 I --- 18:000730 13:197705 --:------ 1FC9 006 00FFFF4A1414

If instead of the BDR91 you are using the older relay HC60NG then you only need the first bind command.

  1. Shutdown HA.
  2. Connect your HGI80/SSM to a terminal emulator such as putty or the Arduino IDE, and confirm that you are seeing data packets.
  3. Put BDR91 into binding mode (5 second press till red led flashes).
  4. Send the first of the two strings ( I --- 18:000730 --:------ 18:136212 1FC9 012 0000084A1414001FC94A1414)
  5. Wait for the BDR91 to return a W response ( W --- 13:197705 18:136212 --:------ 1FC9 006 003EF0370449) This step will not take place with the older relay unit.
  6. Send second string (I --- 18:000730 13:197705 --:------ 1FC9 006 00FFFF4A1414) This step is not required with the older relay unit.
  7. BDR91 should now be bound to the HGI80/SSM as well as the Evohome controller - led should have stopped flashing.

This is a sample packet log showing the process.

+ 11:10:22.860 -> 000  I --- 18:136212 --:------ 18:136212 1FC9 012 0B00084A14140B1FC94A1414
  11:10:23.747 -> 053  I --- 01:185426 --:------ 01:185426 0008 002 F906
+ 11:10:23.840 -> 062  W --- 13:197705 18:136212 --:------ 1FC9 006 003EF0370449
  11:10:24.119 -> 062  W --- 13:197705 18:136212 --:------ 1FC9 006 003EF0370449
  11:10:29.163 -> 053  I --- 04:003202 --:------ 01:185426 2309 003 0405DC
  11:10:29.163 -> 052  I --- 04:003202 --:------ 01:185426 12B0 003 040000
  11:10:31.068 -> 052  I --- 04:003202 --:------ 01:185426 12B0 003 040000
+ 11:10:38.987 -> 000  I --- 18:136212 13:197705 --:------ 1FC9 006 0BFFFF4A1414
  11:10:39.316 -> 062  I --- 10:048456 --:------ 10:048456 1FD4 003 002ED9
  11:11:15.940 -> 061  I --- 04:026298 --:------ 01:185426 3150 002 0600
  11:11:18.313 -> 053 RQ --- 01:185426 10:048456 --:------ 3EF0 001 00
  11:11:18.360 -> 061 RP --- 10:048456 01:185426 --:------ 3EF0 009 000010000000020A64

At this stage it is possible to test by sending either of these two strings:

 I --- 18:000730 --:------ 18:136212 0008 002 00C8  # 100% relay demand, aka turn on
 I --- 18:000730 --:------ 18:136212 0008 002 0000  #   0% relay demand, aka turn off

It is worth noting that for some strange reason the green led does not always follow the relay state initially - it seems to take a few cycles for it to behave.

NOTE: Announcing 100% relay demand (0xC8/2 = 100) should generally enable the relay, but announcing 0% demand may not disable the relay, as there may be some demand from evohome.

Ongoing use - Service call

From within HA, use ramses_cc.send_packet to control the BDR91. For example, to enable the CH valve:

- alias: Enable CH Valve
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.f9_relay_demand
    above: 5
  condition: []
  action:
  - service: ramses_cc.send_packet
    data:
      device_id: "18:000730"
      verb: I
      code: '0008'
      payload: '00C8'
  mode: single

Note for the service calls you must use the HGI80/SSM internal id (18:000730) for the destination. It will not work if you use any other id.

Keep Alive

One issue you may find is that the BDR91 thinks it has lost connection with the HGI80/SSM if you only activate it occasionally, in which case you should implement an automation that fires periodically:

- alias: CH Watchdog
  description: ''
  trigger:
  - platform: time_pattern
    minutes: /10
  condition: []
  action:
  - if:
    - condition: numeric_state
      entity_id: sensor.f9_relay_demand
      above: 5
    then:
    - service: ramses_cc.send_packet
      data:
        device_id: "18:000730"
        verb: I
        code: '0008'
        payload: '00C8'
    else:
    - service: ramses_cc.send_packet
      data:
        device_id: "18:000730"
        verb: I
        code: '0008'
        payload: '0000'
  mode: single

References

https://www.automatedhome.co.uk/vbulletin/showthread.php?6662-Override-BDR91-TPI-mode