Which board for the lilygo t-relay-8

Hi,

Please help me with this one.

I bought a Lilygo t-relay-8 and with esphome used:

esp32:
  board: esp-wrover-kit

The relays work perfectly but the others input pins are not completely correct.

This is the board:

The model of the ESP32 chip in this board marks: ESP32-WROVER-E

What board should I put in the esphome yaml for this to work fine?

I have several of these arriving tomorrow, did you figure it out?

I found this: How to manage the load using the Lilygo T-Relay module on ESP32. Integration into Home Assistant. - YouTube

Doesn’t cover come assistant, though.

I will try tomorrow. Will likely need to just set the pins to GPIO14, etc, instead of D14

also https://github.com/Xinyuan-LilyGO/LilyGo-T-Relay/issues/4

Hi. Well I think that I found my problem but didn’t had the time yet to implement the solution. Actually defining the board to esp-wrover-kit works perfectly with the relays. But in my case I also need to use some additional digital I/O and some analog reads. So I was getting some weird behaviors on the board (weird on/off readings on the I/O pins) . The solution that I’m guessing is that I need to build my own pull ups using simple resistors, since the I/O pins on this board are not pulled up.

I have the 4 relay board version and I am using 2 pins for pir and 2 pins magnetic sensor, everything is working.
I have set the board as esp32dev.

So how did it go for you using this board?
I still have a problem with it, I need to read two analog signals provided by a current sensor (0 to 1V max). And with the analog signals attached to some of the analog read pin in the board I have some unexpected and quite bothering triggering of some of the digital I/O pins. These unexpected triggering stops when I disconnect the analog reads, so I have narrowed down the problem to those reads. But still can’t find a solution as I really need those readings. I don’t know if someone has had this kind of problem before. Maybe a solution is to add a filter using some capacitors on the analog signals? I may be testing that soon…

And with the analog signals attached to some of the analog read pin in the board I have some unexpected and quite bothering triggering of some of the digital I/O pins.

Which pins are you using for analog reading and which ones for digital reading?

Have you tried enabling pullup on digital inputs?

Ok, I’m using GPIO23, GPIO22 and GPIO26 as binary sensors, GPIO36 and GPIO35 as analog read pins, and GPIO33, GPIO32, GPIO13, GPIO12, GPIO21 and GPIO19 as output pins.

Here is my complete esphome yaml config:

esphome:
  name: main_tableau_elec

esp32:
  board: esp32dev # esp-wrover-kit

wifi:
  ssid: !secret wifi_id
  password: !secret wifi_pwd

web_server:
  port: 80

# Enable logging
logger:
  level: DEBUG

# Enable Home Assistant API
api:
  password: !secret ota_pwd

ota:
  password: !secret ota_pwd

# Define the binary sensors from outdoor numeric pad
binary_sensor:
  - platform: gpio
    name: "Valid code A"
    pin: GPIO23
  - platform: gpio
    name: "Valid code B"
    pin: GPIO22
    on_press:
      - switch.turn_on: garage_door_bare_switch
      - delay: 0.5s
      - switch.turn_off: garage_door_bare_switch
  - platform: gpio
    name: "Garage door status"
    pin: GPIO26
    device_class: door
    filters:
      - invert:

# Reading the analog CT clamps
sensor:
  - platform: adc
    pin: GPIO36
    id: gpio36
    update_interval: 60s
    internal: true
  - platform: ct_clamp
    sensor: gpio36
    name: "Water Heater Power Sensor"
    icon: mdi:gauge
    unit_of_measurement: 'W'
    update_interval: 60s
    sample_duration: 200ms
    filters:
      - throttle: 60s
  - platform: adc
    pin: GPIO35
    id: gpio35
    update_interval: 60s
    internal: true
  - platform: ct_clamp
    sensor: gpio35
    name: "Electric Car Power Sensor"
    icon: mdi:gauge
    unit_of_measurement: 'W'
    update_interval: 60s
    sample_duration: 200ms
    filters:
      - throttle: 60s
  - platform: wifi_signal
    name: "Main Tableau Elec WiFi signal"
    icon: "mdi:wifi"
    update_interval: 60s

# Define output pins
output:
  - platform: gpio
    pin: GPIO33
    id: output_pin_1 # garage door
  - platform: gpio
    pin: GPIO32
    id: output_pin_2 # floor heater
  - platform: gpio
    pin: GPIO13
    id: output_pin_3 # water heater
  - platform: gpio
    pin: GPIO12
    id: output_pin_4 # parking lights
  - platform: gpio
    pin: GPIO21
    id: output_pin_5 # electric car
  - platform: gpio
    pin: GPIO19
    id: output_pin_6 # (reserve 1)
  # - platform: gpio
  #   pin: GPIO18
  #   id: output_pin_6 # (reserve 2)
  # - platform: gpio
  #   pin: GPIO5
  #   id: output_pin_6 # (reserve 3)

# Define the lights based on the output pins
light:
  - platform: binary
    name: "Parking Garage light"
    output: output_pin_4

# Define the switches based on the output pins
switch:
  - platform: output
    id: garage_door_bare_switch
    output: output_pin_1
  - platform: template
    name: "Garage Door Switch"
    icon: "mdi:garage"
    optimistic: true
    lambda: 'return id(garage_door_bare_switch).state;'
    turn_on_action:
      - switch.turn_on: garage_door_bare_switch
      - delay: 0.5s
      - switch.turn_off: garage_door_bare_switch
    turn_off_action:
      - switch.turn_on: garage_door_bare_switch
      - delay: 0.5s
      - switch.turn_off: garage_door_bare_switch
  - platform: output
    id: floor_heater_bare_switch
    output: output_pin_2
  - platform: template
    name: "Floor Heater Switch"
    icon: "mdi:radiator"
    optimistic: true
    lambda: 'return id(floor_heater_bare_switch).state;'
    turn_on_action:
      - switch.turn_on: floor_heater_bare_switch
    turn_off_action:
      - switch.turn_off: floor_heater_bare_switch
  - platform: output
    id: water_heater_bare_switch
    output: output_pin_3
  - platform: template
    name: "Water Heater Switch"
    icon: "mdi:water-boiler"
    optimistic: true
    lambda: 'return id(water_heater_bare_switch).state;'
    turn_on_action:
      - switch.turn_on: water_heater_bare_switch
    turn_off_action:
      - switch.turn_off: water_heater_bare_switch
  - platform: output
    id: electric_car_bare_switch
    output: output_pin_5
  - platform: template
    name: "Electric Car Switch"
    icon: "mdi:car-electric"
    optimistic: true
    lambda: 'return id(electric_car_bare_switch).state;'
    turn_on_action:
      - switch.turn_on: electric_car_bare_switch
    turn_off_action:
      - switch.turn_off: electric_car_bare_switch
  - platform: output
    id: reserve_bare_switch
    output: output_pin_6
  - platform: template
    name: "Reserve Switch"
    icon: "mdi:crosshairs-question"
    optimistic: true
    lambda: 'return id(reserve_bare_switch).state;'
    turn_on_action:
      - switch.turn_on: reserve_bare_switch
    turn_off_action:
      - switch.turn_off: reserve_bare_switch

# Define the binary sensors from outdoor numeric pad
binary_sensor:
  - platform: gpio
    name: "Valid code A"
    pin:
      number: 23
#      inverted: true # uncomment if necessary
      mode:
        input: true
        pulldown: true
    
  - platform: gpio
    name: "Valid code B"
    pin:
      number: 22
#      inverted: true # uncomment if necessary
      mode:
        input: true
        pulldown: true
#    filters: # uncomment if necessary
#      - delayed_on: 100ms # uncomment if necessary
#      - delayed_off: 100ms # uncomment if necessary
    on_press:
      - switch.turn_on: garage_door_bare_switch
      - delay: 0.5s
      - switch.turn_off: garage_door_bare_switch
      
  - platform: gpio
    name: "Garage door status"
    pin:
      number: 26
#      inverted: true # uncomment if necessary
      mode:
        input: true
        pulldown: true
    device_class: door
#    filters: # uncomment if necessary
#      - delayed_on: 100ms # uncomment if necessary
#      - delayed_off: 100ms # uncomment if necessary

I don’t know what kind of sensor or switch you are using, so it might be good if you enable the filters.

Ok thank you I can try that. On pins 22 and 23 they are just 3.3V on/off signals from another arduino and on pin 26 there is a reed switch on the garage door.
And what do you think about filtering the analog reads? And what about using real RC filters?

I’ve never needed to use filters in my few projects using adc, I don’t have much experience to share

A friend gave me this thing but he only had the board and lost the dongle. Is there a way to upload to this device without the USB to TTL dongle?

image

No, you need one. Thankfully they aren’t that expensive

Does anyone know how to reset this board?

ESPHome flashing completed successfully, but the board won’t go online
Moreover I can’t reflash it any more - getting Installation failed: Error: Command failure error code 0x07

I tried pressing reset button while board is powered via cable, cable + adapter. Tried also holding it while it’s unplugged and keep holding after powering - nothing works.

Power LED is not lit btw.

Nevermind. I’m an idiot because I didn’t install the proper CH34xVCP driver. All this time I tried to flash the board via another driver used for HAM radio cable chip…

Just in case anyone having similar issue - make sure CH34xVCP driver from wch-ic.com is installed and selected port has “tty.wchusbserial” in its name

1 Like

Thanks for the info, might be useful for someone one day :+1:

1 Like

I would give everyone a small word of warning regarding the board as well…

There was an ESPHome firmware update that occurred back in December that requires a manual upgrade through the USB cable. Don’t be like me and bury the device in a wall in a project box under 40 wires that I have to pull out of a light socket hole to upgrade…

…This is also called my next weekend project! :slight_smile:

1 Like

Thank you for the heads up!

1 Like