Copying garage door remote control

I’ve been trying to trigger my garage door remote with these modules:

This is the raw code that I captured with the receiver:

310, -993, 312, -1038, 308, -1000, 306, -999, 309, -997, 311, -1038, 307, -1000, 305, -1007, 989, -360, 993, -362, 302, -1000, 302, -1000, 990, -368, 982, -373, 290, -1009, 279, -1068, 297, -1010, 299, -1009, 299, -1007, 301, -1007, 301, -1007, 301, -1009, 996, -364, 994, -360, 304

I am triggering it with this piece of yaml without any luck:

switch:
  - platform: template
    name: Raw Code Power Button
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [310, -993, 312, -1038, 308, -1000, 306, -999, 309, -997, 311, -1038, 307, -1000, 305, -1007, 989, -360, 993, -362, 302, -1000, 302, -1000, 990, -368, 982, -373, 290, -1009, 279, -1068, 297, -1010, 299, -1009, 299, -1007, 301, -1007, 301, -1007, 301, -1009, 996, -364, 994, -360, 304]
          repeat:
            times: 10
            wait_time: 50ms

It’s worth noting that I am holding the transmitter less than a meter away from the garage door receiver, and for my other door it works fine.

This is the remote I am trying to copy:

There’s not much in the espHome logs but this:

17:10:31	[D]	[switch:012]	
'Raw Code Power Button' Turning ON.
17:10:31	[D]	[remote_transmitter:075]	
Sending remote code...
17:10:31	[W]	[component:237]	
Component web_server took a long time for an operation (773 ms).
17:10:31	[W]	[component:238]	
Components should block for at most 30 ms.

If I capture the signal emitted by the esp controlled module these are the logs:

17:20:53	[I]	[remote.raw:028]	
Received Raw: 326, -966, 329, -1019, 327, -982, 320, -985, 325, -981, 326, -1022, 320, -989, 317, -997, 1002, -344, 1004, -353, 310, -993, 303, -1000, 989, -370, 977, -377, 286, -1013, 278, -1069, 296, -1014, 291, -1016, 291, -1016, 293, -1015, 292, 
17:20:53	[I]	[remote.raw:041]	
  -1013, 300, -1011, 987, -375, 982, -373, 294
17:20:53	[I]	[remote.raw:028]	
Received Raw: 318, -981, 325, -1026, 317, -990, 313, -993, 317, -990, 317, -1031, 313, -994, 311, -1001, 993, -358, 991, -364, 299, -1007, 296, -1002, 987, -373, 975, -380, 282, -1017, 269, -1081, 285, -1019, 290, -1019, 288, -1017, 292, -1017, 290, 
17:20:53	[I]	[remote.raw:041]	
  -1017, 291, -1019, 984, -378, 984, -370, 293
17:20:53	[I]	[remote.raw:028]	
Received Raw: 318, -985, 320, -1031, 313, -994, 312, -993, 314, -992, 316, -1034, 309, -997, 308, -1005, 991, -361, 989, -364, 300, -1002, 299, -1004, 983, -379, 971, -381, 279, -1019, 270, -1078, 287, -1020, 290, -1018, 288, -1019, 292, -1016, 291, 
17:20:53	[I]	[remote.raw:041]	
  -1020, 287, -1019, 985, -377, 979, -376, 287
17:20:53	[I]	[remote.raw:028]	
Received Raw: 318, -984, 321, -1029, 313, -998, 310, -993, 316, -991, 315, -1034, 309, -996, 310, -1004, 988, -362, 990, -366, 297, -1005, 297, -1006, 984, -376, 971, -383, 279, -1018, 274, -1075, 286, -1020, 287, -1021, 289, -1017, 290, -1019, 290, 
17:20:54	[I]	[remote.raw:041]	
  -1019, 293, -1016, 984, -376, 980, -375, 289
17:20:54	[I]	[remote.raw:028]	
Received Raw: 323, -982, 320, -1030, 314, -993, 312, -994, 313, -993, 321, -1027, 316, -994, 307, -1005, 988, -360, 990, -366, 300, -1002, 298, -1004, 983, -378, 972, -384, 279, -1017, 270, -1078, 287, -1020, 288, -1021, 286, -1019, 290, -1019, 290, 
17:20:54	[I]	[remote.raw:041]	
  -1018, 290, -1019, 983, -380, 977, -377, 286
17:20:54	[I]	[remote.raw:028]	
Received Raw: 319, -984, 320, -1029, 318, -991, 315, -991, 315, -991, 318, -1031, 312, -995, 310, -1002, 994, -355, 996, -360, 299, -1004, 297, -1005, 985, -375, 975, -379, 284, -1016, 272, -1076, 287, -1020, 288, -1020, 288, -1019, 288, -1020, 293, 
17:20:54	[I]	[remote.raw:041]	
  -1013, 294, -1017, 983, -378, 978, -377, 287
17:20:54	[I]	[remote.raw:028]	
Received Raw: 312, -986, 321, -1030, 315, -993, 310, -995, 314, -992, 317, -1033, 310, -997, 308, -1005, 991, -358, 991, -364, 298, -1004, 298, -1004, 984, -377, 972, -383, 279, -1019, 269, -1079, 285, -1021, 289, -1020, 287, -1018, 292, -1017, 290, 
17:20:54	[I]	[remote.raw:041]	
  -1017, 291, -1023, 982, -375, 982, -373, 293
17:20:54	[I]	[remote.raw:028]	
Received Raw: 314, -985, 321, -1029, 315, -993, 313, -991, 315, -992, 316, -1036, 309, -998, 306, -1005, 991, -357, 991, -366, 298, -1003, 298, -1004, 985, -376, 973, -383, 277, -1020, 270, -1077, 286, -1022, 289, -1018, 289, -1017, 292, -1017, 289, 
17:20:54	[I]	[remote.raw:041]	
  -1018, 291, -1019, 984, -377, 979, -378, 287
17:20:54	[I]	[remote.raw:028]	
Received Raw: 316, -986, 320, -1033, 311, -995, 312, -992, 321, -984, 323, -1026, 311, -999, 307, -1004, 990, -362, 990, -363, 304, -998, 302, -1000, 985, -375, 975, -381, 280, -1020, 269, -1078, 286, -1025, 284, -1020, 286, -1020, 289, -1021, 286, 
17:20:54	[I]	[remote.raw:041]	
  -1021, 287, -1022, 981, -382, 977, -377, 285

This is what I get when I press the button on the remote:

17:24:05	[I]	[remote.raw:028]	
Received Raw: 316, -987, 316, -1030, 317, -990, 314, -992, 317, -990, 316, -1031, 316, -991, 315, -993, 999, -356, 998, -353, 311, -1126, 2015, -508, 994, -357, 306, -998, 309, -1038, 306, -1002, 305, -999, 310, -998, 310, -998, 311, -996, 311, -1000, 
17:24:05	[I]	[remote.raw:041]	
  681, -678, 1001, -357, 307
17:24:05	[I]	[remote.raw:028]	
Received Raw: 316, -987, 318, -1029, 317, -989, 315, -992, 318, -989, 316, -1031, 315, -991, 316, -992, 999, -355, 1000, -352, 311, -1017, 286, -991, 657, -698, 993, -358, 306, -1000, 299, -1130, 1532, -997, 311, -996, 311, -997, 311, -996, 313, -999, 
17:24:05	[I]	[remote.raw:041]	
  1002, -358, 1001, -356, 307
17:24:05	[I]	[remote.raw:028]	
Received Raw: 320, -985, 320, -1026, 320, -988, 314, -992, 316, -991, 317, -1032, 315, -991, 315, -994, 998, -353, 1001, -352, 311, -994, 307, -993, 1000, -352, 1000, -353, 310, -998, 307, -1040, 303, -1004, 305, -1000, 309, -999, 307, -999, 311, -997, 
17:24:05	[I]	[remote.raw:041]	
  302, -1009, 1002, -359, 999, -357, 306
17:24:05	[I]	[remote.raw:028]	
Received Raw: 316, -988, 316, -1030, 317, -989, 315, -992, 318, -989, 318, -1030, 315, -991, 318, -990, 1000, -353, 1000, -352, 311, -1073, 2213, -361, 997, -361, 303, -1000, 720, -623, 310, -1104, 1511, -997, 312, -995, 312, -996, 312, -999, 1003, -357, 
17:24:05	[I]	[remote.raw:041]	
  1000, -356, 308
17:24:05	[I]	[remote.raw:028]	
Received Raw: 316, -986, 318, -1029, 318, -990, 313, -993, 317, -990, 318, -1030, 315, -991, 316, -993, 999, -353, 1001, -352, 311, -994, 306, -994, 556, -799, 994, -359, 307, -995, 312, -1034, 311, -997, 295, -1014, 308, -998, 310, -997, 311, -997, 310, 
17:24:05	[I]	[remote.raw:041]	
  -1001, 923, -440, 698, -656, 306
17:24:05	[I]	[remote.raw:028]	
Received Raw: 316, -988, 317, -1029, 317, -990, 314, -992, 318, -990, 317, -1031, 315, -991, 315, -993, 1000, -353, 1001, -351, 312, -993, 311, -991, 458, -895, 997, -354, 309, -997, 309, -1040, 305, -998, 311, -997, 310, -997, 310, -997, 312, -996, 314, 
17:24:05	[I]	[remote.raw:041]	
  -997, 1003, -357, 1001, -355, 308
17:24:05	[I]	[remote.raw:028]	
Received Raw: 316, -987, 317, -1029, 317, -990, 317, -989, 318, -989, 318, -1030, 315, -992, 315, -993, 1000, -351, 1002, -351, 313, -990, 314, -992, 995, -360, 859, -489, 309, -996, 310, -1038, 306, -999, 309, -998, 310, -998, 310, -997, 1619, -1000, 
17:24:05	[I]	[remote.raw:041]	
  1003, -357, 1000, -356, 307
17:24:05	[I]	[remote.raw:028]	
Received Raw: 315, -989, 315, -1031, 316, -991, 316, -990, 317, -990, 319, -1029, 315, -992, 315, -996, 998, -351, 1003, -350, 314, -993, 306, -993, 401, -1000, 446, -1012, 1462, -324, 357, -353, 313, -996, 311, -995, 313, -994, 314, -993, 314, -994, 
17:24:05	[I]	[remote.raw:041]	
  314, -997, 1006, -354, 1003, -353, 310
17:24:05	[I]	[remote.raw:028]	
Received Raw: 318, -987, 318, -1028, 318, -989, 317, -990, 320, -987, 320, -1028, 317, -989, 317, -992, 1000, -352, 1003, -351, 312, -992, 307, -994, 588, -767, 995, -357, 306, -997, 990, -358, 308, -998, 310, -998, 310, -996, 311, -997, 312, -995, 313, 
17:24:05	[I]	[remote.raw:041]	
  -999, 1003, -358, 998, -358, 306

Do you have any ideas of what I might be doing wrong?

Thanks so much

Garage doors tend to work on a rolling code system so it would be unlikely you could reproduce that without something more complicated. It wouldn’t be secure to use a simple code that didn’t change that could be copied and replayed.

1 Like

I thought so too, but I get mostly the same output on the logs when pressing a button.

I figure that I would receive different values each time I press the button if it was a rolling code system.

Many thigs to consider… Those modules are really crap and without antennas, they might work, but don’t get surprised if not. Also you have to verify that all your component are working at same frequency, 315,433, 868 or 915 MHz.
Esphome is not really the best possible platform to decode RF, I would experiment first with arduino libraries.

Might be easier to keep the remote you have in the garage or nearby and use a switchbot (bluetooth not any more secure) press the button on the remote or on the door opener. Or a espdevice with a transistor to close the contacts on the remote or door.

Everything is 433mhz. But you are correct. I will try with other libraries. I have another door and it worked on the first try, so I was hoping this was the same

Sounds like a good idea, thanks!
I was hoping to get it working via rf but your suggestion seems foolproof

Remote control button is just sinking the contact to gnd. If you have rolling code or some other non duplicatable situation , you can always solder wire to button contact and ground it with Esp (gnd’s connected).

I take it you’re not getting much with dump: all?
You only see codes with raw?

1 Like

With dump all it recognized an rc switch code which I’ve tried without success, that’s why i switched to raw

1 Like

Here are some random “turn it off and on” fixes you can try if you decide they are easy and sensible enough to try.

  1. Use your best power supply, such as from your phone.
  2. Use a good quality esp32
  3. Solder your connections
  4. Fiddle with idle:, filter: and tolerance:
  5. Try some other RF modules, like these ones which seem good to me.
  6. Also use a good usb cable.
  7. Check your connections.

I know this stuff might seem trivial but I swear I’ve experienced RF to be touchy and have had quite different results with these kinds of changes. So if they are no hassle to try then might as well tick them off.

Thanks for your suggestions, sadly I’ve already tried those (or some variation of them).

I bought an SDR and will hack the remote control whatever it takes :dagger: :crazy_face:

1 Like

Let’s hope it’s not very recent rolling code… :+1:

1 Like

According to the data sheet it isn’t rolling code. I suspect it needs the preamble to recognise the code. You should be able to generate actual timings based on the data sheet rather than one you capture.

https://cdn.ozdisan.com/ETicaret_Dosya/642100_179391.pdf

2 Likes

Thanks for the specific data sheet!
Sadly, I don’t know how to generate the actual timings, can you share some more info about this?

Ok, so I got it working. The trick was buying an SDR usb dongle and analyzing the signal using Universal Radio Hacker.
This video was really useful https://youtu.be/sbqMqb6FVMY?si=MGHufLEL0622B5mQ, specially, because it autodetect parameters didn’t work and this showed me a way to ‘guess’ it. The way is zooming on the first signal and the length should be similar to Samples/Symbol. I don’t know if this was just luck, but it worked.
ScreenFlow
After snapping the original signal I created manually a raw espHome signal to mimic the discovered results. For example, if you get this value in the rows of URH: 10001110 then you can mimic that with the following sequence:

code: [
            500, -1500,  # 1000
            1500, -500,  # 1110
]

I started with a length of 500 and later I was going to change that to 328 (and corresponding multiples), but when I finished translating the values it just worked.

3 Likes

Good work and nice update post!
Esphome is rarely the best option to work with unknown ir/rf signals/protocols.

1 Like