vincentwolsink / home_assistant_enphase_envoy_installer

This is a HACS custom integration for Enphase Envoys with firmware version 7 and up.
Apache License 2.0
54 stars 10 forks source link

Abilty to set a Grid Profile #95

Closed brodykenrick closed 8 months ago

brodykenrick commented 8 months ago

Describe the feature With the installer or DIY installer permissions it would possible to set a "grid profile" (after adding options for those grid profiles in the installer app).

This is useful for setting a variety of aspects of a grid profile. One setting of particular usefulness is the "power export limit" setting that limits the amount of power the enphase system will export back to the grid (by limiting generation). For enphase system users exposed to export charges or negative pricing at some times then the abilty to switch between two grid profiles is useful (to reduce costs from unwanted power in the grid and to help grid stabilty).

Further details for this use case, present to many enphase systems in Australia, see a Ruby tool with the functionality for dynamically setting an appropriate grid profile at https://github.com/ZimbiX/amber-enphase-zero-export-switcher-tool#readme .

The URL/endpoint is (similar to power production):

"#{base_url}/installer/agf/set_profile.json"

The request takes the form:

http.put(set_grid_profile_url, json: { selected_profile: name })

Where selected_profile is one of two profiles of setup on this particular gateway for enabling or limiting power export. e.g.

AS/NZS 4777.2: 2020 Australia A Region 5 kW Export Limit:1.2.2 AS/NZS 4777.2: 2020 Australia A Region 0 kW Export Limit:1.2.2

As the profiles are only valid for the local setup then some configuration of the profiles would be required for each home assistant/enphase instance.

This feature might be good to have something like a on/off limit_profile option (like for the power production) and a way to configure an on_profile and an off_profile (i.e. setting the two grid profile names in the user insterface for the custom component).

An alternative might be to support a callable service for set_profile so that control is handed back to the user and they can customise and call a service provided by this custom_component from other scripts on their HA system (triggered on appropriate events).

Account type

Envoy

vincentwolsink commented 8 months ago

Hi @brodykenrick. Thanks for the suggestion and information. I agree this will be a nice to have feature and will take a look at it as soon I have some spare time 🙂

vincentwolsink commented 8 months ago

I implemented services to get/set profiles and an extra sensor in 0.3.5-beta1. Please let me know if this works for you.

brodykenrick commented 8 months ago

Thanks! I'll test this weekend.

brodykenrick commented 8 months ago

@vincentwolsink It works amazingly well (all confirmed in just a few minutes). Thankyou!

Working profile changes

The "get grid profile" service returned all my configured profiles and copying the desired profile text in to the "set grid profile" service also worked smoothly (there is a slight pause as it was waiting to be confirmed accepted - as you would expect).

I think there is a slight caching period in the "get grid profile" service call (or in the enphase gateway?) as the old selected profile was returned for about 30 seconds after the change was made.

Thanks again. Let me know if you'd like any documentation updates done or anything else.

brodykenrick commented 8 months ago

@vincentwolsink Do you have a buymeacoffee account or similar? As I'd love to buy you a coffee/beer/plant to say thanks for this feature that is going to be very helpful to me and other home assistant/enphase users in Australia (and no doubt in many other places also).

vincentwolsink commented 8 months ago

Great to hear! I added an extra refresh call to make the sensor/get service call update quicker.

And thank you for the coffee/beer offer! 😃

Buy Me A Coffee