Hi all,
I’ve read stuff over the net and tried to create template sensors from Victron (modbus) sensors that I have, but this is simply not available to be added into the energy panel of HA.
Have an inverter, one mppt and Pylontech bank…I don’t have any current and energy meters, so can this be done without them and how?
If anyone has something like this, please can you post the template or yaml with sensors configuration?
I then use a Riemann sum integral to go from W to Wh (or kWh) (you can skip this if you can pull a sensor that already is in kWh (like diectrly from et112 carlo gavazzi)
- platform: integration
source: sensor.eskom_power
name: total_eskom_power
unit_prefix: k
method: left
round: 3
Edit: Not sure if you can stop here if the “platform: integration” was added to long term statistics, unsure…
Then finally to have a sensor that ticks all the long term statistics requirements (like last rest date, total increasing etc)
hmm, thank you Dylan…I’ll definitely use the Eskom daily power template from my Home Power Consumption sensor…
The thing is, I don’t know what to do to my modbus sensors so that they appear selectable int he energy option…when I go there, there is nothing available to select
Yes makes sense, your sensors you have aren’t “compatible” with long term statistics directly, that’s why you need to 1) use the integral integration (convert power kW to energy kWh) 2) set up the utility meter to start keeping track of the energy and having all the correct attributes.
That error doesn’t look positive, lets give it some time to create long term stats.
Also remember the battery is positive for out negative for in so you need to split those or else I would guess you will only get the difference + losses (use a template sensor for that)
- name: "Battery Power Victron"
data_type: int16
unit_of_measurement: "W"
slave: 100
address: 842
device_class: power
Then use this (have edits to your names), this will split your sensor.battery.power.victron into say
template:
#Split power in and out of battery
- sensor:
- name: "Battery power victron input"
unit_of_measurement: "W"
state: >
{% if states('sensor.battery.power.victron')|float >= 0 %}
{{ states('sensor.battery.power.victron') }}
{% else %}
0
{% endif %}
- name: "Battery power victron output"
unit_of_measurement: "W"
state: >
{% if states('sensor.battery.power.victron')|float < 0 %}
{{ -1 * states('sensor.battery.power.victron')|float }}
{% else %}
0
{% endif %}
With these two new sensors (sensor.battery.power.victron_input and sensor.battery.power.victron_output) as before “Riemann sum integral” and then “Utility meter”
I did all the way to splitting but I don’t see individual sensors, so my first question would be Do I have to split the charge and discharge sensors into two different yaml files?
Tried splitting them and still I can’t see the Battery power victron input or Battery power victron output sensors.
This is bizzare
Sensors from the template are correct and when I go to Developer Tools, they work fine