Group with only active lights

Hello all
Is it somehow possible to create a group which only contains the currently enabled lights?
Would be great to put that on the main page to quickly see what lights are still on.
Thanks
Roman

While you at it maybe base it on time of day.
SUN UP: show light that are ON
SUN DOWN: Show lights that are off

Looks like built in way to do this with groups using Automation and Visibility. I might give this a try and let you know.

https://home-assistant.io/docs/configuration/group_visibility/

I would need something to programmatically populate a group or to programmatically set the visibility of entities inside groups based on a condition (state). All I have found until now is either to show/hide an entire group or show/hide entities everywhere.