I had a great deal of work making my NodeRed handle polar days/nights.
Common issue was the state of light the first day when the sun never went below horizon, or raised over.
Adding offsets to this generated completely inversed situations too.
Does HA have some decent variable/method I can use that can be used to control lights, and not get confused by polar day/nights?
Can you give a more detailed description of what you want?
The most flexible option is probably a Template sensor or binary sensor. Templating can be used to take data from multiple sources to synthesize your desired output.
That integration used to have a warning about it not working for high latitudes. Not sure if it was fixed or if they just removed the warning from the docs.