Hi, @MacManiac78
You wrote:
Some answers... an ATS is a Automatic Transfer Switch. By using this i can cut off the grid and drain battery's without creating a deep fried grid maintenance guy.
Okay, I understand this, the maintenance guy will like this.
This ATS is automatically controlled and you don't need to activate this from Domoticz or whatever.
However if (for one reason or another) the grid is powerless, your Enphase inverters are cut-off and do not produce power ( The new IQ8 will do).
In this case you will connect the battery via an inverter to your local mains.
You said:
I could use 2 protocols. I do have the P1 (smart meter) script working, so it should be possible to trigger a switch, right?
You mean you can collect data from either the P1 Smart meter or from the Enphase Envoy-S metered.
As already said in my previous post, the P1 meter only indicate if (and how much) energy is consumed from the grid or delivered to the grid.
If you consume energy from the grid, it does not mean, the the solar production is zero. The only thing that is for sure, is that if you deliver to the grid, the solar panels are producing.
In my opinion you cannot use this information for the decision to switch to the back-up power.
Of course with this information, you can create a script, which triggers a switch. And what should this switch do?
As also said you can probably use information from the Envoy-S
If you go to (in a browser, you prefer): http://<IP address of Envoy-S>/inventory.json, you will get a result as follows:
0: Status Information of each of your inverters.
1: Your AC battery; probably not information.
2: Your Q relay data.
At the bottom you will find:
gficlearset":false,
"producing":false,
"communicating":true,
"provisioned":true,
"operating":true,
"relay":"closed",
"reason_code":-1,
"reason":"ok",
"line-count":3,
"line1-connected":true
,"line2-connected":true,
"line3-connected":true
I never tested it (by switching of a phase). so I don't know if it works. In this case your Domoticz and Envoy-S should behind a UPS in order to be able to report this. To switch of an individual phase is not that easy in a 3 phase installation. The main switch does all 3 phases together.
If you think that this might be useful in your situation and what you want to achieve I can provide a Node Red flow that monitors the 3 Lines.
Regards