VictoriaMetrics or other long term stats

Is there any easy step by step guide on how to enable long term stats in HA? Questions I would like to get answered are for example: how many times a day on average I have opened my garage door during last year or how long during the day is the washing machine used.

So far I tried installing influxdb integration with VictoriaMetrics addon. However the results are not spectacular, most likely due to me not understanding how it is supposed to work together. So on a technical level a few questions come to mind:

  1. Which TS DB should I choose? InfluxDB, Victoria Metrics, Prometheus, or anything else? IIRC then I tried InfluxDB it was using some old version with not very flexible query language (plus documentation was lacking).
  2. How does info about entity states flow between HA and TS DB? Should I use influxdb or prometheus integration which will make HA push the entity states to the TS DB? Or should it be another way round: the TS DB should connect to HA to get entity states? (that’s how I understand scrape_configs in prometheus integration)
  3. How do I verify that the connection is working fine?
  4. How should the time series look in db? Right now I am getting timeseries containing values for some timestamps, but not for others (even if I know the HA was running fine at that time). For a simple switch I would expect value 0 or 1, but what I get is 0 or nothing. Maybe I don’t get it, but this is not very intuitive for querying.
  5. How do I connect to the TS DB. I know about Graphana, are there any other options for beginners?

Hey!

  1. For better understanding Prometheus and VictoriaMetrics you can start with Introduction to Prometheus .
  2. VictoriaMetrics was made s long term storage for Prometheus, but now it is more widely used as a complete and standalone monitoring system with a flexible ecosystem of different components including a cluster for high availability. You can see more integrations at the link VictoriaMetrics.
  3. To view the metrics stored in Prometheus and VIctoriaMetrics, both products have their own web interfaces, through which queries are made to the database to retrieve metrics and values. Both have PromQL support, and VIctoriaMetrics has an improved and extended MetricsQL query language. But you can use Grafana or any other PromQL compatible software/ui for querying the data.

If you will have any specific question about VictoriaMetrics software you can ask it in any of VM communities or ping me here.