Mini Grpah Card combining attributes

Looking to combine these 2 data points as a single line?

type: custom:stack-in-card
keep:
  margin: false
  box_shadow: false
  background: false
cards:
  - type: grid
    square: false
    columns: 2
    cards:
      - type: custom:mushroom-template-card
        style: |
          ha-card {
            padding-bottom: 1px !important;
          }
        primary: Filey Tides
        icon: mdi:waves
        icon_color: blue
        tap_action: none
  - type: custom:mushroom-chips-card
    style: |
      ha-card {
        --chip-box-shadow: none;
        --chip-background: none;
      }
    alignment: left
  - type: custom:mushroom-chips-card
    style: |
      ha-card {
        --chip-box-shadow: none;
        --chip-background: none;
      }
    alignment: left
    chips:
      - type: template
        double_tap_action:
          action: none
        content: State - {{ states(entity) }}
        entity: sensor.filey_tide
        icon: mdi:waves
        icon_color: red
        tap_action:
          action: none
        hold_action:
          action: none
  - type: custom:mini-graph-card
    entities:
      - entity: sensor.filey_tide
        attribute: next_high_tide_in
        name: High Tide
        color: '#2196f3'
      - entity: sensor.filey_tide
        attribute: next_low_tide_in
        name: Low Tide
        color: '#f44336'
    hours_to_show: 24
    line_width: 3
    font_size: 50
    animate: true
    show:
      name: false
      icon: false
      state: false
      legend: false
      fill: fade

If you mean add them together, you could create a template sensor which is the sum of the two, and then graph that. I’m a bit confused though - it doesn’t seem to make sense to add next_high_tide_in and next_low_tide_in. Assuming you want to know when the next high or low tide is, you could create a template sensor which is the minimum of the two.

Hey hey,
Yeah that’s exactly what I want to do :smiley:

I was typing this as running out, thanks for the direction. Will take a look.

Just to clarify, Templates are YAML based and cannot be done in the UI, correct?

and I need to add this file to Config UI?

template: !include templates.yaml

Correct. But with the new format you can reload templates from the Developer Tools page rather than having to restart Home Assistant. The template can also be tested in Developer Tools to get it right before putting it into templates.yaml. It would look something like that below (not tested though).

{{ min(state_attr('sensor.filey_tide', 'next_high_tide_in'), state_attr('sensor.filey_tide', 'next_low_tide_in')) }}
1 Like

Excellent, yes that works in the Dev Tools.

Will have a play and see what I can do now.

Thanks @michaelblight