Hello all,
I would like to add in the energy card the power returned to the grid.
I have a sensor measuring the power consumption of the house, and a sensor of the power produced by solar panels.
I thus create a virtual sensor in the configuration.yaml
This returns the correct difference, I can browse data and see charts, in kW.
I then create a Riemann helper, based on this virtual sensor.
The output is in kWh, and I can see that is summing returned power (keeps summing since the moment I created this helper, now at 131 kWh, not resetting from 0).
Comparing this helper with, for example, the solar panel sensor (named solar lifetime energy, in kWh and never resetting at 0), why can’t I choose my helper in the energy panel as returned to the grid? It does not appear in the drop down menu.
- name: "Corrente restituita"
unit_of_measurement: "kW"
icon: mdi:flash
device_class: power # this
state_class: measurement # and this
state: > etc...
This way your Riemann Sum sensor should gain the following attributes (required for the energy dashboard):
state_class: total
device_class: energy
If it does not have these attributes after a restart you might have to delete the Riemann Sum sensor and create it again. Or just add the attributes using customize.
Also to save you a lot of issues later change your template sensor to have defaults and add an availability template, like this:
Hello Tom,
thank you very much for your precious help!
I’ve been able modify the sensor and it works!
It’s been running for a couple of days now.
Just one doubt on your reply:
Or just add the attributes using customize.
I deleted and created the Riemann Sum again, because I couldn’t find how to add them manually, but if you could, how would I do this customization manually? Thank you very much!