[myenergi] MyEnergi Binding

logo

myenergi Binding

This binding allows openHAB to communicate with the public API from myenergi Ltd. (https://myenergi.com), a manufacturer of electric vehicle chargers (Zappi) and solar energy diverters (Eddi):

  • Retrieval of current energy readings (grid, solar, EV charger)
  • Control charging status and boost modes for Zappi

So far, this binding has only been tested with a Harvi and a Zappi. I would welcome testers who have an Eddi installed.

Supported Things

This binding supports the following thing types

Thing Thing Type Discovery Description
bridge Bridge Manual A single connection to the myenergi API
eddi Thing Automatic A solar energy diverter
zappi Thing Automatic An EV Charger (EVSE)
harvi Thing Automatic A remote power clamp reader

Discovery

Once the bridge is configured with myenergi username and password, the various devices will be discovered automatically and added to the Inbox.

Thing Configuration

Manual configuration

For the identifier of the devices, the corresponding serial number is used.

Bridge myenergi:bridge:api "MyEnergi API Bridge" [ username="<my username>", password="<my password>", refreshInterval=24 ] {
  Thing zappi 21287642 "MyEnergi Zappi" [ refreshInterval=30 ]
  Thing harvi 87263212 "MyEnergi Harvi" [ refreshInterval=30 ]
}

Examples

myenergi.things

Bridge myenergi:bridge:api "MyEnergi API Bridge" [ username="<my username>", password="<my password>", refreshInterval=24 ] {
  Thing zappi 21287642 "MyEnergi Zappi" [ refreshInterval=30 ]
  Thing harvi 87263212 "MyEnergi Harvi" [ refreshInterval=30 ]
}

myenergi.items

Group                    dgMyEnergi [ "Equipment" ]

DateTime                 Zappi_LastUpdatedTime    "MyEnergi Zappi Last Updated Time [%1$td.%1$tm.%1$tY %1$tH:%1$tM:%1$tS]" <time>    (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:lastUpdatedTime" }
Number:ElectricPotential Zappi_SupplyVoltage      "MyEnergi Zappi Supply Voltage [%.1f %unit%]"                            <energy>  (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:supplyVoltage" }
Number:Frequency         Zappi_SupplyFrequency    "MyEnergi Zappi Supply Frequency [%.1f %unit%]"                          <energy>  (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:supplyFrequency" }
Number                   Zappi_NumberOfPhases     "MyEnergi Zappi Number of Phases [%d]"                                   <energy>  (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:numberOfPhases" }
Number                   Zappi_LockingMode        "MyEnergi Zappi Locking Mode [%d]"                                                 (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:lockingMode" }
String                   Zappi_ChargingMode       "MyEnergi Zappi Charging Mode [%s]"                                                (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:chargingMode" }
String                   Zappi_Status             "MyEnergi Zappi Status [%s]"                                                       (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:status" }
String                   Zappi_PlugStatus         "MyEnergi Zappi Plug Status [%s]"                                                  (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:plugStatus" }
Number                   Zappi_CommandTries       "MyEnergi Zappi Command Tries [%d]"                                                (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:commandTries" }
Number                   Zappi_DiverterPriority   "MyEnergi Zappi Diverter Priority [%d]"                                            (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:diverterPriority" }
Number                   Zappi_MinimumGreenLevel  "MyEnergi Zappi Minimum Green Level [%d %%]"                                       (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:minimumGreenLevel" }
Number:Power             Zappi_GridPower          "MyEnergi Zappi Grid Power [%.1f %unit%]"                                <energy>  (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:gridPower" }
Number:Power             Zappi_GeneratedPower     "MyEnergi Zappi Generated Power [%.1f %unit%]"                           <energy>  (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:generatedPower" }
Number:Power             Zappi_DivertedPower      "MyEnergi Zappi Diverted Power [%.1f %unit%]"                            <energy>  (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:divertedPower" }
Number:Energy            Zappi_ChargeAdded        "MyEnergi Zappi Charge Added [%.1f %unit%]"                              <energy>  (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:chargeAdded" }
String                   Zappi_SmartBoostTime     "MyEnergi Zappi Smart Boost Time [%s]"                                   <time>    (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:smartBoostTime" }
Number:Energy            Zappi_SmartBoostCharge   "MyEnergi Zappi Smart Boost Charge [%.1f %unit%]"                        <energy>  (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:smartBoostCharge" }
String                   Zappi_TimedBoostTime     "MyEnergi Zappi Timed Boost Time [%s]"                                   <time>    (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:timedBoostTime" }
Number:Energy            Zappi_TimedBoostCharge   "MyEnergi Zappi Timed Boost Charge [%.1f %unit%]"                        <energy>  (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:timedBoostCharge" }
String                   Zappi_ClampName1         "MyEnergi Zappi Clamp Name 1 [%s]"                                                 (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:clampName1" }
Number:Power             Zappi_ClampPower1        "MyEnergi Zappi Clamp Power 1 [%.1f %unit%]"                             <energy>  (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:clampPower1" }
String                   Zappi_ClampName2         "MyEnergi Zappi Clamp Name 2 [%s]"                                                 (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:clampName2" }
Number:Power             Zappi_ClampPower2        "MyEnergi Zappi Clamp Power 2 [%.1f %unit%]"                             <energy>  (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:clampPower2" }
String                   Zappi_ClampName3         "MyEnergi Zappi Clamp Name 3 [%s]"                                                 (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:clampName3" }
Number:Power             Zappi_ClampPower3        "MyEnergi Zappi Clamp Power 3 [%.1f %unit%]"                             <energy>  (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:clampPower3" }
String                   Zappi_ClampName4         "MyEnergi Zappi Clamp Name 4 [%s]"                                                 (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:clampName4" }
Number:Power             Zappi_ClampPower4        "MyEnergi Zappi Clamp Power 4 [%.1f %unit%]"                             <energy>  (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:clampPower4" }
String                   Zappi_ClampName5         "MyEnergi Zappi Clamp Name 5 [%s]"                                                 (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:clampName5" }
Number:Power             Zappi_ClampPower5        "MyEnergi Zappi Clamp Power 5 [%.1f %unit%]"                             <energy>  (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:clampPower5" }
String                   Zappi_ClampName6         "MyEnergi Zappi Clamp Name 6 [%s]"                                                 (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:clampName6" }
Number:Power             Zappi_ClampPower6        "MyEnergi Zappi Clamp Power 6 [%.1f %unit%]"                             <energy>  (dgMyEnergi)  { channel="myenergi:zappi:api:21287642:clampPower6" }

DateTime                 Harvi_LastUpdatedTime    "MyEnergi Harvi Last Updated Time [%1$td.%1$tm.%1$tY %1$tH:%1$tM:%1$tS]" <time>    (dgMyEnergi)  { channel="myenergi:harvi:api:87263212:lastUpdatedTime" }
String                   Harvi_ClampName1         "MyEnergi Harvi Clamp Name 1 [%s]"                                                 (dgMyEnergi)  { channel="myenergi:harvi:api:87263212:clampName1" }
Number:Power             Harvi_ClampPower1        "MyEnergi Harvi Clamp Power 1 [%.1f %unit%]"                             <energy>  (dgMyEnergi)  { channel="myenergi:harvi:api:87263212:clampPower1" }
Number                   Harvi_ClampPhase1        "MyEnergi Harvi Clamp Phase 1 [%d]"                                      <energy>  (dgMyEnergi)  { channel="myenergi:harvi:api:87263212:clampPhase1" }
String                   Harvi_ClampName2         "MyEnergi Harvi Clamp Name 2 [%s]"                                                 (dgMyEnergi)  { channel="myenergi:harvi:api:87263212:clampName2" }
Number:Power             Harvi_ClampPower2        "MyEnergi Harvi Clamp Power 2 [%.1f %unit%]"                             <energy>  (dgMyEnergi)  { channel="myenergi:harvi:api:87263212:clampPower2" }
Number                   Harvi_ClampPhase2        "MyEnergi Harvi Clamp Phase 2 [%d]"                                      <energy>  (dgMyEnergi)  { channel="myenergi:harvi:api:87263212:clampPhase2" }
String                   Harvi_ClampName3         "MyEnergi Harvi Clamp Name 3 [%s]"                                                 (dgMyEnergi)  { channel="myenergi:harvi:api:87263212:clampName3" }
Number:Power             Harvi_ClampPower3        "MyEnergi Harvi Clamp Power 3 [%.1f %unit%]"                             <energy>  (dgMyEnergi)  { channel="myenergi:harvi:api:87263212:clampPower3" }
Number                   Harvi_ClampPhase3        "MyEnergi Harvi Clamp Phase 3 [%d]"                                      <energy>  (dgMyEnergi)  { channel="myenergi:harvi:api:87263212:clampPhase3" }

Changelog

Version 0.1

  • initial release

Resources

JAR: org.openhab.binding.myenergi-3.4.0-SNAPSHOT.jar

Sources: (openhab-addons/bundles/org.openhab.binding.myenergi at myenergi_binding · renescherer/openhab-addons · GitHub)

2 Likes

Thanks!

Looks stable after some hrs running on openHAB 3.3.0 (harvi and two zappi).

I did try to initialize a manual boost over e.g. 5 kwh. I can set a boost charge (energy), but how to start the manual boost? Is there something missing in the API? Thx!

Hello,
I´m a new user from OpenHAB. Could you please help me? How can I install the Binding in OpenHAB 3.3.0? I cannot find the Binding on the System. Which files do I need and in wich folder I have to copy it?

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":16181119,"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.