How to build ESP light sensor

Please don’t post pictures of text. Post the actual text and format it for the forum: https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

We need you entire sensor: section at least.

Sensor should be ok with reverse polarity.