buzurk
(Mick)
May 3, 2023, 12:24pm
1
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
buzurk
(Mick)
May 19, 2023, 11:22am
2
Still getting this after much troubleshooting.
I also notice the device when it recieves an RF signal briefly disconnects in HA
maxmaia
(Max)
June 30, 2023, 9:53am
3
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
krisproger
(Konstantin Teplitzky)
October 31, 2023, 7:01am
4
Hi!
the same issue
what was the solution? if it was…?
2hol
(2hol)
November 9, 2023, 6:25pm
5
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?
2hol
(2hol)
November 9, 2023, 7:14pm
6
Actually - I’ve found the answer & solution myself. Leaving here in case someone is struggling with the same:
opened 10:10AM - 21 Feb 22 UTC
closed 09:22PM - 27 Feb 22 UTC
integration: rf_bridge
### The problem
Connection reset errors after receiving RF codes appeared after… the latest updates
### Which version of ESPHome has the issue?
2022.2.4
### What type of installation are you using?
Home Assistant Add-on
### Which version of Home Assistant has the issue?
2022.2.9
### What platform are you using?
ESP8266
### Board
Sonoff RF Bridge
### Component causing the issue
rf_bridge
### Example YAML snippet
```yaml
substitutions:
devicename: sonoff_rf_bridge
upper_devicename: Sonoff RF Bridge
esphome:
name: $devicename
platform: ESP8266
board: esp01_1m
wifi:
networks:
- ssid: !secret esp_second_wifi_ssid
password: !secret esp_second_wifi_pass
- ssid: !secret esp_main_wifi_ssid
password: !secret esp_main_wifi_pass
manual_ip:
static_ip: !secret esp_rf_bridge_ip
gateway: !secret esp_gateway
subnet: !secret esp_subnet
ap:
ssid: ${upper_devicename} Fallback
password: !secret esp_fallback_ap_password
logger:
baud_rate: 0
web_server:
port: 80
ota:
id: ota_pass
password: !secret esp_ota_password
uart:
tx_pin: 1
rx_pin: 3
baud_rate: 19200
api:
# password: !secret esp_api_password
services:
- service: send_rf_code
variables:
sync: int
low: int
high: int
code: int
then:
- rf_bridge.send_code:
sync: !lambda 'return sync;'
low: !lambda 'return low;'
high: !lambda 'return high;'
code: !lambda 'return code;'
- service: learn
then:
- rf_bridge.learn
rf_bridge:
on_code_received:
then:
- homeassistant.event:
event: esphome.rf_code_received
data:
sync: !lambda 'char buffer [10];return itoa(data.sync,buffer,16);'
low: !lambda 'char buffer [10];return itoa(data.low,buffer,16);'
high: !lambda 'char buffer [10];return itoa(data.high,buffer,16);'
code: !lambda 'char buffer [10];return itoa(data.code,buffer,16);'
- text_sensor.template.publish:
id: rf_code
state: !lambda 'char buffer [10];return itoa(data.code,buffer,16);'
text_sensor:
- platform: template
name: "Latest Code"
id: rf_code
```
### Anything in the logs that might be useful for us?
```txt
[12:05:34][I][app:102]: ESPHome version 2022.2.4 compiled on Feb 21 2022, 11:52:08
[12:05:34][C][wifi:491]: WiFi:
[12:05:34][C][wifi:353]: Local MAC: 60:01:94:..:..:..
[12:05:34][C][wifi:354]: SSID: [redacted]
[12:05:34][C][wifi:355]: IP Address: 192.168.....
[12:05:34][C][wifi:356]: BSSID: [redacted]
[12:05:34][C][wifi:358]: Hostname: 'sonoff_rf_bridge'
[12:05:34][C][wifi:360]: Signal strength: -62 dB ▂▄▆█
[12:05:34][C][wifi:364]: Channel: 11
[12:05:34][C][wifi:365]: Subnet: 255.255.255.0
[12:05:34][C][wifi:366]: Gateway: 192.168.....
[12:05:34][C][wifi:367]: DNS1: 0.0.0.0
[12:05:34][C][wifi:368]: DNS2: 0.0.0.0
[12:05:34][C][logger:233]: Logger:
[12:05:34][C][logger:234]: Level: DEBUG
[12:05:34][C][logger:235]: Log Baud Rate: 0
[12:05:34][C][logger:236]: Hardware UART: UART0
[12:05:34][C][uart.arduino_esp8266:102]: UART Bus:
[12:05:34][C][uart.arduino_esp8266:103]: TX Pin: GPIO1
[12:05:34][C][uart.arduino_esp8266:104]: RX Pin: GPIO3
[12:05:34][C][uart.arduino_esp8266:106]: RX Buffer Size: 256
[12:05:34][C][uart.arduino_esp8266:108]: Baud Rate: 19200 baud
[12:05:34][C][uart.arduino_esp8266:109]: Data Bits: 8
[12:05:34][C][uart.arduino_esp8266:110]: Parity: NONE
[12:05:34][C][uart.arduino_esp8266:111]: Stop bits: 1
[12:05:34][C][uart.arduino_esp8266:113]: Using hardware serial interface.
[12:05:34][C][template.text_sensor:021]: Template Sensor 'Latest Code'
[12:05:34][C][rf_bridge:184]: RF_Bridge:
[12:05:34][C][web_server:179]: Web Server:
[12:05:34][C][web_server:180]: Address: 192.168.....:80
[12:05:34][C][mdns:084]: mDNS:
[12:05:34][C][mdns:085]: Hostname: sonoff_rf_bridge
[12:05:34][C][ota:085]: Over-The-Air Updates:
[12:05:34][C][ota:086]: Address: 192.168.....:8266
[12:05:34][C][ota:089]: Using Password.
[12:05:34][C][api:138]: API Server:
[12:05:34][C][api:139]: Address: 192.168.....:6053
[12:05:34][C][api:143]: Using noise encryption: NO
[12:05:37][I][rf_bridge:055]: Received RFBridge Code: sync=0x26FC low=0x014A high=0x03E8 code=0x55550C
[12:05:37][D][text_sensor:067]: 'Latest Code': Sending state '55550c'
[12:05:37][W][api.connection:083]: Home Assistant 2022.2.9 (192.168.1.3): Connection closed
[12:05:37][D][api:102]: Accepted 192.168.1.3
[12:05:37][D][api.connection:826]: Home Assistant 2022.2.9 (192.168.1.3): Connected successfully
[12:05:38][I][rf_bridge:055]: Received RFBridge Code: sync=0x26FC low=0x014A high=0x03F2 code=0x555530
[12:05:39][D][text_sensor:067]: 'Latest Code': Sending state '555530'
[12:05:39][W][api.connection:083]: Home Assistant 2022.2.9 (192.168.1.3): Connection closed
[12:05:39][D][api:102]: Accepted 192.168.1.3
[12:05:39][D][api.connection:826]: Home Assistant 2022.2.9 (192.168.1.3): Connected successfully
[12:05:39][I][rf_bridge:055]: Received RFBridge Code: sync=0x2710 low=0x014A high=0x03F2 code=0x555503
[12:05:39][D][text_sensor:067]: 'Latest Code': Sending state '555503'
[12:05:40][W][api.connection:083]: Home Assistant 2022.2.9 (192.168.1.3): Connection closed
[12:05:40][D][api:102]: Accepted 192.168.1.3
[12:05:40][D][api.connection:826]: Home Assistant 2022.2.9 (192.168.1.3): Connected successfully
[12:05:40][I][rf_bridge:055]: Received RFBridge Code: sync=0x271A low=0x014A high=0x03F2 code=0x5555C0
[12:05:40][D][text_sensor:067]: 'Latest Code': Sending state '5555c0'
[12:05:41][W][api.connection:083]: Home Assistant 2022.2.9 (192.168.1.3): Connection closed
[12:05:41][D][api:102]: Accepted 192.168.1.3
[12:05:41][D][api.connection:826]: Home Assistant 2022.2.9 (192.168.1.3): Connected successfully
[12:05:41][I][rf_bridge:055]: Received RFBridge Code: sync=0x2724 low=0x014A high=0x03F2 code=0x55550C
[12:05:41][D][text_sensor:067]: 'Latest Code': Sending state '55550c'
[12:05:41][W][api.connection:083]: Home Assistant 2022.2.9 (192.168.1.3): Connection closed
[12:05:41][D][api:102]: Accepted 192.168.1.3
[12:05:41][D][api.connection:826]: Home Assistant 2022.2.9 (192.168.1.3): Connected successfully
[12:05:42][I][rf_bridge:055]: Received RFBridge Code: sync=0x2738 low=0x0154 high=0x03E8 code=0x55550C
[12:05:42][D][text_sensor:067]: 'Latest Code': Sending state '55550c'
[12:05:42][W][api.connection:081]: Home Assistant 2022.2.9 (192.168.1.3): Connection reset
[12:05:42][D][api:102]: Accepted 192.168.1.3
[12:05:42][D][api.connection:826]: Home Assistant 2022.2.9 (192.168.1.3): Connected successfully
[12:05:44][I][rf_bridge:055]: Received RFBridge Code: sync=0x2724 low=0x014A high=0x03E8 code=0x55550C
[12:05:44][D][text_sensor:067]: 'Latest Code': Sending state '55550c'
[12:05:44][W][api.connection:083]: Home Assistant 2022.2.9 (192.168.1.3): Connection closed
[12:05:44][D][api:102]: Accepted 192.168.1.3
[12:05:44][D][api.connection:826]: Home Assistant 2022.2.9 (192.168.1.3): Connected successfully
[12:05:54][D][text_sensor:067]: 'Latest Code': Sending state '55550c'
```
### Additional information
I've used that in the HA as automations trigger:
trigger:
- platform: event
event_type: esphome.rf_code_received
Now it doesn't work. By default, I have an API password set, but I've tried both with and without it. I also tried using a different access point. Everywhere the same result.