I was asked on reddit to post my solution to integrate a fronius inverter into HA.
First of all a disclaimer: it’s not exactely an elegant solution, i frankensteined it together in one or two hours.
In the fronius there is an option to upload data to an ftp server.
i put the following php files in the same folder as the json file from fronius.
the /1000 in the value template brings the units into kWh but i cant seem to be able to round the figure to 2 decimal places (eg 1234.56), tried converting to an integer as above but that doesn’t seem to want to play nice either
i didn’t even know that there was an “inbuild api” in the converte. seems to be the more elegant solution.
as to the formating, you have to convert to something like float or double (you could probably even use dec?) otherwise it wont show any decimal places
Yup, go thtat working now, next iteration is to have a scrape tool that will pull the latest figure off the supplier’s website then feeds that into the calculations.
i have most of the outlets at the back of the house monitored now so need to group them into rooms etc so that stats can be logically arranged.
Is there a way for the group to total the figures output to that group? like the switch groups will switch every member of that group. For easy visual reference i’ll look at a limit of consumption per room and then get something to colour a background to show if it’s high or low
Thanks Radebe2k.
I am using this, however if there is no sun, the inverter switches off and I get a lot of errors in my logging. Any ideas to make it more elegant?
Thanks tommi, that might help.
I am currently going a different route, and I am writing a custom sensor for it. But need to learn more about the internal of home assistant first.
There is a night mode setting you can turn on in the Inverter’s display settings (I have the Primo. Maybe not available in all of the inverter models?)
Maybe wrong place to ask, but what’s up with “Fronius symo component” https://github.com/home-assistant/home-assistant/pull/8931
“status” is “closed” ? is it integrated already or not ? that can be gamechanger as I’m also with Fronius Symo here.
After you have this you should add the component to yor sensors
- platform: fronius
host: xxx.xxx.xxx.xxx # ip address of your inverter
type: inverter
device: 1
scope: device
Than there should be a sensor available called sensor.fronius_inverter_192xxxxxxxxx_1 Where the number (192xxxxxxxxx) is the IP address of the inverter without dots.Using templates you should then be able to access all the data from the inverter.
- platform: template
sensors:
electricity_inverter1_power_netto:
unit_of_measurement: 'W'
value_template: >-
{% if states.sensor.fronius_inverter_192178XXXXXX_1.attributes.power_ac is defined %}
{{ states.sensor.fronius_inverter_192178XXXXXX_1.attributes.power_ac | float | round(2) }}
{% else %}
0
{% endif %}
Somehow this does not work for me anymore, but it is supposed to work like that.