Description

Home Assistant can gather a lot of statistics from associated sensors. But this is a field I never touched on Home Assistant and I'd like to learn more about it and see how to interact with these data with Home Assistant template.

Goals

Creating automations based on some home-assistant statistics, for instance, trigger an alarm if boiler didn't consume a lot of energy during the night, despite solar router sending a lot of energy the previous day to the boiler.

Resources

https://data.home-assistant.io/

Looking for hackers with the skills:

Nothing? Add some keywords!

This project is part of:

Hack Week 24

Activity

  • about 1 month ago: paulgonin liked this project.
  • about 1 month ago: fcrozat started this project.
  • about 1 month ago: fcrozat originated this project.

  • Comments

    • fcrozat
      about 1 month ago by fcrozat | Reply

      After a lot of digging, I found the solution: you need to use SQL integration to query Home assistant long term statistics and create related sensor.

      For instance: > SELECT state FROM statistics JOIN statisticsmeta ON statistics.metadataid = statisticsmeta.id WHERE (statisticsmeta.statisticid = 'sensor.shellyemenergy' AND startts <= strftime('%s', 'now','start of day')) ORDER by start_ts DESC LIMIT 1

      to access the value of the sensor at midnight the same day

    Similar Projects

    This project is one of its kind!