Energy Usage Chart

Is there a component that can show statistics and chart for energy usage of various z-wave devices i have in the house that shows energy used in total and by individual devices. I used the energy plugin in Vera and it show those information.

Also i clicked on one of the energy switch, its shows like this:
current power mwh 157967

it would be nice if its formatted to read better something like “211 watts”

These sensors give stats, which might do what you need


To manipulate the formatting in the display, I think you need to use a template

but that is a black art I have never delved in to.

1 Like

thank you so much, i will give it a try.
Does History Statistics Sensor and Statistics Sensor are two different options or i have to install both?

1 Like

If you find a solution. Please let me know.

1 Like

I’m also interested in a solution for this =)

1 Like

I’d suggest feeding the sensor readings into an InfluxDB instance and then use Grafana to create nice graphs of everything.

Sebastian

Is InfluxDB this on the cloud?
For privacy reason i am configuring everything away from cloud and thats one reason i am moving from Vera to HA.

thanks.

InfluxDB runs entirely on your own computer.

The only interaction with the cloud is a message back to influx that they claim to use as a usage indication. You can configure influxdb not to send this though.

I am using Sonoff pow for measure power. I have modified history_stats.py and create **history_total.py
https://drive.google.com/file/d/0B6pRwnTPCBPSbl9QNWZxS19qTnM/view?usp=sharing
Now I calculating my power consumption.
Any body can use it for own risk.

3 Likes

Sorry I didn’t get a chance to try it out yet, but will soon.
As you mentioned InfluxDB grabs data from HASS but does it integrate well in HASS to show graphs right on HASS UI or i have to use a different url to get to it?

InfluxDB is only a database specialized on storing sensor measurements.
It only does provide a CLI and a web UI for administrative tasks.
To visualize the data, you need a separate tool - I’m using Grafana.
Grafana has a “point and click” web UI that makes it very easy to create nice graphs from InfluxDB measurement data.
However, it does not integrate into HA, at least not out of the box, so you’ll access your graphs through the Grafana user interface.
You may be able to use panel_iframe: (or sth. similar) to get the Grafana UI into HA, but I didn’t get that working for my environment and gave up trying.

Sebastian

I use the standard HA history graph without external tools
image

https://home-assistant.io/components/history_graph/

Cool. Is this per device and shows all devices total?

just looked at History Graph, and i don’t see anywhere options to change from what date range i want to graph and does it store data for ever? so i can review anything i want.

Question for Sebastian:
I am looking at InfluxDB also and the instructions for installation says about version -0.9.5.1
So i went to InfluxDB site to see whats the latest they have and notices “try it free for 14 days” does this mean its not a free application that i can install on raspberry (thats where my HASS is running)
thanks.

You can set the time range with the hours_to_show parameter. Data is stored in the home assistant database, as defined by “recorder” in your configuration.yaml. The history_graph is just extracting data from the database.

The “try it free” thing is for a cloud service they’re apparently offering.
Look here for download sources: https://portal.influxdata.com/downloads

Sebastian

great, i just installed InfluxDB and grafana on my Pi

  • added influxDB: in the HASS configuration and also created database in InfluxDB
  • restarted Pi
  • i see database is populated with a lot of things.
  • now i am trying to add home_assistant db in to the datasource on Grafana, but it just gives me error with no message.

under add datasource, i gave
url = http://ip:8083 (i tried port 8086 also)
access = direct

everything else default

any idea?

please ignore, i was not selecting the type: influxDB, now i was able to add datasource

Now, trying to create my first graph in the dashboard, and in the query looks like i have a learning curve to create one. for example i want to create a graph for my temperature sensor showing temperatures.

You might want to limit the data HA sends to InfluxDB, like this:

influxdb:
  host: xx.xx.xx.xx
  username: myuser
  password: secret
  include:
    entities:
      - sensor.fibaro_fgms_livingroom_temperature
      - sensor.fibaro_fgms_livingroom_luminance
      - sensor.fibaro_fgk_bedroom_temperature
     [...]

The queries are (imho) pretty easy to build. As an example, this is the graph for my living room temperature:

Sebastian

3 Likes