Smart Home Hubs & Tech (Home Assistant, Homebridge etc.)

Sure, here’s the code I’m using. It utilises the Mini Graph Card.

Electricity:

type: custom:mini-graph-card
entities:
  - entity: sensor.elec_price_today
    aggregate_func: null
    name: Today
  - entity: sensor.electricity_12mf_octopus
    aggregate_func: null
    name: Baseline
    color: grey
    show_fill: false
name: Electricity
hours_to_show: 672
group_by: date
show:
  graph: line
  labels: true
bar_spacing: 2
decimals: 2
smoothing: false
height: 500
upper_bound: 38
lower_bound: 14
color_thresholds:
  - value: 22.23
    color: red
  - value: 22.23
    color: green
color_thresholds_transition: hard

Gas:

type: custom:mini-graph-card
entities:
  - entity: sensor.gas_price_today
    aggregate_func: null
    name: Today
  - entity: sensor.gas_12mf_octopus
    aggregate_func: null
    name: Baseline
    color: grey
    show_fill: false
name: Gas
hours_to_show: 672
group_by: date
show:
  graph: line
  labels: true
bar_spacing: 2
decimals: 2
smoothing: false
height: 500
upper_bound: 11.5
lower_bound: 2.8
color_thresholds:
  - value: 5.75
    color: red
  - value: 5.75
    color: green
color_thresholds_transition: hard

sensor.elec_price_today and sensor.gas_12mf_octopus are simple template helpers using {{ xx.xx }} in the template, replace xx.xx with the baseline value you want.

1 Like