ESPHome stopped connecting to HA API

Hi I have a Sonoff RF bridge which has some code in it to trigger lights on the press of an RF button.

It’s been working a treat for a couple of years mostly controlling different lights etc however, it has recently stopped working, i suspect maybe recent update to HA or Esphome.

My setup
HAS = 2023.4.6
ESPHOME = Firmware: 2023.4.1
Sonoff RF Bridge Code = https://pastebin.com/1NRwNTbR

In ESPhome logs, when i press the RF button i see this
image|690x164

Then at the same time i press the buttons ill get an entry in HA logs too

Logger: aioesphomeapi.connection
Source: runner.py:179
First occurred: May 2, 2023 at 3:01:43 AM (45 occurrences)
Last logged: 10:18:58 PM

sonoff_rf_bridge01 @ 172.25.0.43: Connection error occurred: Invalid protobuf message: type=35 data=b'\n\x18esphome.rf_code_received\x12\x0c\n\x04sync\x12\x04\xc8\xfc\xff?\x12\x0b\n\x03low\x12\x04\xc8\xfc\xff?\x12!\n\x04high\x12\x19\x0cB\xff?\xec\r\xff?\x19\x00\x00\x00\xd4\xf3#@<\xfd\xff?@B\xff?\x02\x12\x0e\n\x04code\x12\x06\xc8\xfc\xff?a1(\x01': Error parsing message
sonoff_rf_bridge01 @ 172.25.0.43: Connection error occurred: Invalid protobuf message: type=35 data=b'\n\x18esphome.rf_code_received\x12\x0c\n\x04sync\x12\x04\xc8\xfc\xff?\x12\x0b\n\x03low\x12\x04\xc8\xfc\xff?\x12!\n\x04high\x12\x194L\xff?\xc4K\xff?\x19\x00\x00\x00\xd4\xf3#@<\xfd\xff?XH\xff?\x02\x12\x0e\n\x04code\x12\x06\xc8\xfc\xff?a8(\x01': Error parsing message
sonoff_rf_bridge01 @ 172.25.0.43: Connection error occurred: Invalid protobuf message: type=35 data=b'\n\x18esphome.rf_code_received\x12\x0c\n\x04sync\x12\x04\xc8\xfc\xff?\x12\x0b\n\x03low\x12\x04\xc8\xfc\xff?\x12!\n\x04high\x12\x19$7\xff?\xe4\r\xff?\x19\x00\x00\x00\xd4\xf3#@<\xfd\xff?X7\xff?\x02\x12\x0e\n\x04code\x12\x06\xc8\xfc\xff?a1(\x01': Error parsing message
sonoff_rf_bridge01 @ 172.25.0.43: Connection error occurred: Invalid protobuf message: type=35 data=b'\n\x18esphome.rf_code_received\x12\x0c\n\x04sync\x12\x04\xc8\xfc\xff?\x12\x0b\n\x03low\x12\x04\xc8\xfc\xff?\x12!\n\x04high\x12\x19$H\xff?dK\xff?\x19\x00\x00\x00\xd4\xf3#@<\xfd\xff?XH\xff?\x02\x12\x0e\n\x04code\x12\x06\xc8\xfc\xff?a1(\x01': Error parsing message
sonoff_rf_bridge01 @ 172.25.0.43: Connection error occurred: Invalid protobuf message: type=35 data=b'\n\x18esphome.rf_code_received\x12\x0c\n\x04sync\x12\x04\xc8\xfc\xff?\x12\x0b\n\x03low\x12\x04\xc8\xfc\xff?\x12!\n\x04high\x12\x19\xd4Q\xff?d\x0b\xff?\x19\x00\x00\x00\xd4\xf3#@<\xfd\xff?\x08R\xff?\x02\x12\x0e\n\x04code\x12\x06\xc8\xfc\xff?a8(\x01': Error parsing message

Still getting this after much troubleshooting.

I also notice the device when it recieves an RF signal briefly disconnects in HA

Same in my side too, on Sonoff RF. My supposition is that something changed in ESPhome for the latest releases.

Logger: aioesphomeapi.connection
Source: runner.py:179
First occurred: 11:05:20 AM (18 occurrences)
Last logged: 12:30:12 PM

sonoff-rf-bridge-1 @ 192.168.1.243: Connection error occurred: Invalid protobuf message: type=35 data=b'\n\x18esphome.rf_code_received\x12\x0c\n\x04sync\x12\x04\xc8\xfc\xff?\x12\x0b\n\x03low\x12\x04\xc8\xfc\xff?\x12!\n\x04high\x12\x19\xa4!\xff?\\0\xff?\x19\x00\x00\x00\x80\xff"@<\xfd\xff?\xd8!\xff?\x02\x12\r\n\x04code\x12\x05\xc8\xfc\xff?9(\x01': Error parsing message
sonoff-rf-bridge-1 @ 192.168.1.243: Connection error occurred: Invalid protobuf message: type=35 data=b'\n\x18esphome.rf_code_received\x12\x0c\n\x04sync\x12\x04\xc8\xfc\xff?\x12\x0b\n\x03low\x12\x04\xc8\xfc\xff?\x12!\n\x04high\x12\x19\xc4\x1f\xff?\\0\xff?\x19\x00\x00\x00\x80\xff"@<\xfd\xff?\xf8\x1f\xff?\x02\x12\r\n\x04code\x12\x05\xc8\xfc\xff?3(\x01': Error parsing message
sonoff-rf-bridge-1 @ 192.168.1.243: Connection error occurred: Invalid protobuf message: type=35 data=b'\n\x18esphome.rf_code_received\x12\x0c\n\x04sync\x12\x04\xc8\xfc\xff?\x12\x0b\n\x03low\x12\x04\xc8\xfc\xff?\x12!\n\x04high\x12\x19\xb4\x1f\xff?d)\xff?\x19\x00\x00\x00\x80\xff"@<\xfd\xff?\xe8\x1f\xff?\x02\x12\r\n\x04code\x12\x05\xc8\xfc\xff?3(\x01': Error parsing message
sonoff-rf-bridge-1 @ 192.168.1.243: Connection error occurred: Invalid protobuf message: type=35 data=b'\n\x18esphome.rf_code_received\x12\x0c\n\x04sync\x12\x04\xc8\xfc\xff?\x12\x0b\n\x03low\x12\x04\xc8\xfc\xff?\x12!\n\x04high\x12\x19t6\xff?\x046\xff?\x19\x00\x00\x00\x80\xff"@<\xfd\xff?\xf0\x1f\xff?\x02\x12\r\n\x04code\x12\x05\xc8\xfc\xff?9(\x01': Error parsing message
sonoff-rf-bridge-1 @ 192.168.1.243: Connection error occurred: Invalid protobuf message: type=35 data=b'\n\x18esphome.rf_code_received\x12\x0c\n\x04sync\x12\x04\xc8\xfc\xff?\x12\x0b\n\x03low\x12\x04\xc8\xfc\xff?\x12!\n\x04high\x12\x19\\0\xff?\xac\x04\xff?\x19\x00\x00\x00\x80\xff"@<\xfd\xff?\xe0\x1f\xff?\x02\x12\r\n\x04code\x12\x05\xc8\xfc\xff?9(\x01': Error parsing message

Hi!
the same issue
what was the solution? if it was…?

Hey, I noticed the same error showing up in my home-assistant related to my rf_bridge… looks like the message pops up in HA when the rf_bridge running esphome tries to call rf_code_received

rf_bridge:
  on_code_received:
    then:
      - homeassistant.event:
          event: esphome.rf_code_received
          data:

Has anyone found solution to this one?

Actually - I’ve found the answer & solution myself. Leaving here in case someone is struggling with the same: