Xiaomi Zero Intelligent Video Doorbell

Hi Jeroen.
Just a quick question. Did you install Portisch firmware on your RF Bridge?

The above setup is with Tasmota 6.5.0.13. No Portisch.

Hi Everyone!
I managed to find a reliable solution. (IMHO). Please read till the end before making any step. Maybe this is not something you are looking for.

First of all, the root cause of problem that i had (Sonoff RF Bridge is not reacting on every click and sending different messages every time) was that RF Bridge together with Tasmota and EFM8BB1 chip cannot decode Doorbell’s protocol properly.
The issue was not really related to it’s power management or something. I realised that by pairing doorbell with speaker that comes with it. That speaker was able to catch every click perfectly.

Small spoiler: i didn’t find a way (yet) to decode it, but at least i found a way to receive signals on every click and i can still use them.

To fix this problem i had to flash Tasmota v 6.60 and Portish EFM8BB1 firmware (for RF module).

Steps on how to do that can be found here: https://github.com/arendst/Sonoff-Tasmota/wiki/Sonoff-RF-Bridge-433

Note #1: It only sounds scary. In fact, you don’t have to cut 2 lines on the board if you are not powering RF Bridge with USB while flashing (5v) but instead use serial port (that gives 3v).

Note #2: Portish firmware releases are a bit messy. After some experiments i found that the latest one can be found here: https://github.com/Portisch/RF-Bridge-EFM8BB1/blob/af1bddb3d81c79d67063184219ec21f8249dffd0/Keil%208051%20v9.53%20-%20Release/RF-Bridge-EFM8BB1.hex

Note #3: Don’t read sections that are not related to flashing process of Tasmota / Portish firmware. They describe how you can de-code caught codes to reproduce them (useful if you need to send this signal using RF Bridge, but we are interested in catching signals only, right?)

Note #4: After i installed Portish firmware, my bridge stoped seeing Xiaomi Doorbell messages as it used to see (but it see others on RAW mode as you will see later). I don’t know if you can un-install Portish firmware, so be aware if you are just going to “play” with it.

After i did all those operations i went to RF Bridge console and switched RF module into “Raw” mode by running this command:

RfRaw 177

Then i clicked button on doorbell multiple times and got those codes:

Note #1. As you see, they are not decoded, but it is possible to extract unique device related part (at least, i was able to substring first 14 symbols and tested it during 3 days. First 14 symbols didn’t change for me yet and didn’t appear in any other bucket from other devices)

Note #2. Every click triggers multiple veeeery similar codes with a very small interval. This is not a big deal as i can throttle that later in HA.

Note #3. RfRaw 177 is considered to be “bucket fishing” or “debugging” mode and i found few mentions that people tried to use it as a main mode but their RF Bridge was dying after 3 - 4 hours. Only reboot helped. https://github.com/arendst/Sonoff-Tasmota/issues/5682#issuecomment-492638036
For me this is not the case as my bridge is already up for 3+ days. Maybe there was a bug in formware and they fixed it now?
To enable this mode “permanently” you have to execute following commands in RF Bridge console:

Rule1 ON System#Boot DO RfRaw 177 ENDON
Rule1 1

Next step was to define sensor in HA:

binary_sensor:
  - platform: mqtt
    name: "Xiaomi Doorbell"
    state_topic: "tele/rfbridge/RESULT"
    payload_on: "38181909090908"
    off_delay: 3
    value_template: '{{ value_json.RfRaw.Data.split(" ")[7][:14] }}'
    device_class: sound
    qos: 1

Note #1: See what’s inside of “value_template”. I am actually extracting that long numbers sequence and extracting first 14 symbols from it. Then i match them in “payload_on”

Note #2: Latest home assistant allows you to define “off_delay” property (in seconds) so you don’t have to care about additional automations.

That’s all, folks. It works perfectly for me. Unfortunately, i have to go to MiHome if i’d like to see photos / videos, but at least this lets me to play doorbell sound on my Mi Hubs + send push notifications.
BTW, response is almost instant.

Next steps: I ordered yet-another Sonoff RF Bridge and i am going to do a bit more investigation.
It is possible to decode raw signals without the use of on-board decoding chip (software method using rc_switch). This step requires some soldering as described here: https://github.com/xoseperez/espurna/wiki/Hardware-Itead-Sonoff-RF-Bridge---Direct-Hack

As a result - it will be possible to install ESPruna or ESPHome (my preference) on bridge. As far as i can judge from forums this method allows you do decode much more protocols + performance wise it is much faster.

Hope this will help someone…

1 Like

@gorenuru, there is no need to mod the Sonoff Bridge RF. I managed to get the RF ring using a simple MQTT code available on this thread.

# Xiaomi doorbell
  - platform: mqtt
    name: "Xiaomi Zero"
    state_topic: "tele/RF_Bridge/RESULT"
    payload_on: "41"
    payload_off: "41_off"
    value_template: '{{ value_json.RfReceived.Data[:2] }}'
    device_class: light
    qos: 1

It just needes to be adjusted by the first 2 char from the rolling code.

@ReDaLeRt i think you didnt read carefully what my problem was :slight_smile: Riling code was one of them. Beside that bridge didnt catch all the signals. You ca try it yourself by trying to click the button on doorbell around 10 times in a row. you will notice that some of the clicks are ignored.
This doesn’t happen to me on modified bridge.
And, off course, the last thing i want is to miss a call.
Beside that, 2 symbols is not unique enough if you have more then one device.

Anyone know any doorbell that integrates with HA without any cloud services?

1 Like

Ok, as i promised, i have some update.
Recently i received one more rf bridge and was able to hardware hack it.
Installed ESPHome and… It actually works well!
Catches all the messages that my doorbell sends.
Please note, that rolling messages problem still remains, but as with Tasmota, the beginning of code remains the same so you can identify your device.
For me this solution is better as it integrates much better with HA and i am a big fan of ESPHome.
If you are thinking if you should hardware hack + install ESPHOME on your bridge - my answer is do it!
This is a very powerful and easy to use solution.

You can remove the dependency on Mi Home app by using a ping binary sensor. Get the router to assign a static IP based on the doorbell’s Mac address and ping that instead. Another take on the ‘wifi ring’. And ping should be much faster than the video transfer through Mi Home app.

It should work for multiple doorbells as well.

hello, it's been over 3 hours that I try to find the way in ESPhome to use only the first 9 bits of rc_switch_raw: but impossible, do you have a solution?

Hi, unfortunately not. I opened feature request on it, but no news so far.
If someone will find it - please share. This will be very helpful.

1 Like

I just found an alternative through mqtt:
Config esphome:

# Enable Home Assistant API
# api:
mqtt:
  broker: 192.168.1.195

Result:
sonoff_rf_bridge/debug [D][remote.rc_switch:240]: Received RCSwitch Raw: protocol=1 data=‘00111101010110101101101111111010’
config HA:

binary_sensor:
  - platform: mqtt
    name: "Xiaomi Doorbell"
    state_topic: "sonoff_rf_bridge/debug"
    payload_on: "'001111010"
    off_delay: 3
    value_template: '{{ value.split("=")[2][:10] }}'
    device_class: sound

Oh nice so if you enable mqtt it will forward those messages to HA. Thanks! I will try it out. Sound like a reasonable solution. Beside that, this is exactly what i am doing with tasmota

1 Like

Ok, so i spend few hours today playing with Sonoff RF Bridge trying to forward messages to HA using MQTT.
To be fair i didn’t like approach from @rmickael62 because he was parsing messages from all the debug logs that are forwarded from ESPHome to HA.
It’s not structured enough IMHO.
I tried to use on_raw automation and use mqtt.publish like that:

remote_receiver:
  pin: 4
  dump: rc_switch
  tolerance: 50
  filter: 10us
  idle: 4ms
  on_raw:
    then:
      - mqtt.publish:
          topic: tele/RF_Bridge/message
          payload: !lambda |-
            return esphome::to_string(x);

Unfortunately, once i add on_raw automation (even empty or the one that outputs “Hello World” into the console, my RF bridge stops working and blue light blinks like crazy. The only way to return it back to life is to disassemble, connect UART and re-flash.

After all, i went with @rmickael62 solution.
There are few things to note though:

  1. If you will not use some conditions, you will start seeing a lot of error messages because some of the logs cannot be split by “=” and as a result templating engine cannot get second element of split array.
  2. It is better to use [1:10] instead of [:10] then you will not have to match with the leading ’ symbol.

Here is my config:

- platform: mqtt
  name: "Xiaomi Doorbell"
  state_topic: "rfbridge/debug"
  payload_on: "011000011"
  off_delay: 3
  value_template: >-
    {% set parts = value.split("=") %}
    {% if parts[2] -%}
      {{parts[2][1:10]}}
    {%- endif %}
  device_class: sound
  qos: 1
1 Like

Its another one of those products that is limited on purpose, so to use it to its advantage you have to buy a Mi Hub or whatever

Yeah all too common. “You cannot play anywhere but my back yard. Even then I’ll probably take my ball inside just as you are starting to enjoy yourself.”

did you have any luck, trying to connect this;
i’m thinking about the new version buying myself

1 Like

Thanks for the suggestion, just ordered this one. I can’t recommend the current version (as discussed above) to anyone. I got it working with described workaround, but then it started to ring incessantly during rainy days. It’s obviously not waterproofed properly.

edit: I’d suggest to search some more on Ali for for better deals (minus 10$)

This seems an expensive device just for a battery bell press. The video part seems useless in home assistant.

Ordered that new version as described by @turntable. Will play with it when it gets here and I got some time… Might be weeks, might be months!

The new doorbell arrived yesterday. Can’t get it to work. It relies on connecting through a scanned QR code which fails everytime. In Chinese and english the message “The port (?) QR code binding. Waiting for connection” is on repeat, and ultimately it says “Binding failed. Please reset the device”, which I have done numerous times now. Tried different angles and screens.