The energy integration calculations run once an hour, in arrears. It’s designed to show you how you use (and produce) energy over a long period, and not an instantaneous reading.
The envoy system is more frequent (once every 5 minutes I believe).
Who knows whether they’ll speed it up. I’d prefer 15 minute calculations, but I don’t know what they plan.
“On this build since release” doesn’t mean enabling the energy integration and setting up the required sensors.
I’ve made some modifications to my python script today to display data in real-time at least once per second without the overhead of running json-server nor any requirement to write to disk like my previous program.
The Python script now runs as a daemon and takes the output from http://envoy.local/stream/meter and extracts Power, Voltage, Frequency and Power Factor - it then publishes it as a single Topic directly to a mqtt broker on my HA and loops around indefinitely.
It’s then super simple to create sensors from the mqtt topic created.
In the coming days I plan to publish it on github so others can benefit. It can be used for the Energy Dashboard or to drive Real-time displays that update once per second such as these two cards:
I’d definitely be interested in this as well. The current process is pretty accurate for me (usually within .1kWh of what my power supplier reports on their billing portal) but always better to have real real time use.
Amazing!
I now have live stats updating every second.
I cannot believe what I used to rely on for ‘realtime’ solar stats before I discovered home assistant.
It was nowhere near what I have now!
Thank you very much @vk2him. I am enjoying the benefit of your hard work and cannot thank you enough.
I did make sure to exempt the new sensors from recorder.
I might turn that on later, but just interested in live figures for now.
No problems at all - how do you exclude the sensor from recorder?
FYI - I stumbled upon a concerning post that mentions Enphase have released a new Envoy firmware that removes the installer username/password - I wonder if it’s a response to the original people who decoded the password?
Seems Enphase or the Installation company updated the Envoy without letting the owners know and they are furious as their integrations no longer work. I just checked my Envoy and it says there is an update available - I’m not going to update but I wonder in Enphase might be able to 'force" it?
Also - have you tried the Power Wheel card which displays power/production in real time using those mqtt sensors? Heres my card setup and what it looks like:
If you setup the mqqt sensors using the instructions in the github repo - use these sensors in the Power card (you need to load Power Wheel Card from HACS first)
I have not tried the power wheel yet.
Hope to get around to it soon.
I quickly knocked up a card for an old smartphone on a stand to show all the time.
So I followed the tutorial, thanks! Whenever I try to put in the grid consumption, it only shows the one from the Envoy, not the sensor that was put into the configuration.yaml.
I have been trying to get this to work for a few days. I have an Enphase Envoy X-IQ-AM1-240-3-ES with 25 Microinverters IQ7+ and all show in Home Assistant. I installed the Envoy integration. Everything is working but energy consumption. I can’t see that sensor in the energy configuration. I can see Exported Energy but I cannot see Imported Energy. Any advice would be awesome I don’ know what else to try.
Here is my configuration.yaml
# 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
template:
- sensor:
name: solar_export_value
state_class: measurement
icon: mdi:solar-panel
unit_of_measurement: "W"
device_class: power
state: >
{% set value = (('%0.1f' | format(states('sensor.envoy_current_power_production') | float - states('sensor.envoy_current_power_consumption') | float)) | float) %}
{% if value <= 0 -%}
0
{%- else -%}
{{ value | round(2) }}
{%- endif %}
- sensor:
name: house_consumption_value
state_class: measurement
icon: mdi:transmission-tower
unit_of_measurement: "W"
device_class: power
state: >
{% set value = (('%0.1f' | format(states('sensor.envoy_current_power_consumption') | float - states('sensor.envoy_current_power_production') | float)) | float) %}
{% if value <= 0 -%}
0
{%- else -%}
{{ value | round(2) }}
{%- endif %}
- sensor:
name: Grid Import Power
state_class: measurement
icon: mdi:transmission-tower
unit_of_measurement: W
device_class: power
state: >
{{ [0, states('sensor.envoy_current_power_consumption') | int - states('sensor.envoy_current_power_production') | int ] | max }}
sensor:
- platform: integration
source: sensor.house_consumption_value
name: Imported Energy
unit_prefix: k
round: 2
method: left
- platform: integration
source: sensor.solar_export_value
name: Exported Energy
unit_prefix: k
round: 2
method: left
- platform: integration
name: Grid Import Energy
source: sensor.grid_import_power
unit_prefix: k
unit_time: h
homeassistant:
customize: !include customize.yaml
I removed pretty much everything just to try and make sure nothing was causing an issue.
Exported Energy has the following attributes:
state_class: total_increasing
source: sensor.solar_export_value
unit_of_measurement: kWh
friendly_name: Exported Energy
icon: mdi:chart-histogram
device_class: energy
Imported Energy has the same attributes:
state_class: total_increasing
source: sensor.house_consumption_value
unit_of_measurement: kWh
friendly_name: Imported Energy
icon: mdi:chart-histogram
device_class: energy
They both have values in the State column. When I go to energy configuration all I see are the following options.
Envoy Lifetime Energy Consumption
Envoy Lifetime Energy Production
Exported Energy
Just upgraded 2021.9.4 and that also didn’t help with the issue.