I am trying to create a sensor that tells me the “duty cycle” of my HVAC system as reported by my thermostat for the past hour. I tried using the following for the sensor:
- platform: history_stats
name: HVAC duty cycle
entity_id: sensor.hvac_operating_state
state:
- "heating"
- "cooling"
type: "ratio"
end: "{{ now() }}"
duration:
hours: 1
While this does seem to give me some measure of duty cycle I don’t think it is accurately reporting the duty cycle for the previous hour. I can see it has an attribute “value” that typically fluctuates between 30m-59m. I am guessing that is the actual time range it is calculating duty cycle for. My theory is that it starts the time range at the first state change within the duration specified in the configuration. Does anyone know if my theories are plausible and if there is any way to work around those issues? Is there a better way I should be going about this?