GEM + Grafana + Home Assistant
-
- Posts: 258
- Joined: Sun Apr 06, 2014 7:24 pm
Re: GEM + Grafana + Home Assistant
also seems the integration isn't compatible with the new energy tracking feature....
- Attachments
-
- Screenshot 2021-12-14 115719.png (87.29 KiB) Viewed 8212 times
-
- Posts: 258
- Joined: Sun Apr 06, 2014 7:24 pm
Re: GEM + Grafana + Home Assistant
ooh i think this pull from yesterday will fix it? https://github.com/home-assistant/core/pull/61653 just need to wait?
-
- Posts: 10
- Joined: Mon Sep 12, 2016 9:09 am
Re: GEM + Grafana + Home Assistant
With home assistant (HA), the first thing is that GEM reports via watts. The statistics for energy monitoring look for kwh used very much like your electric meter from the utility company.
The first thing that needs to be done is setup your configuration.yaml file to support customizations if that hasn't already been done:
The customize.yaml will contain any customizations... this may already been going on if you have customized other things. For each GEM entity/sensor you will add something similar to the following:
If you look up that sensor via developer tools you should see something similar to this. The state shows the data is being received from the GEM integration. Which in the blow screenshot is showing 6 watts of use.
Next, we need to convert our watts into kwh to track cummulative usage. To do that you will create a custom sensor to track the kwh. This will also go in your customize.yaml file.
Update the last_reset to be a time from today. I am not sure why home-assistant requires this field, but it does. If you give it some time, when you go back to developer tools and pull up that sensor it should being tracking the kwh. This is what all the energy sensors/statistics want to see in HA.
In the above screenshot you can see that the "kwh" entity has used 2.2 kwh. Give it about 5-10 minutes and then you should be able to add that sensor to the energy configuration. If you add a "friendly_name" attribute to the "kwh" sensor, that is what will appear on the HA dashboard.
Hope this helps.
The first thing that needs to be done is setup your configuration.yaml file to support customizations if that hasn't already been done:
Code: Select all
homeassistant:
customize: !include customize.yaml
Code: Select all
sensor.mechanical_room_outlet:
unit_of_measurement: W
device_class: power
state_class: measurement
Code: Select all
sensor.mechanical_room_outlet_kwh:
state_class: measurement
device_class: energy
last_reset: '2021-12-22T00:00:00-05:00'
unit_of_measurement: kWh
Hope this helps.