ESP enable power to Device when sun is out

Hi guys

I want to do a project where by i have esp, battery, charger and solar panel

my question is how to turn on the device when there is sunlight and turn off when there is none? opersite to solar lights. this way its only one during the day and not running of battery 24/7

regards
Jeremy

Use entity “sun.sun” in an automation, when the state is becoming “above_horizon”, switch on the device you want and when the state is becoming “below_horizon”, switch off the device…

i dont mean by HA. i mean by using another circuit or something.

the esp wont be mean the house. so i want to shut it down. so it doesnt turn at night.

try the light sensor. like this Well, do more automation

that wont work.

Why arguments won’t work? in your question the sun. The sensor works directly with it.

If you want to do this on the ESPHome device you have several choices:

  1. Use a voltage divider, mofset etc to try and work out when your panel is charging (fiddly but here is an example you could modify: batteries - Switching between battery voltage and solar voltage to control load. in solar charger? - Electrical Engineering Stack Exchange)

  2. Add a lux sensor, go into deep sleep and wake up every few minutes to check if light levels suitable. I use a lux sensor for my front garden lights, checking every 10 minutes mean a 2000mAh battery lasts a month between charges. Since your battery would also charge when lit, you should get unlimited life. Your problem will be how often you wake up to check light levels.

What is the point of the battery?