You always need to check attributes first, then check that you are not filtering the entity or having problems with the sensor, and you can see both of these things in the statistics tab: there was no entity, so you were not recording it. Sometimes there’s a problem with the entity (unit of measurement) and you can fix it there too.
Have you found a solution for your problem ? I’m trying to get my innr wallplugs in the energy consumption grid, but I also need to change stace_class to measurement instead of energy & power
Which problem? I don’t have issues regarding energy integration.
I don’t understand: what are the attributes of the innr plug attributes right now? I assume your problem is that the plugs don’t appear in the energy integration lists, correct?
Hi all,
I stumbled upon this topic as I am trying to integrate the battery template sensor (charge/discharge) into my energy tab, but these two sensors are simply not showing up
template:
#Split power in and out of battery
- sensor:
- name: "Battery input power"
unit_of_measurement: "W"
state: >
{% if states('sensor.battery_power')|float >= 0 %}
{{ states('sensor.battery_power') }}
{% else %}
0
{% endif %}
- name: "Battery output power"
unit_of_measurement: "W"
state: >
{% if states('sensor.battery_power')|float < 0 %}
{{ -1 * states('sensor.battery_power')|float }}
{% else %}
0
{% endif %}
In Dev Tools, I get all the results, but no sensors are appearing
First of all, I think also for batteries the integration needs ENERGY not POWER sensors. I don’t have a battery so I never tested this. So the device_class you used is wrong.
Second: those sensors are not total_increasing like you configured them, they are a measurement.
It’s 4.56am here. I live in Italy. Don’t do this stuff if you’re not totally awake.
Energy Integration needs energy sensors. If you have power sensors, you need to calculate the energy. You can use the Riemann sum integral integration to do that.
If you need an example, here’s the configuration of the sensors for a Tesla PowerWall system (link) made by @briancmoses
Brian made a nice configuration to adapt/rename the existing power sensors using template sensors and also defined the corresponding energy sensors using the integral platform. You can learn a lot from his configuration.
The above two (1 and 2) will measure amount of power coming IN and going OUT of the battery.
Then you need to setup the Battery kWh meter IN and OUT of the battery. Those are the two below sensors (3 and 4).
battery_charge.yaml
- platform: integration
source: sensor.battery_input_power
name: Battery Charge
unit_prefix: k
method: left
#or right or trapezoidal for methods
round: 3
battery_discharge.yaml
- platform: integration
source: sensor.battery_output_power
name: Battery Discharge
unit_prefix: k
method: left
#or right or trapezoidal for methods
round: 3