ESP32R4 Smart Home Controller

Sometimes it’s just not worth it making stuff yourselves, but it’s just better to ‘buy and modify’.

On Aliexpress we found this ESP32R4 Smart Home Controller from a company called RobotDyn that comes with Tasmota preinstalled. It’s got 4 relays (10 Amp), 4 buttons, 7 status LED’s (1 per relay, 1 DC power LED, 1 AC power LED and 1 ESP32 status LED), a 7-36v DC input and a 90-240v AC input. The ‘icing on the cake’ is a 433Mhz receiver/transmitter.

You can buy this for $12 to $15 with or without an enclosure, so this is really a no-brainer.

As we prefer to run esphome firmware, we reflashed the device with a basic OTA esphome config. You can simply do this but connecting a USB TTL(get the red one, CP2102 5PIN) and connect the 3.3v, GND, TX and RX. Please temporarily remove the jumper and DO NOT connect a power supply and USB power at the same time!

After that we started playing around with the GPIO’s 😉

This is the config we came up with. Everything works great and RAW 433Mhz data is showing up in the logs. Finally a device that just works without a fuzz!

substitutions:
  devicename: esp32-shc-01
  long_devicename: ESP32 Smart Home Controller

esphome:
  name: $devicename
  comment: $long_devicename
  platform: ESP32
  board: esp32doit-devkit-v1
  
wifi:
  ssid: !secret esphome_wifi_ssid
  password: !secret esphome_wifi_password
  ap:
    ssid: "$devicename Fallback Hotspot"
    password: !secret esphome_ap_password
    ap_timeout: 15s

captive_portal:

web_server:
  port: 80

logger:
  level: DEBUG

api:
  password: !secret esphome_api_password

ota:
  password: !secret esphome_ota_password

sensor:
  - platform: wifi_signal
    name: "$devicename WiFi Signal"
    update_interval: 60s
    
remote_receiver:
  pin: GPIO27
  dump: rc_switch
  # Settings to optimize recognition of RF devices
  tolerance: 50%
  filter: 250us
  idle: 4ms
  buffer_size: 2kb
    
switch:
  - platform: gpio
    name: "$long_devicename Relay 1"
    pin: GPIO25
    id: relay1
  - platform: gpio
    name: "$long_devicename Relay 2"
    pin: GPIO26
    id: relay2
  - platform: gpio
    name: "$long_devicename Relay 3"
    pin: GPIO33
    id: relay3
  - platform: gpio
    name: "$long_devicename Relay 4"
    pin: GPIO32
    id: relay4
    
binary_sensor:
  - platform: gpio
    pin: 
      number: GPIO34
      mode: INPUT_PULLUP
      inverted: True
    name: "$long_devicename Button 1"
    on_press:
      then:
        - switch.toggle: relay1
  - platform: gpio
    pin: 
      number: GPIO35
      mode: INPUT_PULLUP
      inverted: True
    name: "$long_devicename Button 2"
    on_press:
      then:
        - switch.toggle: relay2
  - platform: gpio
    pin: 
      number: GPIO36
      mode: INPUT_PULLUP
      inverted: True
    name: "$long_devicename Button 3"
    on_press:
      then:
        - switch.toggle: relay3
  - platform: gpio
    pin: 
      number: GPIO39
      mode: INPUT_PULLUP
      inverted: True
    name: "$long_devicename Button 4"
    on_press:
      then:
        - switch.toggle: relay4

Please be so kind to let us know if this helped you in any way, below in the comments!

Please subscribe to our newsletter!

0 0 votes
Article Rating
Subscribe
Notify of
guest
12 Comments
Oldest
Newest Most Voted
Unknown Unknown
Unknown Unknown
January 22, 2022 14:30

Great article, simple and concise, just the right information and tips. And the ESPHome configuration file for the RobotDyn ESP32R4v2 board works like a charm, too. Thanks a lot!

Mike Wa
Mike Wa
February 13, 2022 05:43

Hi Michel, I gave an issue uploading the firmware via serial. Can you please let me know the baud rate.
Also tried to load a HomeAssist generated BIN file via the ESP32R4 gui, but that has failed too.

Any ideas would be greatly accepted.

Cheers,
Mike.

Mike Wa
Mike Wa
February 15, 2022 08:01

Hi Michel,

I resolved it by simply getting a YP-05 usb to serial board. (my bad, as my home made level shifted circuit didn’t do it. Probably because of the long lead length with high data rates!)

1. Important to remove jumper next to ESP32.
2. Provide 3.3v power to Vin.
3. Hold Prog button while booting – press RST button whilst still holding Prog button – release RST button – then finally release Prog button.
4. ESPHome works a treat uploading FW.

Arduino INO sketch uploading is a bit problematic. Speed of 921600 seems most reliable.

I found that ESPHome complains when saying the switch ports are Pulled Up. It says those GPIO’s [34,35,36,39] don’t support it. And so they aren’t working for me yet.

The relays work a treat.

JF
JF
Reply to  Mike Wa
June 7, 2022 15:08

Did you figure out a way to use the 34-39 pins? So far no luck on my end

poptix
poptix
Reply to  JF
April 16, 2023 06:46

Just remove the “mode: INPUT_PULLUP” line for those pins, they’re always in that mode.

Joan
Reply to  Mike Wa
September 28, 2023 18:44

Michel, coul you detail how have you achieved to program de ESP32R4 ? What board id in Arduino Ide ? How is the YP05 connected ? Sorry, but I cannot achieve that Ide recognizes the USB port….

Mike
Mike
November 5, 2022 14:03

Hello
I have one of these and I am trying to access both the buttons and the RF controller with home assistant with MQTT my device has the Tasmota firmware on.

JBE
JBE
March 17, 2023 11:09

What about Bluetooth function?

Last edited 3 years ago by JBE
bhupiister
bhupiister
November 29, 2024 11:28

Is it possible to power it with 24VAC? I need to use it to replace my conventional thermostat which is currently powered by 24VAC.

Newsletter

Fresh off the workbench, straight to your inbox.

One mail when something new is published. No spam, unsubscribe at any time.

Translate »
12
0
Would love your thoughts, please comment.x
()
x