ESP32Dev v1 coding format for switches not working

a someone help me with the coding to use 15x low level relays in HA. Trued various coding from youtube but none of them show up in HomeAssistant.

  • platform: gpio
    pin: 14
    id: Relay_3
    inverted: True # Inverted logic
switch:
  - platform: gpio
    pin: GPIO18
    id: relay_3
    name: "Relay3"
    inverted: true

If you have one of those 16ch relay boards, be careful, they are sometimes tricky to wire correctly.

1 Like

switch:

  • platform: gpio
    pin: GPIO18
    id: relay_3
    name: “Relay3”
    inverted: true

having to convert inverted to false.
Thank you.

Will work from the ground up from here.

read a forum where it was recommended to removed a smd component from the 16 low level relay that doesn’t have any capacitors installed.

Anyhow just now going to load up the 15 relay coding. Will try adding other options like the 0s configuration and whatever else I can find.

It’s my first coding to work in home assistant. hopefully it integrates into the whole ecosystem well.


Going to try adding several coding options to the base since it finally shows the switch button.
Will utilize the Freenove esp32 breakout that has the lighted options to show when the GPIO is active. From there It should easy coasting.

switch:

  • platform: gpio
    pin: GPIO4
    id: relay_1
    name: “Relay1”
    inverted: False
  • platform: gpio
    pin: GPIO13
    id: relay_2
    name: “Relay2”
    inverted: False
  • platform: gpio
    pin: GPIO14
    id: relay_3
    name: “Relay3”
    inverted: False
  • platform: gpio
    pin: GPIO16
    id: relay_4
    name: “Relay4”
    inverted: False
  • platform: gpio
    pin: GPIO17
    id: relay_5
    name: “Relay5”
    inverted: False
  • platform: gpio
    pin: GPIO18
    id: relay_6
    name: “Relay6”
    inverted: False
  • platform: gpio
    pin: GPIO19
    id: relay_7
    name: “Relay7”
    inverted: False
  • platform: gpio
    pin: GPIO21
    id: relay_8
    name: “Relay8”
    inverted: False
  • platform: gpio
    pin: GPIO22
    id: relay_9
    name: “Relay9”
    inverted: False
  • platform: gpio
    pin: GPIO23
    id: relay_10
    name: “Relay10”
    inverted: False
  • platform: gpio
    pin: GPIO25
    id: relay_11
    name: “Relay11”
    inverted: False
  • platform: gpio
    pin: GPIO26
    id: relay_12
    name: “Relay12”
    inverted: False
  • platform: gpio
    pin: GPIO27
    id: relay_13
    name: “Relay13”
    inverted: False
  • platform: gpio
    pin: GPIO32
    id: relay_14
    name: “Relay14”
    inverted: False
  • platform: gpio
    pin: GPIO33
    id: relay_15
    name: “Relay15”
    inverted: False

Do things like entity_id have to be implemented?
still not sure how to enable encryption etc, but will try things fund in videos to add some spice to the programming so to speak.

So it’s not low side relay.
Be careful with Gpios you use (find 15 of them that don’t give troubles on boot…)

no trouble but something fry the esp32 It will not allow code upload and bright white light on esp32 not on anymore, just the regular lights. Lucky I have a second one. I will test voltages and try to figure how to connect correctly with second board. I am guessing it need diodes on each wire to be safe.

Feel free to post your relay board/wiring. I don’t expect diodes are needed for correct wiring( if not for inductive load flyback).

1 Like

switch 10 seems to be occupied on the new esp32 install. Deleting the entry into that gpio16.

All working. Its low side but I am wondering what to do with the power supplies and the voltage reducer etc. A 12v/5a power supply, a mean well 4v power supply. Using 9 volt to power the freenove esp32 breakout board powers everything. Im wondering about the diodes that were in mind to be installed. The voltage stepdown device is showing how much power is being supplied. As it was te power source for 5v, when its off it just show how much power is coming from the esp32. The other factors are that the EMI filter that was to power those supplies is in a tight space and it was just used to try and keep any flickering from tightly packed wiring.