I saw someone do this. It works. You need enough solar panels to charge the battery enough in the daytime to make it through the entire night, and probably longer in case it’s cloudy or bad weather.
You need to make sure it’s the kind of battery that can power and charge up at the same time (some batteries can only do one or the other at a time). Sometimes it’s easier to do this with a 12V battery instead.
Make sure you get the right adapters depending on your setup.
For what it’s worth, I almost set up my own solar solution, but in the Fall, Wyze said they are working on releasing their own solar power product, so I figured I’d just wait for that to come out. Save me all the calculations, time, and hassle and they’ll still keep it at a reasonable price. That’s my plan.
Still, you can look over things other people have done. Here are some examples: