Rolling code 433mhz

Not sure if anyone has noticed. Only the last five bits from most 433mhz rolling code transmitters remotes change. The rest of the packet is unique to the button pressed. What that means is if we mask the last 5 bits we can tell if a button has been pushed. I do this with my microchip projects and it works wonderful… Wondering if it is easy enough for someone super smart with HA can add a mask condition to the trigger match method.

#   unique to the button - rolling
data='0000100010100011100  10010'

Maybe less secure but it is barley secure to begin with on the cheap 433mhz stuff.

  - platform: remote_receiver
    name: Button
    rc_switch_raw:  #           mask this.. x=dont care
      code: '1011000010100011000xxxxx'
      protocol: 1
1 Like

Wondering if this is too hard to implement?

This would be a good opportunity to use a lambda expression in C code to mask the value to only the desired bits.

1 Like
int number = 0b0001101001001011; /* 0x1a4b */
int mask =   0b0000111000000000; /* 0x0e00 */
/* &'ed:     0b0000101000000000;    0x0a00 */
int extract = mask & number;     /* 0x0a00 */

if (extract == 0b0000101000000000)
/* or if 0b is not available:
if (extract == 0x0a00 ) */
{
  /* success */
}
else
{
  /* failure */
}

No body knows how to do this?

Does the 433mhz device publish an mqtt packet? If so, pretty sure this could be done with the python_script component.

Boy I wish these little 3 dollar sensors and remotes had mqtt packets. thanks.

Sorry made some assumptions that you were already retrieving the signal in home assistant with an 433mhz RF Bridge. How did you read the code on the sensor?

Is this thread/post maybe getting closer to what you want?

Basically, if you could publish all codes received into a sensor, then you could do further processing on the sensor?

Edit: More crazy examples…

I just have a bunch of sensors around the house that all ready that pump out a protocol 1 or 2 packet and I pick that up with these cheapo RF receivers that work great.

Cheapo

On a ESP8266 running ESPhome with a generic RF receiver.

# Setup Stuff         RF Rec
remote_receiver:
  pin: 4
  dump: rc_switch  #just the packets found
  #: raw      #pulse width data   TOO much on rf just noisey
  tolerance: 50
  filter: 4us
  idle: 4ms

switch:
  - platform: remote_receiver
    name: Button
    rc_switch_raw:  #           mask this.. x=dont care
      code: '1011000010100011000xxxxx'
      protocol: 1
  

All kinds of cheap devices use send out simple packets.

Harbor

remote

But some of the newer but still cheap Motion sensors added Rolling code chips and the last 4 bits are different 16 times or so.

If those last 4 bits could be ignored we could still use them with our cheapo RF receivers.

Mahko that looks like that will help figure out a cool mask. Thank you!

pcwii thanks for the thoughts

2 Likes

How about how to send the rolling codes, I have a couple fan with RF 433Mhz rolling code on each button are 8 codes.
I am not sure if send all the codes at the same time will work.
And how I do that in ESPHome!!

That would be a super idea !! I wish I knew how to code it.