danimart1991 / pvpc-hourly-pricing-card

Home Assistant Lovelace custom card to use with Spain electricity hourly pricing (PVPC) integration
Apache License 2.0
89 stars 21 forks source link

Suggestion: color for ranges #71

Open antonio1475 opened 2 weeks ago

antonio1475 commented 2 weeks ago

Ability to customize ranges or thresholds for prices, with color.

For example, the background: image

Alternative: the graph line is colored instead: image

Note: images badly done with Photopea, for illustrative purposes only.

Thanks 😄

danimart1991 commented 2 weeks ago

Good idea, but I see some limitations here.

The prices are so variant to stablish a common threshold in distinct days. How to configure it? 🤔

antonio1475 commented 2 weeks ago

In my personal case: I'm interested in fixed ranges because for example periods below 0.10€ are a good time to do certain power consuming things like dishwasher, laundry, air conditioning... And if it's above 0.20€ it's best to turn on the heater instead of the AC heat.

Of course you already see this on the graph, colors are just to make it visually easier/faster 😅

Another way is to make it relative to the max & min of the day...? 🤔 but that wouldn't really solve my use-case (eg if the day min is 0.12€ it would be green, but that doesn't mean that it's a great day for laundry.

Maybe supporting templating in the configuration solves this: leave it up to the user to figure out the right value or formula. All the needed information is in the sensor.pvpc attributes