good morning youtube so i've been working with the latest update on home assistant this is the 8
6 version so one of the features they added was they have this energy dashboard so this is a small
version of that you can also come over here to the energy tab or they have a direct link right here
so you've got your energy usage this is what's coming from the grid i have here a utility energy
sensor and that's recording every hour how many kilowatt hours were used and then if we scroll
down here i also set up an energy sensor for my grid tie system so that's recording
there starting at eight am we got 0.13 kilowatt hours and then 0.15 and then they combine those
into this here's your solar production here's the grid consumption all feeding the house this is a
external sensor that's based on your location and they work out the percentage of
the grid power that you're using where that came from and then they work out a non-fossil
energy consumption percentage there and then you've got your totals down here you can also
set up your cost per kilowatt hour now these two things here the grid tie and the utility energy
data is coming from my vera controllers over here so for instance this is my utility power here on
my vera and then my grid tie power is right here anyway i was having trouble getting this set up
because there's supposedly some sort of mismatch between the data that the vera controller collects
and is sent over here to home assistant so for instance right here here's that same sensor so on
the vera here 162 watts we come over here on home assistant 162 watt there's my power and it's got
these particular readings there's current power w is the 162 watts there's a kilowatt hour total
and then 149 is the vera or z-wave device id so that shows up here but you can't directly get this
number over here so there's several steps you have to do to do that so i thought i'd make this video
to show you how to do that the way you set those up is you come over here to configuration there
we go here we go energy like i said i created this sensor called utility energy and if i want to add
consumption here i could not get the vira sensor to show up here and if you click on this right
here it brings up this web page here that says if you can't find it in the drop-down that's caused
by a bug in the integration providing the entity and you're supposed to open an issue with the
author of the integrations i don't know exactly who that is or what's going on there but i found a
really easy way to work around that let's see i can show you over here first we can look at one
of those so for instance here's the home energy monitor this is the sensor that was imported
from the vera controller so this is the aotek home energy monitor generation 5 it's z-wave device 149
and here are the current readings and then this is the name in home assistant you can see it's
got all that data there but i think there's like too much data i'm not sure the exact reason that
this doesn't come in but there's something that home assistant doesn't like about that
here i have the file editor integration and i'm editing the slash config slash configuration dot
yaml file so this is where all your configuration is so for instance my vera integration here's the
ip address of the viera controller and the port number 3480 that's just to get your vira connected
to home assistant and you can actually do that through the ui if you want to when you're setting
things up this is the key bit of uh magic i guess that pulls the vira data into home assistant
in the right form that it's happy with it so it's what's called a template and you're creating a new
sensor called utility power and you're saying that the state of the utility power is that
sensor.hemg5 underscore 149 that was in the developer tools here and then you're using
the current underscore power underscore w reading the watts value of that sensor into the state of
the utility power i'm not sure what the root cause of this issue is i think it's somehow related to
the fact that there's more than one thing in here there's also current energy under kwh and there's
various other pieces of data in this sensor and i think they want this utility power sensor to be
one number that's watts so you tell it that it's reading watts and here's how you get the watts and
then my grid tie it's the same thing except it's home energy monitor generation one device id 17.
and so that creates these two new sensors called utility power and grid tie power you can name
those things anything you want and then there's a couple more things you have to do one is they
have this recorder feature in home assistant that says record all this data and all you have to do
is put recorder colon and that turns it on and then there's two more things that happen here
you define some new sensors that are based on statistics and integration so the the two down
here this is the statistics that's enabled by the recorder so you're basically telling it to
record the utility power sensor data just save it all as it comes in and this is updated like every
15 seconds from my vera controller and then the key part here they have this integration platform
or package that's in home assistant this is different than integrations which is like what the
vira or grafana or influx or any of these things are integrations this is mathematical integration
so it basically says take the utility power and integrate that over time and create a new sensor
called utility energy and then you have a three different methods to do that integration you can
either do a trapezoidal integration or left or right riemann sum and then the units are k
kilowatt hours and round it to two decimal places and then there's still one more thing you need to
do is down here this dashboard thing is controlled by this utility meter section so you have this
utility energy that you created here so there you tell it i've got this thing i'm calling utility
energy that comes from sensor dot utility energy and i'm going to do a monthly cycle on it so i'm
going to record energy for a month and then i'm going to reset to zero and start recording again
this is where you pull the data in from your vera this is where you tell it to save that data
this is where you generate the energy data from the power data and then this brings that energy
data into the utility meter dashboard so that's the roundabout way of doing that so what i want
to do here is i want to create a new sensor i'm going to try to save the power and energy that my
refrigerator uses we'll call that refrigerator power but what i can do is we'll come over
here to overview and let's see kitchen here's my refrigerator device and if we look at the settings
it's on a smart switch so i want to copy that yeah so then the other thing is it also has this
current power w attribute and that's what i want to use and there's the device id and you can see
this smart switch is recording kilowatt hours i think the main issue is that the vira controllers
record a cumulative kilowatt hour number so every time this changes they keep bumping this number up
but home assistant wants a daily and monthly total of kilowatt hours and i guess they have trouble
converting between a cumulative kilowatt hour and a daily or a monthly value here we are at the file
editor so now i've got my refrigerator power and i want to change this right there so switch
dot refrigerator underscore 25 current power w is my refrigerator power sensor so then what i
need to do is come down here i'll copy and paste and then i want to take this refrigerator power
and i'll put that there so now i say save all the refrigerator power data so yeah now i've
got a copy there to integrate it so i need to get refrigerator power and that'll be this one here
now i'm creating a refrigerator energy sensor so i'm saying integrate the refrigerator power over
time and call that refrigerator energy and then in the utility meter section i tell it to create
this refrigerator energy entry in the utility meter section that comes from this refrigerator
energy sensor that we created up above and i have a green check mark so i'm going to save i have to
go to the supervisor and it's just off screen but i'll come over here i clicked on the system tab
and what you need to do to get the configuration file read in is you've got to restart the core
the core has restarted here and if we go up here and look nothing's different we
don't get anything there you have to come down here to energy now i added an individual device
oh there now it showed up so now refrigerator energy shows up here as a device that i can add
so now i'm tracking the amount of energy my refrigerator uses let's see let's see what
that looks like here so there's nothing there and okay that adds this new line down here
refrigerator energy so it looks like a bar now it will take about two hours for any data to start
showing up here it takes a while to create all the devices and then i believe it also has to record
some amount of energy like a tenth of a kilowatt hour until you get to a certain reading
it won't show up here i'll come back later today and we'll see what this looks like okay it's early
afternoon now and things have updated a bit and then finally the refrigerator energy has kicked in
yeah so it's used a tenth of a kilowatt hour so far since i added that sensor earlier in the video
and then i added my laser printer in there i guess it hasn't used enough energy to register and then
i've also done the same with my hybrid inverter diversion load so it showed up i i also added one
for diversion load one but that hasn't kicked in yet oh and here we go here's there's some
updates now so here's the refrigerator is used 0.17 kilowatt hour the diversion load is used
a tenth of a kilowatt hour and the laser printer has used point zero two so i guess that'll total
up every day you can look at it day by day oh yeah if you have any questions about that i'll try to
answer those post up in the comments section below and as always thanks for watching