I have several ON/OFF remotes that I use in my shop that communicate on the 315MHz band. The protocol is based on the MC145026/MC145027 encoder/decoder pair.
Basically the signal is a repeated pair of 9 words where each word is trinary (0, 1, indeterminate). Specifically, the 9 words consist of 5 trinary address bits followed by 4 binary data bits. Each set of 9 words is repeated twice so at to filter out spurious matches. If the decoder matches the 5 address trinary bits, then it latches the 4 binary data bits on 4 corresponding pins.
Using the Universal Radio Hacker program in the 315MHz band, I am able to see the signal with peak @310.7 MHz but I am unable to demodulate & decode it or match it with the theoretical encoding detailed in the datasheets for the MC145026/145027 pair https://www.nxp.com/docs/en/data-sheet/MC145026.pdf).
Has anyone else had any success in decoding such devices and spoofing them using ESPHome?
Nice that they posted the schematic. Address bits 1 and 2 can be set floating or grounded via the dip switches. Address bits 3, 4, and 5 are fixed to be floating. If you are just looking to control the devices via esphome then I would cannibalize a remote and connect A1, A2, D6, and ~TE to GPIO on the esp. D6 and ~TE can be normal GPIO outputs to control the ON/OFF data bit and Transmit Enable. Control of A1 and A2 is a bit problematic in esphome, doesn’t look like there is built-in support for tri-state outputs. A1 and A2 need to be configured as input pins so the MC145026 sees the pin as floating and configured as output pins set to ground for the other state.
Quick search didn’t find any existing esphome tri-state options, I’d start by testing a lambda function using the Arduino pin mode function directly on desired GPIO.
Setting up an esp to monitor RF transmissions to track switch state would b a lot more work and not as robust. Monitor esp could see a signal that the switch didn’t respond to, or switch could get a signal that the esp didn’t decode. So HA would be out of sync with device state. An esp in each switch to monitor the relay coil could provide actual state and overcome this, but not worth the effort in my view. I’d replace switches with something more secure.
This way the MC145026 does all the logical encoding and timing while the transmitter just does ASK of the digital output signal @315 MHz.
Not sure if there is a way to “detune” the frequency of a nominal 315MHz transmitter since it seems like the actual transmission of the existing unit is 311.2MHz (per the FCC specs)
Your alternative seems pretty sound. You will need to also include the RC network on pins 11,12, and 13 for your circuit. Datasheet page 13 has the formula for the frequency or try to measure and copy the values used in your remote.