Ener-J 2 Gang light switch...help needed!

Hi! Wondering if anyone can help me, been stuck on this for a few weeks now…

I’m using these light switches…

This is what I’ve done so far…

  1. Flashed the light switch with Tuya convert on a raspberry pi with Tasmota.bin (<<the one that comes with Tuya)

  2. Connected to light switch via wifi and loaded the wifi name and password

  3. Connected to the light switch via the new IP address once it connects to the local network

  4. Go straight to the webpage and upload new firmware (with the .bin below which was compiled in ESPhome) I didn’t change anything in the sonoff Tasmota menus

  5. Now my issue is one of the hardware buttons don’t work. I can use ESPhome and HA to control the light switches and they work perfectly but the physical light only works on one side. I swapped the gpios around and funnily enough the physical button that works will turn on the button that doesn’t work when you press it. (if that makes any sense)

Any help would be greatly appreciated!

Must be the GPIOs, try a few different ones

Where did you get those values from ?

From here - ENER-J Smart WiFi Touch Switch 2 Gang - #2 by levickij

Finally got it working with the GPI03 instead of GPIO14. I have a couple 3 gang switches. Any sure way of guessing the GPIOs?

No, not really unless someone else has published it on Blakadder
You could set up binary sensors for all the unused GPIOs and see which one is triggered on switch press ?

I’m setting up the 3 gang today!
So this is where I’m at - I found this link (Esphome config for DS102 (3 Gang) · GitHub) which seems to match the existing GPIO’s for the 2 gang…So I’m assuming it should work for the 3 gang (if that makes sense) - I’m pretty sure the GPIOs are correct
Here is my config yaml:

esphome:
  name: outsidelights
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "Main Hub"
  password: 
  manual_ip:
    static_ip: 192.168.86.165
    gateway: 192.168.86.1
    subnet: 255.255.255.0
    dns1: 192.168.86.1
    dns2: 192.168.86.1

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Switch1 Fallback Hotspot"
    password: "sunLVrwTadoV"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO12
      mode: INPUT_PULLUP
      inverted: True
    name: "right switch"
    on_click:
      - switch.toggle: relay_1
      
  - platform: gpio
    pin:
      number: GPIO03
      mode: INPUT_PULLUP
      inverted: True
    name: "middle switch"
    on_click:
      - switch.toggle: relay_2
      
  - platform: gpio
    pin:
      number: GPIO05
      mode: INPUT_PULLUP
      inverted: True
    name: "left switch"
    on_click:
      - switch.toggle: relay_3

switch:
 - platform: gpio
    id: relay_1  
    pin:
      number: GPIO13
    name: "right switch"
    icon: mdi:lightbulb
    
  - platform: gpio
    id: relay_2
    pin:
      number: GPIO04
    name: "middle switch"
    icon: mdi:lightbulb
    
  - platform: gpio
    id: relay_3
    pin:
      number: GPIO15
    name: "left switch"
    icon: mdi:lightbulb

I’m trying to compile it but I keep getting this error - I can’t seem to understand what the issue is…

INFO Reading configuration /config/esphome/outsidelights.yaml...
ERROR Error while reading config: Invalid YAML syntax:

mapping values are not allowed here
  in "/config/esphome/outsidelights.yaml", line 61, column 7:
        id: relay_1  
          ^

Thanks so much for your help so far…

Changed the formatting a bit as I think that might have been the issue

switch:
 - platform: gpio
   id: relay_1  
   pin:
      number: GPIO13
   name: "right switch"
   icon: mdi:lightbulb
    
  - platform: gpio
    id: relay_2
    pin:
      number: GPIO04
    name: "middle switch"
    icon: mdi:lightbulb
    
  - platform: gpio
    id: relay_3
    pin:
      number: GPIO15
    name: "left switch"
    icon: mdi:lightbulb

a little tidy up

errors…

INFO Reading configuration /config/esphome/outsidelights.yaml...
ERROR Error while reading config: Invalid YAML syntax:

while parsing a block collection
  in "/config/esphome/outsidelights.yaml", line 60, column 2:
     - platform: gpio
     ^
expected <block end>, but found '<block sequence start>'
  in "/config/esphome/outsidelights.yaml", line 67, column 3:
      - platform: gpio
      ^

I think your formatting is still off on the 1st switch. Look above they should all be in a line

How does this look

Look at the guidelines you need another space on relay 1
Should be spaces in 2s

I must be blind, I can’t see anything wrong with it… I’m comparing it to working yaml files for 2 gangs

Got it working!