[myenergi] MyEnergi Binding

Steffen
Copy the jar file linked above to /usr/share/openhab/addons. Seems to work for me on OpenHAB 3.3.0 but I do have a problem which I’m about to post a question about.

I’ve installed this binding on OpenHAB 3.3.0. I have an eddi and harvi with the eddi acting as the gateway (the latest eddi model has network connectivity built in). I can configure the bridge (although the app password didn’t work - I got a new API key through my myenergi account) and I then see the eddi and harvi in the inbox. I have sucessfully added the harvi as a thing and I’m able to monitor the power reported by the harvi*.

When I try to add the eddi as a thing I get the message “Error during thing creation: conflict”.

The log shows this:

2022-11-09 17:22:06.410 [ERROR] [nhab.core.thing.binding.ThingFactory] - Thing factory (class org.openhab.binding.myenergi.internal.MyEnergiHandlerFactory) returned null on create thing when it reports to support the thing type (myenergi:eddi).
2022-11-09 17:22:06.416 [WARN ] [g.discovery.internal.PersistentInbox] - Cannot create thing. No binding found that supports creating a thing of type myenergi:eddi.

I notice that if you try to add the eddi manually the binding doesn’t show the eddi in the list of devices.

*As an aside, I wonder how the harvi can report power if it has no way of measuring the voltage.

Thank you for the tip
I run OpenHAB in a Docker on a Synology. If I copy the Jar in Openhab\addons, I could not find the binding in Openhab. I have tried to restart, but nothing happend.

I can´t see the Binding if I want to add a thing.

To answer my own question, the code for supporting the Eddi is not in the sources linked above. Having a go at the code myself and so far can at least get an eddi thing added.

I’m able to readout all params and config, but cannot make adjustments – e.g. changing the charging mode from fast to eco.

Anyone else facing this issue as well, or is this a picnic problem?

Thanks for this binding.

Given its definitions, all values are read-only.

What I noticed is, that the clamp names are not presented by the relevant channels.

The API result:

2022-11-12 22:08:45.252 [INFO ] [.myenergi.internal.MyEnergiApiClient] - Api response: {"zappi":[{"sno":16181239,"dat":"12-11-2022","tim":"12:08:44","ectp2":36,"ectp3":-15,"ectt1":"Internal Load","ectt2":"Grid","ectt3":"Generation","bsm":0,"bst":0,"cmt":254,"div":0,"frq":50.02,"fwv":"3560S3.162","gen":-10,"grd":38,"pha":1,"pri":1,"sta":1,"tz":9,"vol":2444,"che":29.08,"bss":0,"lck":16,"pst":"B1","zmo":4,"pwm":1015,"zs":13570,"rdc":4,"rac":12,"zsh":53,"zsl":2,"ectt4":"None","ectt5":"None","ectt6":"None","mgl":50,"sbh":17,"sbk":5}]}

… as seen here:

The clamp numbering seems to go from 6 to 1, rather than the other way around.

In my case the clamps are 1 = grid, 2 = generation.

same here. not able to start any kind of charging proces

with the version 3.3 I could add things via OH3 standard way adding things via running bridge.

can you find the brigde within the add things dialogue?

Tx. Am using curl requests for now to change charging mode and boost setting.

2 Likes

oh, cool. thx. how does it work? do you have an example? thanks in advance!

now I find the bridge in the Thing dialog. But By the Binding Installation I get an error.

When I create the Bridge, I get the following error: Invalid API key or account number.
I use the Hub Serial Number and the correct password.

What could I do?

look under Findings at GitHub - twonk/MyEnergi-App-Api: Investigation of the MyEnergi App

Works for me.

Rene @scherer I’ve implemented support for the Eddi solar energy diverter and submitted a pull request.

My first time with GitHub, OpenHab code and Java so I hope what I’ve done makes sense.

1 Like

I had to create a new API key before my bridge could log in. The instruction to use the same credentials as you use with the phone app seem to be wrong. Make sure you have registered your products at myenergi account and then click on the Advanced button by your gateway product. Create a new API key and use that as your password.

thank you for your help, now with the new api key the binding works :smiley: :+1:

Thank you all, now the binding nd the Channels work, but I can´t transform the Value to kWh.
I tried

(function(i) {
   return parseFloat(i) / 100;
})(input)

but nothing happend. This code works for me for transformations with Temperature as a js file. Does somebody know how I can transform the value of the power to kWh?

Thanks for the great initiative on the MyEnergi Binding.
I’m testing it currently and trying to get the CT clamps monitored.
In the channels, I’m missing the clamps 1,2 and 3.

checking the latest THINGS.XML, I noticed that these are missing in there.
Is that correct

Zappi
MyEnergi Zappi device

	<channels>
		<channel id="lastUpdatedTime" typeId="lastUpdatedTimeType"/>
		<channel id="supplyVoltage" typeId="voltageType"/>
		<channel id="supplyFrequency" typeId="frequencyType"/>
		<channel id="numberOfPhases" typeId="numberOfPhasesType"/>
		<channel id="lockingMode" typeId="lockingModeType"/>
		<channel id="chargingMode" typeId="chargingModeType"/>
		<channel id="status" typeId="statusType"/>
		<channel id="plugStatus" typeId="plugStatusType"/>
		<channel id="commandTries" typeId="commandTriesType"/>
		<channel id="diverterPriority" typeId="diverterPriorityType"/>
		<channel id="minimumGreenLevel" typeId="minimumGreenLevelType"/>
		<channel id="gridPower" typeId="gridPowerType"/>
		<channel id="generatedPower" typeId="generatedPowerType"/>
		<channel id="divertedPower" typeId="divertedPowerType"/>
		<channel id="consumedPower" typeId="consumedPowerType"/>
		<channel id="chargeAdded" typeId="chargeType"/>
		<channel id="smartBoostTime" typeId="boostEndTimeType"/>
		<channel id="smartBoostCharge" typeId="chargeType"/>
		<channel id="timedBoostTime" typeId="boostEndTimeType"/>
		<channel id="timedBoostCharge" typeId="chargeType"/>
		<channel id="clampName4" typeId="CTType"/>
		<channel id="clampName5" typeId="CTType"/>
		<channel id="clampName6" typeId="CTType"/>
		<channel id="clampPower4" typeId="clampPowerTypeL4"/>
		<channel id="clampPower5" typeId="clampPowerTypeL5"/>
		<channel id="clampPower6" typeId="clampPowerTypeL6"/>
	</channels>

oh, cool. thx. how does it work? do you have an example? thanks in advance!

For all those interested: the programmer of the binding is working on updating the binding and getting it into the OH distro in the coming weeks — great news :slight_smile:
The code will include sending the charge mode for the Zappi.

2 Likes

Hi Stephen. Sorry, that it took so long for me to get back to you.
I’m just making a few changes to support missing features and though I’d also incorporate the EDDI changes. However, I can’t see you PR. Did you submit this against my github repo?
I’ve renamed the branch to myenergi_binding_3.4.x to distinguish it from the work I’m doing for OH 4.0.

Otherwise, if you let me have your source code, I’ll figure out the changes myself.

Many thanks,
Rene