No, no noticeable difference.
I cannot update to HA 2020.12.0 as after update the values aren’t read anymore… must downgrade to ha 0.118
I’m using envoy metered Software Version:R4.10.35
Same Issue here
There was a bug in the library which has been fixed and merged. It appears it will be released with 2020.12.1
Though when it is released it won’t include the fixes that I have posted in this thread, that PR still has to be approved.
Can anyone confirm that the ‘current_energy_consumed’ is the sum of energy from all inputs? Grid, solar (and battery if you have one) and therefore total grid energy used is that figure - the figure from the current_energy_production sensor?
@Stubbs From what I’ve seen the Consumption data that is retrieved from the Envoy is the sum of all energy that is flowing into panel. Though there are two different configurations I have seen on Envoys, as you can read below.
EDIT: I found this document I guess the Consumption CTs can be installed differently which can effect what total means to your system. Enphase Consumption Monitoring
Net Consumption versus Total Consumption
....
• Net - If the solar production CT is installed on the load side of the consumption CTs, then you can leave the consumption meter set as Net.
• Total - If the solar array is line side connected or if the solar production CT is installed on a separate circuit from the consumption CTs, then select Total.
I don’t have an Envoy that supports Consumption but looking into the code and seeing what is returned by various Envoys from http://x.x.x.x/production.json I have seen two different data structures being returned. One structure was only one consumption value
{"production":[{"type":"inverters","wNow":59,"whLifetime":25137952.8325,"readingTime":1608318607,"activeCount":35},{"type":"eim","activeCount":1,"whLifetime":47578.252,"whLastSevenDays":351.252,"whToday":30.252,"wNow":-0.049,"rmsCurrent":0.28,"rmsVoltage":248.877,"reactPwr":0.899,"apprntPwr":34.795,"pwrFactor":-0.0,"readingTime":1608318607}],"consumption":[{"type":"eim","activeCount":0,"whLifetime":0,"whLastSevenDays":0,"whToday":0,"wNow":0,"varhLeadToday":0,"varhLagToday":0,"vahToday":0,"varhLeadLifetime":0,"varhLagLifetime":0,"vahLifetime":0,"rmsCurrent":0,"rmsVoltage":0,"reactPwr":0,"apprntPwr":0,"pwrFactor":0}]}
and another was two sets of values; total and net.
{"production":[{"type":"inverters","activeCount":26,"readingTime":1608317131,"wNow":6,"whLifetime":7998977},{"type":"eim","activeCount":0,"measurementType":"production","readingTime":1608317143,"wNow":0.0,"whLifetime":0.0,"varhLeadLifetime":0.0,"varhLagLifetime":0.0,"vahLifetime":0.0,"rmsCurrent":4.312,"rmsVoltage":242.022,"reactPwr":-506.461,"apprntPwr":521.678,"pwrFactor":0.0,"whToday":0.0,"whLastSevenDays":0.0,"vahToday":0.0,"varhLeadToday":0.0,"varhLagToday":0.0}],"consumption":[{"type":"eim","activeCount":0,"measurementType":"total-consumption","readingTime":1608317143,"wNow":0.0,"whLifetime":0.0,"varhLeadLifetime":0.0,"varhLagLifetime":0.0,"vahLifetime":0.0,"rmsCurrent":4.566,"rmsVoltage":242.05,"reactPwr":506.461,"apprntPwr":1105.183,"pwrFactor":0.0,"whToday":0.0,"whLastSevenDays":0.0,"vahToday":0.0,"varhLeadToday":0.0,"varhLagToday":0.0},{"type":"eim","activeCount":0,"measurementType":"net-consumption","readingTime":1608317143,"wNow":0.0,"whLifetime":0.0,"varhLeadLifetime":0.0,"varhLagLifetime":0.0,"vahLifetime":0.0,"rmsCurrent":0.254,"rmsVoltage":242.077,"reactPwr":0.0,"apprntPwr":30.767,"pwrFactor":0.0,"whToday":0,"whLastSevenDays":0,"vahToday":0,"varhLeadToday":0,"varhLagToday":0}],"storage":[{"type":"acb","activeCount":0,"readingTime":0,"wNow":0,"whNow":0,"state":"idle"}]}
I don’t know if the difference is configuration, hardware, or firmware. On your Envoy if you open a browser to the URL I mentioned above (replacing x.x.x.x with your IP Address) you will see the data being returned. If you have two Consumption parts then they should have a measurementType
of total-consumption
for the first and net-consumption
for the second. Though if you only have one Consumption section then I do not know if it’s total or net, but it would be helpful to let me know what if it’s total or net in your installation. To easily read JSON data, I copy and paste it into http://jsonviewer.stack.hu/
I have seen a request to have the integration in Home Assistant give total and net consumption data. That is being worked on in an indirect way, moving the setup and configuration from text configuration (configuration.yaml) to the Home Assistant UI (Config Flow) which should give the user the option to select what conditions they want to monitor.
I know long answer!
One more update, hopefully the last one. Than PR #42857 should be approved and merged maybe at some point after the holidays.
The change made should be background operations and no functional change. It was to make sure no HTTP requests were made when updating Home Assistant entity info. The only HTTP requests that should be made are in different methods
The updated files are located here: sensor.py and manifest.json
Last changes working fine here.
Looking at my production.json I’m getting both total & net, I guess I need to wait for daylight to go & see if I can work out what the CTs are attached to.
Just wanted to give an update on the progress of the changes.
The main PR #42857 as well PR #44600 have been merged into the dev branch in Home Assistant. I don’t know when they will get released, but I suspect being so close to the 2021.1 release, that it probably won’t be until the 2021.2 release. The changes will be released in the 2021.1 release.
PR #42857 - Reduces HTTP calls made to the Envoy devices
PR #44600 - Fixes an issue seen when retrieving inverter data from firmware <3.9 that don’t support inverter data gathering
The updated files are located at sensor.py and manifest.json
Just installed this. Awesome work. I’ve been wanting to get my inverter data into HA for a while now, but haven’t been bothered to do anything about it. I’m currently using REST sensors to get the data on production, total consumption, and net consumption.
I noticed some chat above about the net consumption data. So, this is being worked on, and will be available when it’s merged for the next release?
@cjsimmons Thank you!
The next step is to migrate from the configuration.yaml to Configuration Flow UI configuration. Once that is done than adding new sensors such as net consumption, 3phase info, battery info, etc… shouldn’t be too hard as long as the data is available from the Envoy device.
I was hoping to have something for the Configuration Flow by next weekend.
No worries. Keep up the good work. Good to see someone updating the Enphase intergration. I haven’t ever used it and just used REST sensors. Your update seems to be doing a good job over the last few hours.
Sorry for such a rookie question…but I’m a rookie…where do I paste this code? I’d much rather read my envoy data in kW. Thank you.
@robschwandt No problem! Paste the code into your configuration.yaml. Then from Home Assistant >> Configuration >> Server Controls click on the button to make sure your yaml file is valid. Than restart the server and you’ll have a sensor with kW.
So I have the standard code from the home assistant page for envoy(ip address and the variables I want to track). So delete all that and paste this instead?
Oh no. No this is in addition. What you are doing is creating another sensor using a template.
If your configuration.yaml
file does not have a sensor:
section you can paste it at the bottom of your file.
If you do have a sensor:
section than you’ll have to paste in that area omitting sensor:
as your file already has it
Just tried it…this is what happens when I check the yaml:
Here’s my whole yaml file:
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
#sensors
sensor:
- platform: enphase_envoy
ip_address: 192.168.86.187
monitored_conditions:
- production
- daily_production
- consumption
- daily_consumption
- platform: template
sensors:
envoy_current_energy_production_kw:
friendly_name_template: 'Envoy Current Energy Production (kW)'
unit_of_measurement: 'kW'
value_template: "{{ (states('sensor.envoy_current_energy_production')| float / 1000| round(2)) }} "
I think the spacing is a bit off, sensors
and the rest below looks to be indented a few spaces too much. Should be like this
- platform: template
sensors:
envoy_current_energy_production_kw:
friendly_name_template: 'Envoy Current Energy Production (kW)'
unit_of_measurement: 'kW'
value_template: "{{ (states('sensor.envoy_current_energy_production')| float / 1000| round(2)) }}"
EDIT: My original post had spacing issues too. Fixed now!
It worked! And now I’ve learned spacing is important! Thank you.