For enphase theres a new app available that can control shutting down the envoy standard (30min delay, but a flow can handle that) and metered.
See this thread thanks to @bramtops for making this.
For solaredge the above this works