Grafana: track lights? (# on/off switches & total on time)

Just out of curiosity I would like to keep the stats of lights.
That is:

  • number of times they switched on/off
  • total on hours

Anyone doing this (or something similar)?
TIA