Hey Everyone,
As the title suggests I have a Victron Multiplus 2 with a lead acid battery bank setup. I have used Modbus to integrate all of the data from this and also have a Fronius Primo 5.0 AC coupled.
My question is how has anyone else managed to get the battery discharge rate/amount into the Energy Dashboard?
I have used register 842 which gives a positive and a negative number depending on if the battery is charging or discharging. But how do I use this with the dashboard? From what I can see you need two separate sensors. Or am I missing something?
I have the following slaves-:
com.victronenergy.grid slave: 30
com.victronenergy.system slave: 100
Fronius primo pv inverter slave: 20
Everything else seems to work like a charm but cant get the battery figures right.
Is this what you are asking? Sorry I am not very experienced with HA or code but try my best.
sensor.battery_current
Battery current
22 unit_of_measurement: A DC
device_class: current
friendly_name: Battery current
sensor.battery_power_system
Battery Power System
1272 unit_of_measurement: W
device_class: power
friendly_name: Battery Power System
sensor.battery_state_of_charge_system
Battery State of Charge System
88 unit_of_measurement: %
friendly_name: Battery State of Charge System
sensor.energy_into_battery
Energy_into_battery
1.40 state_class: total
source: sensor.battery_power_system
unit_of_measurement: kWh
device_class: energy
icon: mdi:chart-histogram
friendly_name: Energy_into_battery
sensor.energy_out_of_battery
Energy_out_of_battery
unknown state_class: total
source: sensor.charge_power_system
icon: mdi:chart-histogram
friendly_name: Energy_out_of_battery
Sorry it doesnt display very well on here.
It seems I am not getting the data for charge power but I have a feeling thats when the battery is getting charged from the grid not how I thought the slave address meant discharging…
I don’t know your device at all, are you sure the ‘Charge Power System’ entity provides Watts charged to the battery - when the former entity already does with positive/negative values? Maybe it’s some kind of car-charge function.
Have a look at the linked post in my first answer again about how to split positive/negative charging power values into 2 template entities and use them with integration.
Ah, yes I see what you mean now. That post looks like its exactly what I can do with my sensor thats goes + and -.
Thanks I will give it a go when I get home. Cheers
Not sure. Does the battery_charge already have a value? Maybe it has to be >0 but doesn’t charge over night?
What does the developer-Tools → states page say?
its the one you are looking for, but has the wrong unit_of_measurement (% instead of kWh) - probably because you tried to do the integration (riemann) from a wrong entity first. I don’t know how to correct this - maybe just delete it and try new.
It comes from here:
the name key will be sluggified and used as entity name. Same for the sensor.battery_discharge entity.
Ah I see, well I think I do so far… Thats weird that sensor had % and not kWh. So I deleted that one and added a new one which I think cured it. Also had to swap around the 0 - in the value_template. Heres what I now have in developer tools.
Will now wait and see what comes up in the energy desktop in a few hours!
Also, thanks for all your work on the Fronius intergration, its a great help to everyone with a Fronius unit.
My next project is to figure out a way of dumping excess energy into a hot water element but being able to limit the load to how much spare solar energy we have. Sort of like a load controller.
Just trying to get this working also - have HA happy with the code and it is collecting values as seen in the states below, but when adding to the energy config I can only see the charge sensor and not the discharge.
It all looks ok to me, any ideas on what I’m missing?
EDIT: SOLVED! Discovered in the Developer Tools > Statistics that the sensor had a value mismatch. Hit fix error to change the data to the correct measurement and now I can see it in energy config.
I guess you also have grid, do you have 3 phase grid system and a meter ? If so could you share your modbus configuration for the grid i mean which registers are you reading to get grid in correctly especially when there is 3 phases.
hola estoy intentando usar su pntilla para crear los sensores de mis baterias para luegousarlos con la suma de riemman tengo un fronius 24 gen i un smart meter cuando creo la plantilla me sale este error
ValueError: Template error: float got invalid input ‘unknown’ when rendering template '- platform: template
podria orientarme a que es devido no tengo mucha experiencia en esto gracias