I’m trying to work out, in Home Assistant, the time intervals when an entity (e.g. climate.living_room) had a certain state such as "heating".
I don’t want the total duration or proportion of time — I want the actual start and end timestamps of each “heating” period within a time window.
The get_statistics and history_stats integrations only give aggregate values, and templates can only access the current state duration.
The reason I want access to this data is because I'm trying to design a community blueprint that helps you to calculate the heat loss of your home. But in order to do that, I need to estimate whether gas consumption (for which I use get_statistics) is coming from heating or from hot water use.
Any pointers or examples would be much appreciated.