home-assistant-sun-card icon indicating copy to clipboard operation
home-assistant-sun-card copied to clipboard

Suggestion re: known issue of tomorrow's sunrise

Open tomlut opened this issue 3 years ago • 5 comments

Regarding the known issue of the card displaying the next events rather than the previous, the card could be adapted to use the Sun2 integration that always has these values available.

https://github.com/pnbruckner/ha-sun2

tomlut avatar May 23 '21 03:05 tomlut

Thanks for the suggestion! The issue is that probably not too many people use this integration, so it would force people to install extra things, which is not great imo. I have been considering whether to replace the sun integration with a JS/TS library to fix it and maybe even been able to implement moon functionalities, but I need to check what are the options out there.

AitorDB avatar May 23 '21 20:05 AitorDB

I guess it would be better to improve the sun integration to provide more values. Home Assistant always appreciates pull requests :-)

kroimon avatar May 23 '21 21:05 kroimon

@AitorDB Thanks for providing this card.

I have been considering whether to replace the sun integration with a JS/TS library to fix it and maybe even been able to implement moon functionalities, but I need to check what are the options out there.

I would much rather see a solution like that of https://github.com/mishaaq/sun-card where the source of data can be configured by the user, defaulting to the standard sun component but allowing people who use sun2 to leverage it. If this were converted to use an external library the times it calculates may disagree with those of automations that use an HA platform.

Personally I really prefer the way this card displays the information, but the fact it displays tomorrow's dawn (from sun.next_dawn) bothers me.

pabigot avatar Nov 12 '21 15:11 pabigot

Current changes in dev should help to do that @pabigot but I haven't had time to test that part yet and it probably will need some tweaking, more info here

AitorDB avatar Nov 13 '21 21:11 AitorDB

@AitorDB I saw some of that. It didn't look trivial to swap in the sun2 component; it provides its values as separate state entities like sensor.sunrise or sensor.elevation, rather than as multiple attributes on a single sun entity. But then I don't read typescript very well, so maybe it's easy to bridge the difference.

pabigot avatar Nov 13 '21 22:11 pabigot