home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.99k stars 29.07k forks source link

Enphase Envoy does not show battery switch (charging ON/OFF) (or total charge / discharge energy) #121159

Open NCO3 opened 2 weeks ago

NCO3 commented 2 weeks ago

The problem

I am using an 3-phase Enphase Solar system with 16 panels, Production and Consumption CTs plus 2 pcs 3T batteries. According to the documentation above I should be able to activate / deactivate charging the batteries. However, there is no switch at all at the Envoy (IQ Gateway).

What version of Home Assistant Core has the issue?

core-2024.7.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Enphase

Link to integration documentation on our website

https://www.home-assistant.io/integrations/enphase_envoy/

Diagnostics information

enphase.json

Example YAML snippet

No response

Anything in the logs that might be useful for us?

In the diagnostics I can see that there is an option to install CTs for storage:
"ct_consumption_meter": "net-consumption",
"ct_production_meter": "production",
"ct_storage_meter": null

Obviously I don't have the latter ones.
However, I can see the current Power going into / from the batteries:
encharge_xxx_leistung (Leistung = Power in German)

This does not have anything to do with the fact that I don't see a switch to enable / disable the battery charging (I guess ;-)

Additional information

No response

home-assistant[bot] commented 2 weeks ago

Hey there @bdraco, @cgarwood, @dgomes, @joostlek, @catsmanac, mind taking a look at this issue as it has been labeled with an integration (enphase_envoy) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `enphase_envoy` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign enphase_envoy` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


enphase_envoy documentation enphase_envoy source (message by IssueLinks)

catsmanac commented 2 weeks ago

Hi @NCO3, when batteries are configured there should be a charge from grid / einspeizen from netz (or probably some better German translation) switch. In the diagnostics I see encharge and tariff enabled, which are required for these switches, but the diagnostic file does not include all enphase_envoy information it typically collects. I'll respect if you don't want to share that info, but it will help in deducting what is going on.

Have you checked if the switches are hidden for some reason?

The storage CT is indeed unrelated to this.

NCO3 commented 2 weeks ago

Thanks @catsmanac for the lightning fast response.

Of course I can share the complete diagnostic file unless there is critical data in there (I basically don't know, but passwords seem to be removed). There seem to be serial numbers in the file, but I don't know if it's safe to share those.

Anyway: I checked the hidden / disabled entities, but a switch is not amongst them. It's mainly about various sensors for the three phases.

I assume the battery charge switch belongs to the Envoy (Gateway)? The only Battery related entities are:

I also have separate enties in the battery devices themselves - mainly:

catsmanac commented 2 weeks ago

The battery entities are as expected, looking if the switch is to be expected or not. Originally an Enpower smart switch was expected but these are not installed in EU countries. There was a recent change for this, but need to check if it made 2024.7.

As for the diagnostics, all sensitive info is removed. The serials left are are not important. At the top of the file maybe info about other integrations, those you can remove, only need the envoy information to the end of the file.

  "integration_manifest": {
    "domain": "enphase_envoy",
    "name": "Enphase Envoy",
catsmanac commented 2 weeks ago

Looks like that change made it into 2024.7, which you are using. Need to investigate what is going on with it. The very minimum of the diagnostic file I need for that would be the "raw_data": section. That contains all the data as returned by the Envoy right before the report was created.

NCO3 commented 2 weeks ago

Again, thank you for your help @catsmanac I have attached the file as requested. Please let me know if there is anything else you need. enphase.json

catsmanac commented 2 weeks ago

Thanks @NCO3, I'll have a look.

catsmanac commented 2 weeks ago

These switches and selectors not showing is because they are tight to the ENPOWER device which is used in the US but not in EU countries. Need to see if we can find a workaround for this as batteries in this configuration will be common practice.

cgarwood commented 2 weeks ago

@NCO3 In the Enphase Enlighten app, do you have the capability to change your battery profile? (Full backup/Self Consumption/etc) and/or an option for Storm Guard?

Also, in the Enphase app, if you go to Menu -> Settings -> Battery is there an option for "Charge battery from Grid" that you can enable/disable?

Some of the battery capabilities may not be possible without the Enpower/iQ System Controller.

NCO3 commented 2 weeks ago

Good morning, Unfortunately, I can see the profile in the app but I cannot change it. Is this maybe related to the kind of account? Is it possible that our installer has a kind of admin account and I am just a regular user so far?

The same applies to the battery if I go to Settings -> system -> Devices-> Battery I don’t see an option to activate the charging from grid. 😫

according to the enphase community, it’s not possible/allowed in Germany to charge from grid. I guess that’s why 🥲

catsmanac commented 1 week ago

Over here in the Netherlands I think it is allowed as the battery is advocated to use with dynamic energy contracts and even use it for trading on the energy market. IQ Energy Management BUT ... as I understand it how Enphase implements this is (of course) through their cloud, connecting to the announced prices and so. Not sure if it can be done locally. They might use the existing Tarif structure and download ahead of the announced prices.

@NCO3, yes the installer will have admin privileges while you have the home-owner account with less options. One can get DIY/Installer accounts as there are suppliers that sell the equipment for DIY installs along with guidelines. Your installer might be willing to help upgrade your account.

https://www4.enphase.com/en-au/support/how-do-i-register-system-enlighten

NCO3 commented 1 week ago

Thank you for the explanation - Good to know. Actually the installer is a Dutch company (Soly) and it comes with a dynamic power supplier contract from Berlin (Ostrom). So I guess it must be possible somehow.

The contractor who did the installation for Soly was from my area and an extremely good choice. I guess I can work on getting extra access from them :-)

cheers from Hamburg

catsmanac commented 1 week ago

As I read the info, it will be working, but it's controlled by the Enphase App when enabled. Your local contractor probably can give you some background if and how to enable/disable this.

So this leaves the question if it even can be controlled locally as it might be overridden right away from the Enphase cloud application. It would require experimenting with it and that's not something you want to do on a production installation.

There is a custom integration for enphase that supports installer accounts features talking on charge from grid, https://github.com/vincentwolsink/home_assistant_enphase_envoy_installer/issues/129, but not sure if that includes this IQ Energy Management.

Titiokk commented 1 week ago

Hello from Luxembourg,

I noticed he same issue as NC03, although I am not so interested in switching on/off charging from grid. However, I am very interested in having power going in/coming out of battery to appear in Home Assistant in the energy tab. But the sensors do not seem to appear either. Enphase app displays this information in the home-user app so information should be available through API ?

Please let me know if I need to share my diagnostic as well. Appreciate the time you take in helping the community.

NCO3 commented 1 week ago

Thanks for sharing - I will take a look at it and check with my installer

So this leaves the question if it even can be controlled locally as it might be overridden right away from the Enphase cloud

If I understand the Enphase integration correctly, the cloud connection is currently used just for the user verification and token creation. But I would be also ok with doing everything through the cloud if this is possible. If that's the price for being able to control the batterie to be charged it's worth it from my point of view.

NCO3 commented 1 week ago

Hi @Titiokk I have the same issue on my system. The single 3T batteries have entities reporting the current power going to (negative W) of coming from the batterie (positive W). As I have two 3Ts I created a SUM entity to get the total Watts coming from / going to the battery. I then use this SUM for a Riemann left entity for ma energy dashboard. See here for instance: https://community.home-assistant.io/t/howto-fronius-integration-with-battery-into-energy-dashboard/376329

catsmanac commented 1 week ago

Thanks for sharing - I will take a look at it and check with my installer

So this leaves the question if it even can be controlled locally as it might be overridden right away from the Enphase cloud

If I understand the Enphase integration correctly, the cloud connection is currently used just for the user verification and token creation. But I would be also ok with doing everything through the cloud if this is possible. If that's the price for being able to control the batterie to be charged it's worth it from my point of view.

The Enphase integration only uses the cloud part when a new token is needed, which is when the integration is added to HA and then 1/year when the token is 1 month prior to expiration and it will refresh it.

There is an Enphase cloud API that can be used, but Enphase requires payments from an application developer based on how often the API is used. And if this would be used you can as well use the Enlighten native app and their features.

catsmanac commented 1 week ago

Hello from Luxembourg,

I noticed he same issue as NC03, although I am not so interested in switching on/off charging from grid. However, I am very interested in having power going in/coming out of battery to appear in Home Assistant in the energy tab. But the sensors do not seem to appear either. Enphase app displays this information in the home-user app so information should be available through API ?

Please let me know if I need to share my diagnostic as well. Appreciate the time you take in helping the community.

Hi @Titiokk, without a storage Current transformer there is no direct way to get the value for energy in/out the battery. As @NCO3 describes you can use the real_power_mw of the batteries with a Riemann integrator to calculate energy.

Another option is to use change in SOC or BateryCapacity to calculate energy in/out. Any negative change is discharge and other way around. But you'll need to create some templates for these.

catsmanac commented 1 week ago

@NCO3

it comes with a dynamic power supplier contract

I've seen some Dutch announcements on YT where they mentioned the updated installer tool has options to enable it in the Envoy, if not yet.

If you manage to have it enabled then it might be visible in the diagnostic file in the "/admin/lib/tariff" section if that is used for this. In the file you send it still says

            "storage_settings": {
              "mode": "self-consumption",
              "operation_mode_sub_type": null,
              "reserved_soc": 0.0,
              "very_low_soc": 5,
              "charge_from_grid": false,
Titiokk commented 1 week ago

@NCO3 @catsmanac Thank you for your feedbacks. My electrician installed measuring toroid linked to the battery and I have the information shown in Enphase app. However, I do not have « Envoy Lifetime battery energy charged/discharged » entities as described in HA Enphase integration. The only thing I can see showing electricity input/output is the « power » entity from the battery.

image

It shows positive and negative diagram, which I guess represent charging/discharging status.

image

Is this what I should use with a Riemann integrator? I tried to change HA language to English but my entities are still in French. :(

catsmanac commented 1 week ago

@Titiokk

However, I do not have « Envoy Lifetime battery energy charged/discharged » entities as described in HA Enphase integration.

To evaluate if this is ok or not that I would need the diagnostic file.

It shows positive and negative diagram, which I guess represent charging/discharging status.

Yes that's the one. You should calculate 1 variable for positive changes and 1 for negative changes. The link that @NCO3 provides shows how to do this. Then build 2 Riemann, one for the positive and one for the negative one and use these for the energy dashboard.

catsmanac commented 1 week ago

My electrician installed measuring toroid linked to the battery

When you open in the diagnostic file look for below section that reports how many and which Current Transformers are known to the Envoy.

      "ct_count": 0,
      "ct_consumption_meter": null,
      "ct_production_meter": null,
      "ct_storage_meter": null
Titiokk commented 1 week ago

Good morning @catsmanac Here is my diagnostic file. config_entry-enphase_envoy-77567f37221d9d5db5b57b5bb55fa46c.json Ct_storage_meter is null, I have the other two.

catsmanac commented 1 week ago

Yes I see it @Titiokk, you have CT for solar production and net-consumption (to/from grid). There is no CT on the battery, so no Charge/Discharge Battery Energy counter, only the Power as mentioned above.

Another thing with multi-phase consumption CT and batteries is net consumption values (Lifetime NET consumption / Production) may show wrong data.

When the house needs more power then the battery can provide on one phase, the battery will export energy to the grid on another phase while the house pulls from the grid on the phase it needs the power. That's because the battery can not send power across phases, so it uses the grid as a 'transfer mechanism'. Your smart grid meter from the electricity company probably will balance these values. At least they do it here in the Netherlands with the DSMR smart meter. But Enphase doesn't do that and it will include the exported on one phase and imported on the other one.

I think Luxembourg uses DSMR as well. These can be connected to HA also and if you have that option, better use the values from DSMR for grid import/export in the Energy dashboard.

Otherwise you need to add some calculations to correct for this 'feature'. If you sum Grid Import and Grid Export it will eliminate this effect. But the sum will be going up and down and can't be used with the Energy dashboard. So now you need to make another calculation to get them again into corrected import and export variables.

Hope I don't confuse you too much and if needed can help you on on what is needed, if you detect mismatches on grid import/export between HA en Enlighten app. As said, if you have the option consider connecting the DSMR to HA.

Titiokk commented 1 week ago

Thank you @catsmanac, I learned something today. :) I have P1 meter from HomeWizard (similar to DSMR) and indeed I noticed some slight differences between HA and Enphase for import/export measures.

Ok so now I have to understand this Riemann and get to work. lol

EDIT: I managed to create 2 Riemann charging/discharging following fronius link. However, those are only helpers and I cannot figure out how to make one count positive and one negative. Examples from fronius rely on template coming complete integration but I am worried it will break my Enphase integration. Should I create myself 2 templates following coding examples from fronius, you think?

NCO3 commented 1 week ago

@Titiokk:

I cannot figure out how to make one count positive and one negative

You first need to create two helpers: One for discharging and one for charging. Use a template for this with this template: Charging: {{ states('sensor.solar_batterie_1_2_akt_w') | int *-1 if states('sensor.solar_batterie_1_2_akt_w') | int < 0 else 0 }} Discharging: {{ states('sensor.solar_batterie_1_2_akt_w') | int *1 if states('sensor.solar_batterie_1_2_akt_w') | int > 0 else 0 }}

from these you need to create two Riemann integrals to get the kWh from the W (the two template sensors above)