I’ve setup the new sensors using the REST endpoints. When I check the entities all the data is displayed right as expected. Sadly I can’t setup those new sensors as data inputs for the Energy dashboard. I can’t find them there.
Do I have to setup additional helper sensors that accumulate the sensor readings? I read something about this in some other approach.
Yeah, sorry, my bad. It’s the problem of the DIY and not using a fully build integration The one retrieved by the API are the power values only (W). You need to convert the proper ones to Energy values (Wh, via platform/integration) to be able to pick 'em up in the Energy Dashboard, something like this
sensor:
- platform: integration
source: sensor.generation_to_battery
name: battery_charge_energy
unique_id: battery_charge_energy
unit_prefix: k
round: 2
method: left
- platform: integration
source: sensor.battery_to_house
name: battery_discharge_energy
unique_id: battery_discharge_energy
unit_prefix: k
round: 2
method: left
- platform: integration
source: sensor.generation_to_grid
name: injected_energy
unique_id: injected_energy
unit_prefix: k
round: 2
method: left
- platform: integration
source: sensor.grid_to_house
name: imported_energy
unique_id: imported_energy
unit_prefix: k
round: 2
method: left
- platform: integration
source: sensor.generation_instant_output
name: overall_solar_energy
unique_id: overall_solar_energy
unit_prefix: k
round: 2
method: left
- platform: integration
source: sensor.generation_to_house
name: autoconsumed_energy
unique_id: autoconsumed_energy
unit_prefix: k
round: 2
method: left
The examples you provided don’t seem to work for me to calculate battery discharge and charge values correctly. I did find out that sensor.battery_instant_power_flow from your example, which uses PBat from the JSON source, is basically what I need.
The value is negative when discharging from battery and charging when it’s positive.
I just can’t wrap my head around how to write a riemann sum for this to integrate that into the energy dashboard.
PBat as you say is positive when charging and negative while discharging. Given that we are speaking of power and not energy you need to create 2 different sensors derived from PBat,
one that is positive while charging and null while discharging
one that is positive (absolute) while discharging and null while charging
and that is exactly what the template definition in my configuration.yaml do (brutally copied from @monkeypr00f Nodered Flow).
Having these “rectified” values you can now do a simple integral/reimann sum and derive energy values.
Hey, sorry it took a while for me to answer. Was busy with some stuff.
I just want to share how I got it working in my case. I use the REST API to create two sensors for my battery for incoming and outgoing power. As for solar energy production, I use the before used sunspec integration and simply created a riemann sum helper sensor.
If you read more carefully the readme in the repo, my integration is based on the SunSpec register map, so it requires a VSN300/VSN700 card in the inverter. Those cards translate the Aurora native protocol in SunSpec, they act as protocol gateways.
If you want to use your Elfin, you will need to use the native ABB integration, but it will only provide you with one sensor, the production.
I would advise you to purchase the VSN300 card, first check if your inverter supports it.
thanks, the native abb integration, The only one i found is for a cable configuration. I don’t know if there is one for elfin ew11 wifi. The vsn300 card is more expencive for a old inverter…
elfin ew11 15 euro…
I don’t spend that money In a old installation (up 16 years old)
may be 4 years and I change all my photovoltaic system
…naturally if i could to configurate one or any sensor with my ew11 i’m satisfied…
Im not an expert like Alessandro, but if I googled correctly ew11 is nothing more than a rs485 to wifi adapter. It exposes quite a lot of protocols, but basically you should be able to connect to it via modbus native integration.
see here for the basics:
Obviously you must adapt the code to reflect you inverter register map, not thesimplest thing in the world but doable if you find the inverter manual/register map with addresses.
In this way you should be able to gather all the metrics your inverter exposes over RS485.
I think it’s what i did. or rather, what I tried to do.
unfortunately all the sensors created do not give values or rather “values not available”
so, I definitely did something wrong. At a certain point I thought that maybe that configuration might not work with my inverter.
finally, contrary to what you think, I am very ignorant on the subject. In Italy they say: I’m groping in the dark. Thank you for your reply.
I’m very sorry for the late reply, I missed completely your question.
Yes it could be, I don’t hav your inverter so I cannot be sure.
Please note that in the table you showed the addresses are offset in respect a fixed Base Address. In my case that base address is 40000, don’t know in your case.
Having these values you can start compiling the config file for HA, see this:
Where
INVERTER_IP_ADDRESS
is the IP of your EW11, and the addresses ( address: 4xxxx)
Is the sum of the base Address (try with 40000 first) and the offset from the table
For the DataType you need to match the values smallint and single to the datatypes available in HA (Modbus - Home Assistant)
Hi, is there a way to calculate the total energy daily produced? Right now there is only the total energy from installation sensor.abb_inverter_total_energy .
ABB VSN 300
Thanks a lot,
Lorenzo
utility_meter:
total_energy_production:
name: Total Energy Production
source: sensor.elios4you_produced_energy
hourly_energy_production:
name: Hourly Energy Production
source: sensor.elios4you_produced_energy
cycle: hourly
daily_energy_production:
name: Daily Energy Production
source: sensor.elios4you_produced_energy
cycle: daily
weekly_energy_production:
name: Weekly Energy Production
source: sensor.elios4you_produced_energy
cycle: weekly
monthly_energy_production:
name: Monthly Energy Production
source: sensor.elios4you_produced_energy
cycle: monthly
yearly_energy_production:
name: Yearly Energy Production
source: sensor.elios4you_produced_energy
cycle: yearly