[RELEASE] myenergi Integration

App and driver developed for the myenergi solar related products (hub, charger, solar diverter). At the moment the only driver in existence is the eddi. The others are on my TODO list but until I actually own the devices it is unlikely I will get the incentive to create them.

Also on my TODO is the creation of a manifest for the Hubitat Package Manager

This is my first app/driver combo from scratch so all feedback very welcome. In particluar, I know that the way I have manipulated some of the maps embedded in lists that come back from the JSON responses could be done better. If you fancy having a go at making the code a bit more efficient I would love to gain some knowledge in this area.

Code is at Velowulf - myenergi integration

5 Likes

Not something I use, but always good to see others branching out and writing their own stuff, nice work. Happy to help if you have any questions.

Simon

1 Like

So not used yet as awaiting an install date but excited about the possibilities of making it smarter

Hi @garyburchell, sounds good - reach out if you have any problems.

@VeloWulf Just installed.

Zappi installed two days ago, installer had issue so hopefully get it working tomorrow.

Adding 20kWh of batteries later in the month, then looking at an Eddi and solar.

I don’t have an Eddie, yet, but I do have the Zappi, Hubi and Harvi, is there anyway to get these working with HE?

At least to be able to pull energy usage data for grid and for Zappi?

If not, not a problem.

I was just thinking about this this morning actually. I don't have a Zappi or a Harvi but I am willing to give the driver a go if you can be patient (I have a lot on at the moment) and you are willing to test!

The concepts should be quite similar and a lot of the code should be reusable, from what I can tell

Can you do something for me - run the app and tell me if the other devices are detected. You won't be able to install the driver but they should at least populate as options in the app setup pages

Just tried ran into this error

Also, will definitely test and support :slight_smile:

@VeloWulf , thought I would give this a try. I have a Zappi and Hub with monitors and was hoping to pull info from them. first issue is that I loaded the app with HPM. then went to configure with username and password.

got these errors straight away:
app:1392022-08-17 10:23:11.657 am errorgroovy.lang.MissingMethodException: No signature of method: java.net.UnknownHostException.getResponse() is applicable for argument types: () values: []
Possible solutions: getMessage() on line 240 (method devicePage)

app:1392022-08-17 10:23:11.472 am errorUnxpected succesful call to director server - please troubleshoot

@VeloWulf

just tried to install the integration and getting an error on install, im using the latest version of the eddi.

any ideas?

app:41942022-12-02 21:44:15.538errorjava.lang.NullPointerException: Cannot get property 'size' on null object on line 132 (method devicePage)

app:41942022-12-02 21:44:15.520debugeddiMap = null

app:41942022-12-02 21:44:15.519debugException in pollASNServer call: status code: 401, reason phrase: Unauthorized

app:41942022-12-02 21:44:15.291debugAuth Command parameters = [uri:https://s18.myenergi.net, path:/cgi-jstatus-, contentType:application/json, timeout:300, headers:[Authorization:Digest username="garyburchell@outlook.com", realm="MyEnergi Telemetry", qop="auth", algorithm="MD5", uri="/cgi-jstatus-", nonce="PSLujpDEZfaxaIgWZTIQtw8u1gqdEcgk", cnonce="626f93d3", opaque="78b66b1db9dc49dd845535e7d7b35287", nc=2, response="2bcab6cd85632607dfce0f4ead241e1a"]]

app:41942022-12-02 21:44:15.289debugResponse: 2bcab6cd85632607dfce0f4ead241e1a ===== orig:747866240554942fc3de9e760b58b724:PSLujpDEZfaxaIgWZTIQtw8u1gqdEcgk:2:626f93d3:auth:c7c16c211e1f3baebe0175a6590ff345

app:41942022-12-02 21:44:15.288debugHA2: c7c16c211e1f3baebe0175a6590ff345 ===== orig:GET:/cgi-jstatus-*

I've just had an MyEnergi Eddi installed with our new PV system so this app would be great. I've installed the app and driver but get the following error when trying to set up the app after adding my username and password.

Error: No signature of method: java.net.UnknownHostException.getResponse() is applicable for argument types: () values: [] Possible solutions: getMessage()

Any idea how to fix this?

Thanks!

hey @user2186 , sorry for the delayed reply. I have just returned to the code because I noticed that this was failing myself. It looks like myenergi have changed the way that the director server responds to initial requests. It used to throw a 401 error (and I coded for that) but it now responds with a 200 (success) response. I have now catered for both because the documetnation that I can find on the API doesn't i ndicate one way or the other - it actually says that both might happen.

Give me 24 hours and I will see if I can get the new code uploaded for installation

Note: the zappi driver is still WIP so please don't select the zappi in the application just yet. I am working on this now.

hi @garyburchell, apologies for the late response. You may have figured this out by now but the reason it is failing is that you have put your credentials in wrong. The username that you need to use is the hub serial number and associated password, not your myenergi portal login.

Note: you may still get a failure because of the change to the way that the myenergi director server responds (see above post to @user2186 ). If it does fail please stand by - I will have updated code uploaded soon.

Hi @Mattal , check that you are using the right credentials but if you are then please stand by for an updated version of the code.

Updated version 0.2.0 released

Manifest created for Hubitat Package Manager and I have submitted a pull request for inclusion in the HPM list of repositories. While this is going through, you can add a custom repository to HPM using https://raw.githubusercontent.com/VeloWulf/hubitat-packages/main/repository.json

Please let me know if you find any bugs

Zappi is included in the latest version

Thanks for the great work, looks good.
Any plans to add the new Libbi?
Cheers

I started to include libbi changes in the app code but don't have plans for a driver yet. Do you use the libbi?

Yes, Just had one installed so was wondering what could be accessed. Happy to help test a driver, not sure how much I could write :frowning: