IKEA traffic signal with LILYGO T-Relay 4 actuation

I recently received an IKEA novelty traffic signal (stop light) through my local buy nothing group. (One of these)

It plugs into normal AC power, and each light on the signal has a pushbutton switch which allows current to flow through to each bulb individually. How boring and manual!

Based on my positive experience with some of their other products, I bought a LILYGO T-Relay, which has four relays wired to an ESP32. I think you see where this is going…

I wired the relays on a parallel path to the original switches, so everything still works manually. When closed, through, each relay bypasses one of the switches and so current flows directly to the bulb.

I got it all wired up and the T-Relay connected to ESPHome with about the simplest code in the universe:

esphome:
name: relay
friendly_name: Relay

esp32:
board: esp32dev
framework:
type: arduino

[[the other normal stuff]]

switch:

  • platform: gpio
    name: “Green”
    pin: 21
  • platform: gpio
    name: “Amber”
    pin: 19
  • platform: gpio
    name: “Red”
    pin: 18

Now, I have a ridiculous novelty traffic signal that I can program to do whatever! The first test was just making it do traffic signal things.

Traffic signal test

I’m American but appreciate the “put it in gear” phase right before a green :slight_smile:

Now the real fun part - what to do next? Any ideas?