I have an Ecobee thermostat and would like to see a history for the “Fan mode.” The standard History view for this thermostat only displays Current Temp, Cooling, and Target Temp. How to I get the fan mode to display in the History?
This might be a bit of a crude solution, but I believe the fan state is tracked as an attribute so you could build a template binary_sensor that tracks that attribute.
Something like this (not tested):
template:
- binary_sensor:
- name: "HVAC Fan"
state: >
{{ state_attr('climate.termostat','fan') }}
Thanks, I’ll give it a try!
This works to track the on/off state of the fan, but I would like to be able to graph the state on the same history graph as my thermostat. I am not sure how to configure the template sensor to allow for this.
Basically I want to create a custom History graph that is identical to the graph shown for Climate entities and that also includes the state of the HVAC fan (similar to how the cooling/heating mode is shown).
I haven’t been able to test it yet, but you could create a template sensor, in your sensors.yaml that looks like:
- platform: template
sensors:
ecobee_fan_active:
friendly_name: "Ecobee Fan Active"
value_template: >-
{{ state_attr('climate.my_ecobee', 'fan') }}
icon_template: mdi:fan
and then a history_stat that looks like:
- platform: history_stats
name: Ecobee Fan Active Today History
entity_id: sensor.ecobee_fan_active
state: "on"
type: time
start: "{{ now().replace(hour=0, minute=0, second=0, microsecond=0) }}"
end: "{{ now() }}"
While you don’t have to put your sensors and history_stats in a separate file(s), but could instead put them all in configuration.yaml, this is messy and not best practice. You would also need to change your coding to accommodate this. See: https://www.home-assistant.io/integrations/history_stats/#configuration
The history stats page will also provide you with information that allows you to modify the start:
and end:
parts of the code if you want to look at the history over the past year (but the furthest back you can go will be when you created your template sensor.
Hope this helps and that it works!
EDIT: I tested this as I have the Ecobee Premium and the above works