Speaker Lights

We use the speaker lights to give speaker a heads up about what the automation is doing with the recording.

For the hardware we used an esp8266 nodemcu board connected to the LED traffic light style board. Here is an example of the type of LED board that we used:
https://www.amazon.com/Oak-Pine-Traffic-Display-Creative-Arduino/dp/B07R4YR2QJ

For the software we are using ESPhome and speaker lights assembly connect to the staff wifi. Over the wifi they will connect to the MQTT server to listen for commands. We powered the speaker light using USB.

Here is what the lights do:

  • 1 min before the start time of the session the red LED will flash
  • At start time the red LED will stop flashing and turn the green LED on. With the Green LED meaning that the recording has started.
  • 5 mins before the end of the session the yellow LED will start to flash
  • At the end time of the session the green LED will turn off. The yellow LED will turn off and the red LED will start to flash
  • 5 min after the end of the session the red LED will stop flashing and turn to solid

Below is what it looks like before it was placed into a case.

Here is the esphome config file that we use.

esphome:
  name: ballrooma_speaker_light
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: 'xxx'
  password: 'x'
  manual_ip:
   static_ip: x.x.x.x
   gateway: x.x.x.x
   subnet: 255.255.255.0
# Enable logging
logger:
ota:
  password: 'x'
switch:
  - platform: gpio
    pin: D2
    name: "Red LED"
    state_topic: light/a/
    command_topic: light/a/red
  - platform: gpio
    pin: D2
    name: "Red Flash LED"

    id: Red_pin
  - platform: template
    name: "Red Flash LED"
    optimistic: yes
    id: redtemp
    state_topic: light/a/
    command_topic: light/a/redflash
    turn_on_action:
    - while:
       condition:
        lambda: 'return true;'
       then:
       - switch.turn_on: Red_pin
       - delay: 500ms 
       - switch.turn_off: Red_pin
       - delay: 500ms
    turn_off_action:
    - switch.turn_off: Red_pin



  - platform: gpio
    pin: D1
    name: "Yellow LED"

    id: yellow_pin
  - platform: template
    name: "Yellow LED"
    optimistic: yes
    id: yellowtemp
    state_topic: light/a/
    command_topic: light/a/yellow
    turn_on_action:
    - while:
       condition:
        lambda: 'return true;'
       then:
       - switch.turn_on: yellow_pin
       - delay: 500ms 
       - switch.turn_off: yellow_pin
       - delay: 500ms
    turn_off_action:
    - switch.turn_off: yellow_pin


  - platform: gpio
    pin: D3
    name: "Green LED"
    state_topic: light/a/
    command_topic: light/a/green
    
mqtt:
  broker: x.x.x.x
  keepalive: 15s
  username: x
  password: x