kalkih / mini-graph-card

Minimalistic graph card for Home Assistant Lovelace UI
MIT License
2.87k stars 231 forks source link

Fill based on another entity? #1036

Open fodi666 opened 7 months ago

fodi666 commented 7 months ago

Hi, is it possible to specify that a line should be filled on parts when another entity has a certain value? I have my heating system's data hooked up with this card and I wold like to show when the heating is active. Currently I have a temperature entity which I display and I have a heating active binary entity that I'd like to use to control the fill (fill only when true, similar to the default display of a climate entity). Thanks

ildar170975 commented 7 months ago

Not possible currently. You may prepare a DETAILED description of a desired functionality and propose a "Feature request".

Or find another ways.

fodi666 commented 7 months ago

how much detail do you need?

ildar170975 commented 7 months ago

How much do YOU need to write a working code? Principles of making a good technical assignment is an off-topic here. It should be a complete description for a person who will be able to implement this.

Glideh commented 7 months ago

That'd be great to have the same conditional fill under the temperature line as HA's default graph behavior with the thermostat image This one is quite ugly but I liked the idea

Maybe we could give the ability to configure a conditional fill property into the entity line like this:

type: custom:mini-graph-card
entities:
  - entity: climate.heater
    attribute: current_temperature
  - entity: climate.heater
    attribute: temperature
    fill:
      type: entity
      entity: climate.heater
      color_mapping:
        heat: red
        cool: blue
fodi666 commented 7 months ago

That'd be great to have the same conditional fill under the temperature line as HA's default graph behavior with the thermostat image This one is quite ugly but I liked the idea

Maybe we could give the ability to configure a conditional fill property into the entity line like this:

type: custom:mini-graph-card
entities:
  - entity: climate.heater
    attribute: current_temperature
  - entity: climate.heater
    attribute: temperature
    fill:
      type: entity
      entity: climate.heater
      color_mapping:
        heat: red
        cool: blue

I could also imagine this as having a temperature sensor as the entity for the line and a binary sensor for the fill


 type: custom:mini-graph-card
 entities:
   - entity: sensor.temperature
     fill:
       type: entity
       entity: binary_sensor.heating
Glideh commented 7 months ago

Yes, would be considered as binary when no color mapping specified. That would still be great to be able to specify the color though.