Query consumption/time based on another field (energy consumption per day when sun is down)

Thank you very much for your detailed explainations and examples!

Unfortunately, it turns out that my kWh data and sun state is not pushed at the same time (see screenshots below). Are you still aware of a way to join these two data sets with Flux?