Thanks!
You are welcome to use my stuff on your site as you see fit. I once had an idea of cleaning up my package file and posting it somewhere for others to look at. But I do not have time to publish anything myself apart from the activity here. So go ahead…and I will see what I can borrow from you when it’s published on your site
This just enables the creation of 10 new sensors that are read from the “meter” API in the inverter.
smartmeter: true
And when that is done I just use them in lovelace right now. It’s just so I can see them. I haven’t yet thought about if/how to use them in a better way.
The smartmeter stuff has been merged to master. But it is still not in a release. I think @safepay wants some positive feedback before making a release. So if you want to try it out you can do a manual clone from github, replace your version from HACS, and try it out. And if it works for you you can post back here or in the pull-request that it works fine.
When you configure the smartmeter you may need to specify also the smartmeter_device_id depending on your setup. I think it will always be 0 in a fresh setup with only one meter. But I have no proof as I have only looked at my own setup.
But try first with only the first line. If your new sensors show up with valid values you are all set. If not then you can use this URL and check with device id your smartmeter has.
I realized after the patch was merged that two of the sensors are redundant and could be removed.
The “Energy AC Absolute Plus/Minus” returns the same as “Energy AC Consumed/Sold” and “Consumed/Sold” is more user friendly. So I think I will push an update to remove them before @safepay makes a new release.
Too bad that Fronius cannot document the true meaning of all the values that the API returns. Some are obvious, but some are hard to understand or doesn’t mank much sense.
I’ve manually updated sensor.py from @safepay’s github and added the following lines under my fronius integration but the smartmeter sensor is not appearing. Any idea?
smartmeter: True
smartmeter_device_id: 0
Did you restart HASS after replacing the sensor.py and updating the configuration?
If you did restart HASS can you open this URL in your browser (replace “ip_address” with the IP of your Fronius Inverter) and post the response you got?
It could be that the smartmeter_device_id is not 0.
I got it to show up now. For some reason I had to add the sensors to
monitored_conditions:
- smartmeter_current_ac_phase_one
- smartmeter_current_ac_phase_two
- smartmeter_current_ac_phase_three
- smartmeter_voltage_ac_phase_one
- smartmeter_voltage_ac_phase_two
- smartmeter_voltage_ac_phase_three
- smartmeter_energy_ac_absolute_plus
- smartmeter_energy_ac_absolute_minus
- smartmeter_energy_ac_consumed
- smartmeter_energy_ac_sold
They show the total amount of energy consumed/sold since the smartmeter was installed into your house. If you want it to display what is consumed/sold today then you need custom sensors. Take a look at the package file I posted a link to recently. There you can see how I have created sensors for that.
Looks like you have your energy unit set to “Wh” and not “kWh” so the input to those two sensors are 1000 times too high. If you do not use the same units as I have in my package file for the fronius integration then you need to adjust your other sensors accordingly.
Afaik the utility meter doesn’t support “unit_of_measurment”, at least it’s not documented. It uses the source sensor unit. If you want the same result as I have then compare your file with mine and look for what is different. Something is not like I have it because my bought and sold sensors works as expected. But yours are 1000 times too big.
Are you using the latest version of the integration? If not then there is a problem that it doesn’t convert the units correctly.
The energy_used_hour originates from fronius_house_load. The fronius_house_load sensor will be in W if it is setup as in my package. It is then fed into the current_consumed_positive template sensor that just converts it into a positive value since house load is negative. The current_consumed_positive is fed into the integration sensor energy_used_hour that converts it into energy in kWh.
# convert house power consumption to energy
- platform: integration
source: sensor.current_consumed_positive
name: energy_used_hour
unit_prefix: k
unit_time: h
round: 2
method: left
power_units: ‘W’ <- This determines the fronius_house_load sensor to be in W right?
I’ve used all the codes in your package but not sure why the figures are incorrect.
I checked the sensor state and they are already set to kWh.
Yes, based on what you have shown here it should be ok. Yet it looks like your consumed/sold from the smartmeter is 1000 times too high.
It could also be something with the utility meter. Have you looked at the history graph for the two sensors grid_sold_energy_day and grid_consumed_energy_day and checked if they are reset to zero every night?
When I upgraded HA from 0.103.* to 0.106.* the utility meter “broke” some of my utility sensor at every restart of HA. It applied the current state on top of the current state so I got totally wrong values. That said, it has been stable for me since I updated HA to the latest 0.106.* version.
Could you check what your smartmeter actually reports?
Open this URL, replace ip_address with your inverters IP. You should see those values there and you can compare them with what you see in HA.
Hmm, so something weird is happening with the utility sensors for consumed/sold then
That sensor is supposed to add the difference between each reading to the sensor. And apart from the glitches I had during a couple of upgrades they have been working flawlessly for me.
It could be that there are some bad readings that trips the sensor off. Do you keep your inverter in logging mode 24/7 or does it shut off during night?