Conditional display lovelace

I’ve looked around here but didn’t find a solution yet.
Situation: I have lights in the garden. And the are set ON at Sunset, and set OFF at 23:00.
I’ve created an inputfield “input_datetime.tuinlichten_eindtijd” (end time) with only Time to input.
And that inputfield is put on a card in lovelace, so I can change the “end time”
I want to make both field variable. So, then I have a “start time” and an “end time”
BUT, it must be possible to specify “sunset” , (or sunrise) as value too.
Was thinking I could create 2 input_select fields, with values :“Sunset”,“Sunrise”,“Time” , 1 for the start time, 1 for the end time.
And when “Time” is not selected, the input_datetime field is not visible. When “Time” is not selected, the input_datetime field should be visible.
(additional, when “time” is not selected, an other input_datetime field schould be visible, to be used a offset)
Any idea ? I’ve installed HACS, so, if the solution uses hacs cards, it’s no problem…

You could use the scheduler card that allows you to choose either option (sunrise/sunset or a time).

It also does away with the need to write an automation.

thanks. I will have a look at it !