The following is relevant to anyone who wants to mimic the RF signals from an RH787T ceiling fan remote control unit using an ESP board, an RF transmitter, and Esphome.
Here are examples of the remote:
- https://www.amazon.com/RH787T-Remote-Control-Transmitter-MFP/dp/B088QQLQDD
- Buy Regency RH787T Ceiling Fan Ceiling Fan Remote Control
Brands which have used this remote at some point in time include:
- Regency
- Hunter
- Harbor Breeze
- Westinghouse
- Honeywell
- Mercator
Get the codes for your specific remote by setting up an ESP device with a 433 MHz remote receiver and looking at dumps of rc_switch:
remote_receiver:
- id: receiver
dump: rc_switch
You will hopefully see dump lines like the following:
[12:11:06][D][remote.rc_switch:259]: Received RCSwitch Raw: protocol=6 data='001010101010101000100000'
[12:11:10][D][remote.rc_switch:259]: Received RCSwitch Raw: protocol=6 data='001010101010101011000000'
[12:11:14][D][remote.rc_switch:259]: Received RCSwitch Raw: protocol=6 data='001010101010101010011000'
Esphome guesses protocol 6 but this isn’t quite correct. None of Esphome’s preset protocols match this remote so we’ll need to manually configure a protocol. Without further ado, here are the protocol settings appropriate for this RF remote:
button:
- platform: template
name: "Button Name"
on_press:
- remote_transmitter.transmit_rc_switch_raw:
code: '001010101010101010000000'
protocol:
pulse_length: 330
sync: [23,1]
zero: [1,2]
one: [2,1]
inverted: true
repeat: 6
The above protocol settings (including the repeat count) were chosen to match the behaviour of the real remote. This was validated by using a second ESP device as a receiver (with dump
set to raw
) and comparing what it is seeing from the first ESP device versus the actual remote.
Also for reference, here are the rc_switch codes for my particular remote. I do not know to what extent different remotes have the same or similar codes, but I’m led to believe that units are assigned different prefixes and some units have dip switches to change them. (Mine does not have dip switches.)
'001010101010101000100000' - 0
'001010101010101011000000' - 1
'001010101010101010011000' - 2
'001010101010101001000000' - 3
'001010101010101001010000' - 4
'001010101010101010010100' - 5
'001010101010101010000000' - 6
'001010101010101011010000' - Reverse
'001010101010101011100000' - Set
Hope this helps someone.
BE AWARE that some versions of this remote apparently operate at 303.947 MHz and not 433.92 MHz. If you can’t read anything from the remote with a 433 MHz receiver, this is probably the reason. You can also verify this by opening the remote unit and looking for the resonator. A 433 MHz device will likely have a small silver button component labelled “R433M”.
If you have a 303 MHz remote, life is going to be more difficult for you, because transceivers which can operate at that frequency are not common. The most promising unit is the CC1101 but this isn’t currently supported by Esphome. I’ve had some limited success making a custom component with the library SmartRC-CC1101-Driver-Lib
but it’s still a bit janky as a transmitter.
Here is an FCC report for the 303 MHz version. There’s a page showing internal photographs. The circuit board is completely different to mine, with a different arrangement of chips. The plastic case is identical save for colour. But since the circuit differences are substantial, I suspect the RF protocol differences are more than just the resonator frequency.
If you have this remote, please post in here with any attempts, successes or failures you’ve had trying to speak this remote’s language.