I’m using the history_stats platform to track how long my air conditioner is running each day. I’ve always had it configured to add the time it sees my ac sensor in ‘Cooling’ mode. Now that it’s cold, the ‘Cooling’ mode has turned to ‘Heating’ and my sensor is no longer useful. I would like to make the history_stats sensor count the amount of time my ac is Heating OR Cooling. My current config is below:
FWIW, I’ve tried adding an additional “state” statement, but that causes the sensor to error out. I’ve pondered creating a history_stats sensor for heating and cooling mode separately and then adding them together, but that doesn’t seem to work out well. Any advice is appreciated!
Sorry for reviving an old thread, but I thought it better than starting a new one when this is the top result on Google.
You can track multiple states in a single history_stat sensor now. The documentation says state needs to be a list | string. Take a look at the test to see how to use it