Read/detect color of STB to determine power state

My set top box (STB) does not have discrete power on and off commands but a power toggle. It does however has an indicator light that is red (off) and green (on). I would like to use some kind of light sensitive sensor that can detect the color of the light and with that I would be able to determine if it on or off before sending an IR command to toggle the power on or off. Does anyone have a suggestion what type of sensor I could use or an alternative way of tracking the on / off state?

Use a wall plug and when power is greater than X it is on.

1 Like

Great idea! Did not think of such a simple solution :slightly_smiling_face: