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

Support use of entities in “max” and “min” properties #184

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

mreysei
Copy link

@mreysei mreysei commented Sep 27, 2024

Name Type Default Description
max number or string 100 Defines maximum value of the bar using a number or a entity.
min number or string 0 Defines minimum value of the bar using a number or a entity.

And this is the working example using an entity and a number

type: custom:bar-card
positions:
  icon: inside
entities:
  - entity: sensor.maiku_salud
    name: Salud
    icon: mdi:heart
    color: '#a72741'
    unit_of_measurement: HP
    decimal: 0
    max: sensor.maiku_max_salud
  - entity: sensor.maiku_experiencia
    name: Experiencia
    icon: mdi:progress-star-four-points
    color: '#359441'
    unit_of_measurement: XP
    decimal: 0
    max: sensor.maiku_siguiente_nivel
  - entity: sensor.maiku_mana
    name: Maná
    icon: mdi:flask
    color: '#4693DB'
    unit_of_measurement: MP
    decimal: 0
    max: sensor.maiku_max_mana
  - entity: sensor.steps_daily
    name: Pasos de hoy
    icon: mdi:walk
    color: '#8646db'
    unit_of_measurement: pasos
    decimal: 0
    max: 10000

Result of such component
image

If this PR does not merge because this project is not maintained, you can add a "Custom repository" in HACS with my repository link:
https://github.com/mreysei/bar-card

@mreysei mreysei changed the title Can use an entity in max or min parameter Support use of entities in “max” and “min” properties Sep 27, 2024
@julll190
Copy link

Hi!
Please could you do the same thing to use entities in properties "from" and "to" inside the severity option, and maybe also in the "target" property? That is the only thing I miss.
Thank you in advance!

@mreysei
Copy link
Author

mreysei commented Oct 23, 2024

Hi @julll190, I'll give it a try.

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

Successfully merging this pull request may close these issues.

2 participants