Hi,
I just found a 433 MHz receiver in my drawer and thought, I’d give it a try with esphome. It’s a MX-RM-5V which I wired up to an ESP32-C3. GPIO input is using a voltage divider, because the module outputs 5V. After fixing the rmt_channel in the yaml config, it already worked! However, I don’t know how to interpret the signal that I received or how I could wait for that. Here’s my config:
Before you move on, you need to work with your setup little bit.
According to your log you receive 4 different signals. Are they coming from different sources? If not you need to adjust everything to get only one.
Did you try other protocols than rc_switch? Some “real” protocol would be much better.
Do you have antenna soldered to that receiver?
50% tolerance is too high in your case.
True. I have RTL433 receiver on my network and I see the temperature of my neighbors patio. Like you I had an SDR in my kit drawer and found the rtl433 program to possibly eventually replace my Sonoff RF Bridge.
Well, I’m seeing something in the log if and only if, I press a button. So, possibly, there’s a mixup with some other stuff in the air, but no other source specifically captured here.
I have also dumped “raw” before, but there I get tons of data/noise. Not really clear which of it is usable data. Also, I know it’s rc_switch, see below. Sorry for withholding that information in the start post.
Yeah, basically the whole thing above repeats…
I should maybe add some information I have about the signal. ~10 years ago, I wanted to replicate it to send these signals from a raspi using a FS1000A transmitter. For that, I captured that signal with an Arduino with a sketch that I no longer have. IIRC, it was something pretty custom and non-standard. However, I recorded all the signals of that remote, so I know what the signals of the different buttons look like when sending them via RC Switch. The send script I still have and use. Here’s an example corresponding to the dump above, i.e. same button pressed:
In my experience with logging all my IR and RF devices, ive noticed a few things. Its extremely difficult to dial in the configuration to capture the code you want while filtering out all the other stuff. Sometimes it will output broken code sections as well and the best way ive found to work out all the renotes and buttons is to first dial in your configuration settings the best you can and then you need to do some repetitive testing and look for repeating codes or repeating patterns of codes. Once you find that consistent output in the log, then you should create a test binary_sensor with that code and see if the binary_sensor consistently detects it and changes state from Off/On. Sometimes this can be very simple and you’ll get it on the first try and other times it takes some trial and error.
The other best thing that you can and should do that drives me absolutely nuts that nobody ever mentions is you need to go read through the documentation!
This is because you didnt read through any of it because, it explains all of this and shows you what to do with the data you received. You have to get out of the habit of being tempted to just go copy other peoples configurations you find online and instead learn how to make your own and you do that by reading the documentation, it will explain to you how to do it.
The other thing i strongly recommend is to create a database of all your remotes along with the IR/RF configuration for that remote! You cant just rely on some configuration that worked for remote “A” and assume it will work for remote “B” and remote “C” because, that isnt always the case as you’ll notice from looking at my saved IR/RF codes and for each remote, I also include the Esphome config that I need to use for that remote. It will save you a ton of time by not having to figure all that out each time you use a remote!
That got me on the right track, thanks! Apparently, each button always sends one of the four codes and then some other stuff. I even found out, the codes I had in my script were probably not recorded correctly back then, but that was not an issue, because I always sent all four of them, so the plugs were reliably switched.
Also, I found out, the remote control always sends the signals twice, so the binary sensor is triggered twice. Is setting a delayed_off filter the right way to fix this?
Here’s what I have now set up for that one button:
That somewhat works, but still has an issue: sometimes, signals are not correctly recorded, i.e. they’re not 28 bits long as the patterns above, but only 26 bits or some other length. Then, the sensor is not triggered. How could this be improved?
We’re getting close! Thanks already for the hints
PS: Also, there’s a lot of redundancy in the yaml above. Is there a way to write this more concise?
It’s not illegal to try it and see. That’s how you learn and thats how we all learn. Dont be scared to try something and worry about it being wrong. You can change it and try something different over and over untill you get it right!
If people just keep telling the answers to everything, you’ll never really learn and its really a disservice to you in reality.
Yes, it’s correct to filter out the repeat. You don’t have any automations at the moment, the purpose of the reception is unknown to me.
I strongly suggest you to tune your receiver setup, both HW/SW. Did you solder antenna? Did you try other protocols? Consider also that your receiver is the cheapest one you can buy and the reception is not on the level of the best ones.
As you can see in my yaml, I did and it seems to work (based on a few tries). I was just a bit unsure, because there’s also autorepeat and I do not quite understand what this one does and if it would be more suitable.
I do, but they’re not related to this issue, so I left that out.
You’re right, the receiver is not that great, but it’s what I just had available. For my actual use case I have ordered zigbee equipment, but still waiting for the delivery and I will have to see how reliably it will work inside my home. So, meanwhile I also wanted to see how well the stuff works that I already have available, also as kind of backup solution. And to possibly extend my 433 MHz equipment if Zigbee is not working so well.
No, I did not solder an antenna myself, but there’s one on it and reception is very good even through multiple walls.
Yes, I tried all the RF protocols listed here. rc_switch was the only one that gave any output.
As a matter of fact, i can see that now and could have saved my time and not explained to you how you need to create an RF binary_sensor to test if its working. I wonder if the reason i didnt see it earlier is because maybe it wasnt originally included for anyone to see? Your not doing anyone a favor by deciding what is relevant or not and you certainly arent helping yourself by withholding related parts of the configuration like all your sensors/automations. Please dont think for everyone else and decide what information is or isnt important to your questions that you want help with because you dont know what is relevant if your asking to begin with.
You dont need to “interpret” it, there isnt a secret message hidden in the numbers that need deciphered or “interpreted”. You just need to test it in a binary_sensor sensor and see if it consistently responds to the code being tested.
That’s exactly what i was talking aboiu! It’s very normal to be unsure if something will work and how it will effect things. You may be shocked to discover but, we weren’t all born knowing all of this and thats exactly the reason i said it wasnt illegal to try things out and learn from trial and error! Thats how you learn and its how everyone has or is learning right now.
If the explanation and even the examples they provide in the documentation still aren’t enough to understand what something does or how it will effect the outcome when used, that is exactly why you should try it out and see for yourself. If it is the configuration option you needed to add, you will find that out from trying it and if it doesnt do what you needed then you still win because now you’ve learned what it does, even if its not the thing you need right now. You might need it in the future and you’ll know exactly which option to use because you did these trial and error testing already.