custom-cards / bar-card

Customizable Animated Bar card for Home Assistant Lovelace
MIT License
364 stars 52 forks source link

Making target value and max value the same as a variable #119

Closed DEADSEC-SECURITY closed 3 years ago

DEADSEC-SECURITY commented 3 years ago

So I'm using bar-card for a pH meter and with static values works great but I have a different sensor that returns the value of neutral pH from some calculations based on temperature and I would like for the value in target to be this sensor (entity) value.

What I have:

- entity: sensor.green_house_1_intake_water_ph
    name: Intake Water PH
    max: 14
    min: 0
    entity_row: true
    target: 7
    type: 'custom:bar-card'

What I want: Entity sensor.green_house_1_intake_neutral_ph value is 8so max should be 16(8*2) and target 8

What I tried:

- entity: sensor.green_house_1_intake_water_ph
    name: Intake Water PH
    max: sensor.green_house_1_intake_neutral_ph * 2
    min: 0
    entity_row: true
    target: sensor.green_house_1_intake_neutral_ph
    type: 'custom:bar-card'

Is this possible if yes how can I achieve this?

orson1282 commented 3 years ago

I agree with @DEADSEC-SECURITY, it would be a nice feature to be able to set dynamic values for max and target (maybe even min if there's a use case for that).

I found a possible solution here: https://community.home-assistant.io/t/100-templatable-lovelace-configurations/105241

DEADSEC-SECURITY commented 3 years ago

I agree with @DEADSEC-SECURITY, it would be a nice feature to be able to set dynamic values for max and target (maybe even min if there's a use case for that).

I found a possible solution here: https://community.home-assistant.io/t/100-templatable-lovelace-configurations/105241

This worked very well. Thanks