Can I use history_stats if I want to measure multiple states?
For example, my air conditioner also has Cool state in addition to Heat, I want to measure both.
how can i do this best?
create multiple history_stats or can I combine this smartly, if so in what way?
The docs say you can use a string or list in the state field, so it should work. I can confirm that it works on my instance. However, in your example you are missing a closing single quote on “heat” in the list for the state values. That may be what’s causing your issue.
Another option would be to combine a template sensor with your history stats sensor.
First, make sure you are using the correct values for state. What you have posted looks more like the “friendly” front end representations. The actual states for vacuum entities are normally one of the following: docked/cleaning/idle/paused/returning/error.