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
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…
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.