Pi Traffic Light

Hello,

I have installed Pi Traffic Lights on my remote_rpi_gpio Raspberry Zero 2 W, then I install the software.

This is the code I’m using for the remote Raspberry Zero;

from gpiozero import TrafficLights
from time import sleep

lights = TrafficLights(9, 10, 11)

lights.red.on()
lights.red.off()
lights.amber.on()
lights.amber.off()
lights.green.on()
lights.green.off()

What I need to know how do you use this code to use as a notification in Home Assistant, say when a door sensor is open/close the Traffic Lights will turn on one of the 3 LEDs for notification.

I setup the import MotionSensor on another raspberry Zero and integrated(.yaml) into Home Assistant and Motion Sensor works fine. I’m not sure how to do it for the Traffic Light 3 LEDs as a notification.

Thank you,
William Gill
[email protected]