Hello everyone. I want to modify a wifi freshener machine that is going to be in the bathroom. I want to make it trigger the air freshener when the light comes on. I have a couple of doubts. One is how the esp8266-01 should be powered. The second question is how do I make it so that when I receive the information that the light is on, I leave a GPIO on for a couple of seconds so that the perfume comes out.
The esp8266-01 is already recorded to connect to the internet with esphome
Thank you very much