Hörmann Garage door opener (RECEIVE ONLY)

There’s a long thread on the forums for how to control this garage door. I was feeling a little lazy so I’ve not done that yet, but the Bluetooth app that Hörmann provide was too tempting, so I have an ESPhome snippet to do decode the BLE adverts.

Now I can have my HA automation tell me I’ve left the garage door open, which is the critical part for me.


sensor:
  - platform: template
    name: Garage door percentage
    entity_category: diagnostic
    id: door_percent
    accuracy_decimals: 0
    unit_of_measurement: '%'
    filters:
      - or:
        - throttle: 60s
        - delta: 1.0

binary_sensor:
  - platform: template
    id: door_moving
    name: Garage door moving
    publish_initial_state: true
    device_class: moving

esp32_ble_tracker:
  on_ble_advertise:
    - mac_address: E5:64:xx:xx:xx:xx
      then:
        - lambda: |-
            auto mfrs = x.get_manufacturer_datas();
            if (mfrs.size() == 2) {
              bool moving = mfrs[0].data[2] & 0x40;
              int percent = mfrs[1].data[1] / 2;

              id(door_percent).publish_state(percent);
              id(door_moving).publish_state(moving);
            }