ESPhome 433mhz deep sleep transmitter

Awesome, thanks for sharing this! Now I can see how it is sent via the RF transmitter.

One question I have is, the RF 433mhaz transmitter I want to use uses a UART, TX / RX pins, it is not a single pin. Can this be used?

Also, I need to set the receiver up on a ESP32 too. What would some example code look like for that.

Ive just ordered a f ew goodies to test with so hoping I can put a test together tonight.

Not with the native ESPHome library, you would need to write your own transmitter and receiver component. But I believe the one you linked above just supplies the raw RF data.

https://esphome.io/custom/uart.html#

Forgot to mention - these modules typically have 5V logic levels. You will need to put a level shifter in line on the data pin.

Either a fancy one or make one yourself using a couple of resistors as a voltage divider.

Yea, ive never actually made one!

HEELP haha.

Google is your friend…

Connecting to the transmitter will probably require a proper 2 way level converter, but you may be ok with 3.3V logic levels.

For the receiver, I have a Kinkony KC868-A8 that also has a port for a 433mhz receiver.

Could I use that as the receiver?

Also, can I mix transmitters and receivers. They are all on the same band right

I was just reading about these the other day - yes you can solder some headers and plug in both a tx and rx, you need the 4 pin ones by the look. Not the 8 pin ones that have duplicate pins.

I believe any 433Mhz chip that uses ASK modulation.

Is that one of the following?

Yeah the one at the top looks like a suitable receiver and the middle one a transmitter to match.

Not sure about the bottom one - is that the one with the UART?

No one is for Transmitter and one is for Receiver.

I’m not even sure where to start when it comes to setting it up though

You can’t use a powerbank, it will turn itself off.

I used these. They work well (but I haven’t done range testing).

AU $4.77 5%OFF | Long Range 433MHz RF Wireless Transceiver Kit with Antenna Large Power 433 MHz Transmitter Receiver Module LORA Kit for Arduino
https://a.aliexpress.com/_mMUurLe

Have you thought about other solutions such as buying a 433mhz door sensor?

What is the sensor/approach for detecting new mail?

AU $5.23 30%OFF | Sgooway 433MHZ Wireless door sensor Door magnetic contact detector for gsm sms WIFI alarm
https://a.aliexpress.com/_mMMh7za

AU $4.04 48%OFF | ACJ Mini 433MHz Wireless Magnetic Door Window Sensor Home for Alarm System App Notification Alerts Window Sensor Detector
https://a.aliexpress.com/_m0uO1LA

I mean I’m open to anything really. You’re right about the power bank turning itself off, I didnt think of that. Guess theres not enough current draw.

The only reason I choose ESP32 and ESPhome is I love ESP home right, everything just works so well and reliably.

Plus I get to play and learn.

How do I know those units will be compatible with my receiver, or will any 433mhz receiver work?

1 Like

Just try it - playing with this stuff is relatively cheap and you will learn something new.

Here’s an old project of mine that uses sensors like @Mahko_Mahko describes and a Sonoff RF bridge as a receiver.

1 Like

It would be a good learning project for sure.

But sometimes low-power esp projects can be a little more involved than you might think.

For example, selecting the right esp with a low idle deep sleep current is important. As is making sure the attached sensors don’t draw current when in deep sleep.

Someone will have already optimised a 433mhz door sensor for fast response times and long battery life (hopefully).

This vid is a good one for esp32 deep sleep current draw.

Ok, so far here is what I have,

On my transmitter.

remote_receiver:
  pin: GPIO13
  dump: all

On my Transmitter, im not too sure how to configure it to send GPIO state change via the RF receiver.

remote_transmitter:
  pin: GPIO4
  # RF uses a 100% carrier signal
  carrier_duty_percent: 100%

switch:
  - platform: template
    name: RF Power Button
    turn_on_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '100010000000000010111110'
          protocol: 2

So this is where im a bit lost? How can I send a GPIO status as a binary_sensor via the RF transmitter?

Thanks!

Ok, i’ve enabled

logger:
  level: VERY_VERBOSE
  tx_buffer_size: 896
  logs:
    remote_receiver.esp8266: VERY_VERBOSE

And I can see my receiver is receiving what appears to be signals and some RAW data. This I guess, I can confirm that at least my receiver is working fine.

I just cant get my transmitter to transmit using

remote_transmitter:
  pin: GPIO4
  carrier_duty_percent: 100%

binary_sensor:
  - platform: gpio
    pin: GPIO26
    name: mail_sensor
    on_press:
      then:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '100010000000000010111110'
          protocol: 2

Ok heres an update.

I’ve got it transmitting now, however its kind of quite uncontrolled.

It sends multiple signals, like 50 state changes from one physical state change.
And only half of those make it to the receiver.

Is there a way to filter this down?

Thanks

Progress is good!

[22:24:56][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:24:56][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:24:56][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:33][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:33][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:33][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:33][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:33][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:33][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:33][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:34][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:34][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:34][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:34][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:34][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:34][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:34][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:35][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:35][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:35][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:35][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:35][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:35][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:35][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:35][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:35][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:36][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:36][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:36][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:36][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:36][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:36][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:36][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:36][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:36][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:36][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:36][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:37][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:37][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:37][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:37][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:37][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:37][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:37][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:37][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:38][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:38][D][binary_sensor:036]: 'mail_sensor': Sending state OFF
[22:26:40][D][binary_sensor:036]: 'mail_sensor': Sending state ON
[22:26:40][D][binary_sensor:036]: 'mail_sensor': Sending state OFF

Ok fixed that with

mode: INPUT_PULLUP

Next question, this only sends a signal on “ON” state change and does not report “OFF”

    on_press:
      then:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '100010000000000010111110'
          protocol: 2
          repeat:
            times: 10
            wait_time: 0s

Is there also a way to send the command for the off as well?

Thanks

Use on_release:. Or simply a timeout.