16xRelay with ESP12F Onboard and two Shift Register (74HC595)

I just received one of these newer esp32 boards also. I swore I searched here and never found this code. 4 hours later got it all figured out and then found this code as I was going to leave it on the forums for others.

My next step will be to design a 3D printable case. @FVBH did you ever find one?

care to share your code and your STL’s of the case ?

I choose a standard casing normaly used as an electrical cable box (big version of that) at my local HomeDepot (or Hornbach as is is called here in Europe :slight_smile:

I have this board and have issues getting it working. The relays are not showing on the device web page and not in HA. The board I have is the same just an ESP32E

This does not sound like a problem with the board but your code.
Even if nothing is working, ESPHome and HA should display the switches.

But as you did not post your code, there will be nothing else we could help you with

# Sync time with Home Assistant
time:
  - platform: homeassistant
    id: homeassistant_time

# Example configuration entry
sn74hc595:
  - id: 'sn74hc595_hub'
    data_pin: GPIO14
    clock_pin: GPIO13
    latch_pin: GPIO12
    oe_pin: GPIO05
    sr_count: 2

# Individual outputs
switch:
  - platform: gpio
    name: "SN74HC595 Pin #0"
    pin:
      sn74hc595: sn74hc595_hub
      # Use pin number 0
      number: 0
      inverted: false
  - platform: gpio
    name: "SN74HC595 Pin #1"
    pin:
      sn74hc595: sn74hc595_hub
      # Use pin number 1
      number: 1
      inverted: false
  - platform: gpio
    name: "SN74HC595 Pin #2"
    pin:
      sn74hc595: sn74hc595_hub
      # Use pin number 2
      number: 2
      inverted: false
  - platform: gpio
    name: "SN74HC595 Pin #3"
    pin:
      sn74hc595: sn74hc595_hub
      # Use pin number 3
      number: 3
      inverted: false
  - platform: gpio
    name: "SN74HC595 Pin #4"
    pin:
      sn74hc595: sn74hc595_hub
      # Use pin number 4
      number: 4
      inverted: false
  - platform: gpio
    name: "SN74HC595 Pin #5"
    pin:
      sn74hc595: sn74hc595_hub
      # Use pin number 5
      number: 5
      inverted: false
  - platform: gpio
    name: "SN74HC595 Pin #6"
    pin:
      sn74hc595: sn74hc595_hub
      # Use pin number 6
      number: 6
      inverted: false
  - platform: gpio
    name: "SN74HC595 Pin #7"
    pin:
      sn74hc595: sn74hc595_hub
      # Use pin number 7
      number: 7
      inverted: false
  - platform: gpio
    name: "SN74HC595 Pin #8"
    pin:
      sn74hc595: sn74hc595_hub
      # Use pin number 8
      number: 8
      inverted: false
  - platform: gpio
    name: "SN74HC595 Pin #9"
    pin:
      sn74hc595: sn74hc595_hub
      # Use pin number 9
      number: 9
      inverted: false
  - platform: gpio
    name: "SN74HC595 Pin #10"
    pin:
      sn74hc595: sn74hc595_hub
      # Use pin number 10
      number: 10
      inverted: false
  - platform: gpio
    name: "SN74HC595 Pin #11"
    pin:
      sn74hc595: sn74hc595_hub
      # Use pin number 11
      number: 11
      inverted: false
  - platform: gpio
    name: "SN74HC595 Pin #12"
    pin:
      sn74hc595: sn74hc595_hub
      # Use pin number 12
      number: 12
      inverted: false
  - platform: gpio
    name: "SN74HC595 Pin #13"
    pin:
      sn74hc595: sn74hc595_hub
      # Use pin number 13
      number: 13
      inverted: false
  - platform: gpio
    name: "SN74HC595 Pin #14"
    pin:
      sn74hc595: sn74hc595_hub
      # Use pin number 14
      number: 14
      inverted: false
  - platform: gpio
    name: "SN74HC595 Pin #15"
    id: Pin15
    pin:
      sn74hc595: sn74hc595_hub
      # Use pin number 15
      number: 15
      inverted: false


button:
  - platform: template
    name: "Mfffffffff" # exposed to Home Assistant
    on_press:
      - switch.turn_on: Pin15
1 Like

I also see this error in the esp web page.

11:38:23	[D]	[api:103]	
Accepted 192.168.5.155
11:38:23	[W]	[api.connection:108]	
: Reading failed: BAD_INDICATOR errno=11
11:39:23	[D]	[api:103]	
Accepted 192.168.5.155
11:39:23	[W]	[api.connection:108]	
: Reading failed: BAD_INDICATOR errno=11

But I would expect to see the relay switches in the web page of the ESP32

Any help would be great.

Code is above

You should open an ESPHome issue.
There is nothing wrong with your config.

Please install an older version of ESPHome (From Jan 2024) and let us know if the same behaviour exists.

Thank you,

How do I install an older version? Sorry still new to all this.

many Thanks, weeks of try an error done!!! Amazing, Great Work!

Use code provided on valve_controller.ino. You need to change ssid and password accordingly and local IP too.
It only works locally.

I searched for hours and finally came across this topic. Thanks to everyone who shared the sample code.