rejuvenate / lovelace-horizon-card

Sun Card successor: Visualize the position of the Sun over the horizon.
MIT License
468 stars 35 forks source link

Feature request: add option to use custom times for markers in the card #160

Open schattenphoenix opened 5 days ago

schattenphoenix commented 5 days ago

Excuse the poor formatting, I'm currently on phone but didn't want to forget it.

what is this about?

I use the horizon card to track sun rise and down to sync my plant lights with it. Given that the days obviously become shorter through the year in winter, I do apply offsets to these times. In fact what I'm currently doing is using the sundown as my turn off time and a fixed offset from that to turn them on so they get the same amount of hours.

what would I like?

I would like to be able to use a time (in template form?) that I could add, to show as a marker in the card similar to how sunrise and sundown are shown. Potentially even a list of them.

I might be able to add it myself at some point if I find time but I figured maybe others find this feature interesting so I opted to request it here.

If it's too much work, it's also still great without the feature, I work around it with small entity cards currently and it's fine, this would only make it a little cleaner :)

Cheers!

ThomDietrich commented 4 days ago

Hey! There is nothing wrong with the entities cards right next to a horizon card. I understand you are asking for markers within the diagram. Could you come up with other use cases for who/when this might be needed and useful?


Regarding your specific use case I would like to clarify: The automation to turn on and off lights is working and independent of the horizon card. You would however like to additionally mark the effective light toggle times inside the horizon card. Is that correct?

schattenphoenix commented 4 days ago

Hey! There is nothing wrong with the entities cards right next to a horizon card. I understand you are asking for markers within the diagram. Could you come up with other use cases for who/when this might be needed and useful?

Regarding your specific use case I would like to clarify: The automation to turn on and off lights is working and independent of the horizon card. You would however like to additionally mark the effective light toggle times inside the horizon card. Is that correct?

Your assumption about my use case is correct. I do fetch the times elsewhere so just being able to add a set (2 is what I need but IDK about others) of home assistant compatible time formats would be brilliant, potentially with an optional label.

One thing this could be used for would potentially be people visualizing their next alarm in relation to the sun rise. Given the templating is rather powerful, almost anything that's available as time could be added.

ThomDietrich commented 4 days ago

Great. This makes total sense to me. I'd happily review a PR provided by you or anyone else. Contributions welcome!

schattenphoenix commented 4 days ago

I might have a look. Sadly I have a strange distaste for js so it needs quite some convincing myself to start touching on it.

But if I find enough time I might have a look if no one did by then.

Defragmentor commented 8 hours ago

Some potential other use cases (just some ideas):

Defragmentor commented 8 hours ago

While we are in the feature suggestion department herewith another suggestion I believe to be similar to the OPs request. It is not really a request as I don't plan to use this myself but maybe someone else will. There are 3 type of 'dusk': Civil dusk; Nautical dusk and Astronomical dusk. Each are 6° apart. Found some nice graphical representation here: https://science.howstuffworks.com/nature/climate-weather/atmospheric/twilight-dusk.htm

btw: very nice card! I discovered it today and immediately installed it.

schattenphoenix commented 8 hours ago

While we are in the feature suggestion department herewith another suggestion I believe to be similar to the OPs request. It is not really a request as I don't plan to use this myself but maybe someone else will. There are 3 type of 'dusk': Civil dusk; Nautical dusk and Astronomical dusk. Each are 6° apart. Found some nice graphical representation here: https://science.howstuffworks.com/nature/climate-weather/atmospheric/twilight-dusk.htm

btw: very nice card! I discovered it today and immediately installed it.

I wonder which most people refer to. I think it's the astronomical one where the color shifts, no?

But yeah, if one would be interested, these could be added by hand too

ThomDietrich commented 5 hours ago

Thanks @Defragmentor, very helpful. I too find this interesting.

Sounds to me like we need at least two modes: Single time markers and time ranges.