Influxdb query state changes

I have setup influxdb and I am new to it. I think I have set it up correctly as I can see the entities that I wanted to send to influxdb.

I can query values ok from entities e.g my solar system entities and temp values etc but I am trying to work out how to query an entity from my Spa which is its current status.

As an example my spa has statuses such as “ Heating “, “Auto”, “Filtering” etc

I want to see how many minutes a day it heats and work out ideal solar times etc and set the spa power saving modes accordingly.

I have tried googling it and have found some queries but I can’t get it to work. I’m sure I’m doing it wrong, or maybe it’s not sending state data properly to influxdb.

Any help would be appreciated.