I am using the Hive Integration and this stores ‘On’ and ‘Off’ in the state of the sensor field along with a time when the activity happens.
In Grafana I can see this with the following query:
SELECT state,time FROM “sensor.thermostat_1_state”
Thanks Tom. Just noticed your reply after putting that message on last night I discovered the History Stats and used that mechanism. I actually had to combine it with a ‘template’ to get it into InfluxDB so I ended up with the content below. I am still learning a lot but I’m enjoying it.