-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for libbi #395
Comments
another vote for this feature please. Happy to be a guinea pig if required :) |
Me too. Happy to test, libbi fitted yesterday. |
Because myenergi don't officially operate a public API this hampers development against new products they release. There is active discussion reverse engineering the libbi portion of the API on their forum . This add-on utilises the pymyenergi upstream library which is there you may want to redirect requests for libbi support. (I would also love to have libbi in home assistant!) |
* Fixes a typo * Add a list of "common" sensors (firmware version, serial number etc) * Adds a few more sensors etc that are exposed * Mention that libbi isn't currently supported; CJNE#395
* Fixes a typo * Add a list of "common" sensors (firmware version, serial number etc) * Adds a few more sensors etc that are exposed * Mention that libbi isn't currently supported; CJNE#395
There is a pull request for pymyenergi here CJNE/pymyenergi#10 FYI |
It's been accepted. :) I've not got my head around the integration with this repo and home assistant yet... maybe someone can have a go....? pymyenergi can now read some basic values from the libbi including state of charge and solar PV ct values. However the ellusive 'charge from grid' command is proving tricky as it seems to talk to the front end server and not the back end like all the other commands.... |
Getting the basic functionality into pymyenrgi is a very good start on this, the next step would be to add the entities needed for HA, if someone is up for it it should be pretty straightforward to mimic for example the Zappi entities and tweak accordingly to what the Libbi uses. |
@videojedi https://github.com/trizmark/ha-myenergi/tree/add-libbi-support |
apologies if this is a daft question, I had the myenergi custom integration already installed and its currently version 0.0.23. Do I need to do anything in particular to get the libbi device/entities to show up? |
@Future-Surfer Grab the updated code from my fork: https://github.com/trizmark/ha-myenergi/tree/add-libbi-support Once I've added all the entities and tested the updates, I'll submit a PR and once that's been merged the update will also show up in HACS. |
will check the mode stuff again, probably my fault! |
It works fine using pymyenergi directly (myenergi libbi mode Normal), so I'm fairly certain it's the integration code. |
Ok, so I think it's to do with the various status mappings. We try to equate 0 to Stopped and 1 to Nomal (just how the cgi-libbi-mode endpoint expects it), but right now my libbi is returning 102. |
Appreciate the handholding! Successfully got it updated and working. Will keep an eye on the thread and test out any other updates you guys make :) |
Sounds like a plan. I’ll add lmo as well Just trying to figure out the energy totals. Sent from my iPhoneOn 15 Sep 2023, at 16:09, Zoltan ***@***.***> wrote:
Ok, so I think it's to do with the various status mappings. We try to equate 0 to Stopped and 1 to Nomal (just how the cgi-libbi-mode endpoint expects it), but right now my libbi is returning 102.
I was wondering if we should use the 'lmo' property rather than the 'sta' property. lmo reads 'local mode of operation' to me and it switches between 'BALANCE' (which is on) and 'STOP' (which is off).
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@videojedi Are you working on pymyenergi? I forked it as well, but let's not duplicate efforts. |
Yes. I added the very basic libbi support in the last PR. Feel free to PR my fork. Or I can make you a direct collaborator? Then we can PR the main repo when happy it works?Sent from my iPhoneOn 16 Sep 2023, at 08:25, Zoltan ***@***.***> wrote:
@videojedi Are you working on pymyenergi? I forked it as well, but let's not duplicate efforts.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I may be being blind, but was looking for where you added the CTs and can't see it in your commits. Mind sharing where that is? I have some time today so was going to test against mine. |
have a look in ha-myenergi/custom-components/myenergi/sensor.py lines 492-568 |
@videojedi Would you mind having a look at this line? https://github.com/videojedi/pymyenergi/blob/69e6a19e0f3b17c2275eb5eb9472176db11c4a06/pymyenergi/libbi.py#L184 I have reworked the mode selection and will start updating the HA component. |
.get() needs two parameters - missing |
removed for now..... still working out energy calcs....
although, pv_total is only provided on a minute by minute (/cgi-jday-), /cgi-jdayhour- does not include pvp1 values |
We appear to be following the same track @videojedi :D
I went with charge/discharge rather than in/out though to disambiguate.
|
inverter export? as there is also ivi1 inverter import? |
I'm not sure the Adding in the bcp/bdp values eg
and adding in the property values to libbi.py eg
and then update ha-myenergi with two additional sensors eg
or similar... is the next logical move. |
looking at libbi in myenergi app. it would seem Libbi discharge is actually ive1 minus bdp1?? |
Hmm I am unsure. That doesn't track with what I'm seeing, but also my bdp1 and app are not consistent. Compare these:
(I have just about run out of charge, and it's raining, which is somewhat hampering my ability to test 😄 ) |
So the request from the App is
where as the pymyenergi (when using the energy option) is
So the app (despite being set to Today) is requesting minute by minute for 24 hours starting 11pm yesterday? We are asking for hour by hour for today....... |
im struggling to work that out too!, how do you run update pymyenergi module iin home assistant? |
If you look at the attached tgz you'll see that I included the pymyenergi under the myenergi dir.
before importing anything from pymyenergi. |
I'd been trying to figure out the same thing 😆. I'd still like to understand what becomes of the modules from requirements.txt in HA.
Are you sure you've uploaded the right tgz? I don't see that in there. |
yep mode select works..... :) |
They're installed via pip.
Attaching the file again. Here's the listing:
|
Merged. |
I've got the energy data exposed now. Also moved some of the entities from diagnostic to sensors. The updated component + python package for those who want to test: |
Brilliant.Will try it when I get to hotel. Did you see the DC PV power values are mapped to CT5?
|
Amazing work! All good for me. Very happy with it. Please issue the PR when you're happy too. My end goal is to automate the overnight charging option when the solar prediction is showing poor weather for the following day. There must be a backend endpoint for switching grid charging on and off we just haven't found. But I guess only myenergi know what that is...... :) |
Well, I raised this issue ... today my libbi arrived, I installed this update and it worked first time ! Great work ! |
I used this version for a while ( file size 77932 bytes ) but now the changes have merged, I've just switched to main. I noticed that sensor.myenergi_libbi_home_consumption and sensor.myenergi_libbi_power_charging have gone. Not really a problem, since I think both of these can be calculated in home assistant, but just wanted to check that this was intentional. |
Is your feature request related to a problem? Please describe.
Add support for the libbi battery
Describe the solution you'd like
Full integration to libbi, inc charge status, charge from grid, charge from solar, integration into Energy dashboard etc
Describe alternatives you've considered
None
Additional context
I see some API info is available here https://myenergi.info/libbi-api-t9910.html
The text was updated successfully, but these errors were encountered: