Hi,
I have a 433Mhz receiver and paired it with a ESP8266 with ESPhome on it, that seems to work hardware wise.
I have several 4 button remotes, and my goal is to let ESPhome decode their signals, and send that to home assistant as an event.
My ESPhome code:
esphome:
name: rf433-receiver
friendly_name: RF433_Receiver
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: " xxx "
ota:
password: " xxx "
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Rf433-Receiver Fallback Hotspot"
password: " xxx "
captive_portal:
remote_receiver:
pin: 4
dump: rc_switch
filter: 250us
tolerance: 50%
idle: 4ms
buffer_size: 2kb
Which gives me the following “dump” output when i press buttons.
This is in the order: Remote 1 (buttons A, B, C, D), Remote 2 (buttons A, B, C, D)
[01:27:31][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='011010001110010001110100'
[01:27:35][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='011010001110010001111000'
[01:27:38][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='011010001110010001110001'
[01:27:40][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='011010001110010001110010'
[01:27:45][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='110111101100111000000100'
[01:27:45][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='110111101100111000001000'
[01:27:47][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='110111101100111000000001'
[01:27:47][I][remote.rc_switch:261]: Received RCSwitch Raw: protocol=1 data='110111101100111000000010'
As far as i can see, the last 4 bits are to identify the button, the rest seems to be the “serial number” of the remote.
How can i read in this raw code, and decode this to 2 separate variables that i can use to send to homeassistant as an event? (so 1 variable for the remote serial number, and 1 for the button that is pressed?)
I have read through several topics about the rc_switch protocol, but most of them are focussed on either transmitting, or about matching a single raw code to use in a binary sensor, and that is not what i’m trying to achieve.
If i missed a topic or a post in which this is already solved, please let me know what keywords you used to find it, that might at the very least improve my research skills.