MindFreeze / ha-sankey-chart

A Home Assistant lovelace card to display a sankey chart. For example for power consumption
MIT License
375 stars 17 forks source link

Request, Today and yesterday #92

Open Dutchy-79 opened 1 year ago

Dutchy-79 commented 1 year ago

Hi,

I've been playing with the card and really like it.

Now I'd like to see two cards at the same time today and tomorrow (or any other date)

Is it possible that there will be a option for a date helper input.

So one card with energy_date_selection and the second card with energy_date_helper

MindFreeze commented 1 year ago

HA doesn't support that. The date selection card is global. In theory I could add an offset option but it would not be worth the work IMO. Better to wait until HA's supports multiple dates or some method of direct communication between cards. Don't know of any plans but it seems logical that they would do it.

Dutchy-79 commented 1 year ago

I thought HA already supported Today and yesterday or this month and last month. Therefore I thought I would be possible to get yesterday.

I just noticed that I said tomorrow in my first post but this should be yesterday of course because no one knows what I'm going to use tomorrow.

MindFreeze commented 1 year ago

It supports only 1 period at a time. So if you add 2 date selection widgets and change one of them, the other will change as well. So both cards will show the same thing.

More over, the sankey card doesn't know what kind of period is selected. It only gets a start and end timestamps. So determining the next/previous period in this card automatically is non trivial as well.

MindFreeze commented 10 months ago

@Dutchy-79 HA now has a "Compare data" button that allows you to compare to the previous period. How do you envision this though? 2 separate sankey charts for today and yesterday? I don't think it makes sense to show everything in 1 chart. Having 2 charts would mean that after you click the "compare data" button, a second chart would appear below the current one and affect the overall layout. The other option is to reduce the height of both charts to half so they take up the same space

AleXSR700 commented 1 week ago

So should the Sankey card in theory respond to the date picker of the Energy dashboard?

I tried adding one to my dashboard that contains the Sankey card but it does not respond to changes of type: energy-date-selection

MindFreeze commented 1 week ago

So should the Sankey card in theory respond to the date picker of the Energy dashboard?

I tried adding one to my dashboard that contains the Sankey card but it does not respond to changes of type: energy-date-selection

You have to set energy_date_selection: true