I just found this.
I will try it out.
https://www.home-assistant.io/components/binary_sensor.flic/