Sonoff bridge sensors and battery code

The configuration of the contact sensor is likely to cause warning messages (“No matching payload for entity”).

It is subscribed to tele/RF_Bridge/RESULT and will receive all payloads published to this topic.
30E00A -> payload_on
30E00E -> payload_off
30E006 -> no match; warning message
payloads from other sensors -> no match; warning message

Here is one way to configure it so it always reports a valid state regardless of what it receives.

- platform: mqtt
  name: 'Office'
  state_topic: 'tele/RF_Bridge/RESULT'
  value_template: >-
    {% if value_json.RfReceived.Data == '30E00A' %}
      {{'ON'}}
    {% elif value_json.RfReceived.Data == '30E00E' %}
      {{'OFF'}}
    {% else %}
      {{states('binary_sensor.office') | upper}}
    {% endif %}
  device_class: door

Here’s the low-battery binary sensor:

- platform: mqtt
  name: 'Door Low Battery'
  state_topic: 'tele/RF_Bridge/RESULT'
  value_template: >-
    {% if value_json.RfReceived.Data == '30E006' %}
      {{'ON'}}
    {% else %}
      {{states('binary_sensor.door_low_battery') | upper}}
    {% endif %}
  off_delay: 600
  device_class: battery

For more information:
Sonoff RF Bridge. Strategies for receiving data.