Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bar colour based on template #161

Open
flybrys opened this issue Apr 13, 2023 · 0 comments
Open

Bar colour based on template #161

flybrys opened this issue Apr 13, 2023 · 0 comments

Comments

@flybrys
Copy link

flybrys commented Apr 13, 2023

I'm using this card to visualise how our energy usage is tracking against a pre-set budget for the day.

I'd like the bar to be green if it is under budget, yellow if it is slightly over, and red if it is way over.

Is it possible to set the colour based on template conditions?

This is the code I want to use for true/false conditions on the budget:

{{(states("sensor.house_total_daily_energy")|float) < (now().hour * 60 * 0.0104166) }}

{{(states("sensor.house_total_daily_energy")|float) < (now().hour * 60 * 0.0125) }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant