Graphing Ecobee HVAC Run Status on Dashboard

I would like to add a card on my dashboard that shows how much my AC system has run over the past 24 hours. I have an ecobee thermostat.

If I click on the Ecobee thermostat, I can get a graph like this:

This is pretty similar to what I would want. However, I can’t make a graph like this on a card on the dashboard, because there are no statistics available related to the ecobee thermostat. I think I need to make a template sensor, but I’m not sure about the exact code to do this.

I would be happy with a simple graph over time showing whether cooling was on or off. Here is what I see under “States” related to the thermostat.

1 Like

Did you ever figure out how to do this? I also want to add a chart like this to one of my pages in HA. Thanks!

1 Like

Here’s something pretty similar.

Hi
I’ve made the following dashboard based on the link posted above with a little modification. I made a few sensors to report the temperature setpoint, when the fan is running (green), and when the heater is running (red, but shows up as yellow when the fan is running simultaneously (red+green)).
I still haven’t figured out how to add gridlines or x-axis yet, so if anyone has any points, please let me know.

Dashboard

type: custom:mini-graph-card
entities:
  - entity: sensor.living_room_temperature
    color: null
    show_line: true
    show_points: false
    show_fill: false
  - entity: sensor.foyer_temperature
    color: null
    show_line: true
    show_points: false
    show_fill: false
  - entity: sensor.bedroom_temperature
    color: null
    show_line: true
    show_points: false
    show_fill: false
  - entity: binary_sensor.hvac_heating_on
    color: red
    show_line: false
    show_points: false
    show_legend: false
    y_axis: secondary
    smoothing: false
  - entity: sensor.hvac_setpoint
    color: purple
    show_line: true
    show_points: false
    show_fill: false
  - entity: binary_sensor.hvac_fan_on
    color: green
    show_line: false
    show_points: false
    show_legend: false
    y_axis: secondary
    smoothing: false
  - entity: binary_sensor.hvac_ac_on
    color: blue
    show_line: false
    show_points: false
    show_legend: false
    y_axis: secondary
    smoothing: false
state_map:
  - value: 'off'
  - value: 'on'
show:
  name: false
  state: false
  icon: false
  labels: true
  labels_secondary: false
animate: true
hour24: true
hours_to_show: 12
line_width: 1
points_per_hour: 20
smooth: false

Setpoint Sensors

{{ state_attr('climate.living_room', 'temperature') }}

Binary Sensors

{{ state_attr('climate.living_room', 'temperature') }}
{{ is_state_attr('climate.living_room', 'equipment_running', 'auxHeat1,fan') }}
{{ is_state_attr('climate.living_room', 'fan', 'on') }}
{{ is_state_attr('climate.living_room', 'equipment_running', 'compCool1,fan') }}

Are you basically looking for a rolling 24-hour “duty cycle” or something that resets at midnight?

I’ve got both. You’ll need to replace sensor.furnace_status with your sensor that tracks the fan.

  1. Duty cycle
sensor:
  - platform: history_stats
    name: Heat ON duty cycle 
    entity_id: sensor.furnace_status
    state: 'heat'
    type: ratio
    end: '{{ now() }}' 
    duration: 
      hours: 24
  1. Reset at midnight:
sensor:
  - platform: history_stats
    name: Heat ON time Daily
    entity_id: sensor.furnace_status
    state: 'heat'
    type: time
    start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
    end: '{{ now() }}' 

dxmnkd316-

I’m interested in creating a 24 hour duty cycle for my Ecobee 3 Lite. More specifically, to track the amount of time the Ecobee is in Cooling mode. It looks like you’ve sort of laid it out here but since I’m not too well versed with HA, I could use a little help.

  1. My Ecobee sensor looks the same as the screenshot above from admbarnett. I’m not sure what sensor I need to use though. I’m assuming climate.upstairs but the state I think I need to track is actually an attribute inside the sensor: hvac_action.

  2. I don’t know where to put the duty cycle code you added in this thread.

Thanks for the help! I’m happy to provide further information if needed.

1 Like

You can just drop that into the configuration.yaml file in your main directory.

You can access that by using the file editor add -on

Let me know if you need a bit more help than that. We’ve all been there with HA and getting started really sucks sometimes. Especially given the changes that have happened in the last two years. Lots of outdated documentation floating around the web.