CJNE / pymyenergi

An async python library for interfacing with MyEnergi devices
MIT License
19 stars 15 forks source link

Zappi, ECO+ phase setting #28

Closed jwillemsen closed 2 months ago

jwillemsen commented 4 months ago

Just upgraded to the latest zappi app (see https://myenergi.info/app-update-3-3-1-t12674.html#p122029) and this now has the option to set the phases to load in ECO+ mode, for this phaseSetting is used, when I change the setting in the app the diagnostics I can download in HA shows the following values:

"phaseSetting": "SINGLE_PHASE",

"phaseSetting": "THREE_PHASE",

"phaseSetting": "AUTO",

It looks my PR for using this as number of phases as part of https://github.com/CJNE/pymyenergi/pull/25 is not correct, it should return values 1, 3 or auto.

jwillemsen commented 3 months ago

Any ideas how we could set the phase setting from HA to myenergi, would love to set the phase setting to single or three phase based on power produced by my solar panels through HA, looking at the code we need some cgi-set-* call

jwillemsen commented 3 months ago

Asked on the forum, see https://myenergi.info/viewtopic.php?f=54&t=12847&from_new_topic=1

d-hz commented 3 months ago

Any ideas how we could set the phase setting from HA to myenergi, would love to set the phase setting to single or three phase based on power produced by my solar panels through HA, looking at the code we need some cgi-set-* call

I've tried to figure out the relevant HTTP Endpoints, if I am correct it seems to be:

3 Phase cgi-zappi-phase-setting-{ZXXXXXXXX}-1

1 Phase cgi-zappi-phase-setting-{ZXXXXXXXX}-0

Auto cgi-zappi-phase-setting-{ZXXXXXXXX}-2

{ZXXXXXXXX} is the Serial Number of the Zappi and needs to replaced in the calls

I am getting the following Response:

{ "status": "0", "statustext": "" }

Maybe this helps?

jwillemsen commented 3 months ago

Is the > for three phase correct? This helps, will try to implement this next week

d-hz commented 3 months ago

Is the > for three phase correct? This helps, will try to implement this next week

That was a typo. I have edited it. The schema seems to be the same for all three. I was not able to test it in code (I have checked the network traffic from the app and tried to check which query was made when selecting the option), maybe you can verify my results.

jwillemsen commented 3 months ago

Thanks, will try to implement this asap, I really can use it as a workaround for the problems I have

jwillemsen commented 3 months ago

Yes, this works, great! I have updated PR #28 to also provide the feature to set the phase setting