Skip to content
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 storedge control #38

Merged

Conversation

mpredfearn
Copy link
Contributor

This PR implements #36 - creating Number and Select entities to allow the user to change the battery charge / discharge profiles. These can be changed via the UI or automation, depending upon individual requirements.
This builds upon my changes to monitor the battery status in #35.

@nerfherder
Copy link
Contributor

Great work, I have merged this into my branch and it is working well.

Another thing I have been playing with is export limit. I am running an automation so if the wholesale price goes negative from my retailer (amber electric, Australia). I can export limit to 0, now that you have done the hard work puttin this in place it wouldn't take much more to add this control in.

@mpredfearn
Copy link
Contributor Author

@nerfherder sure, that should be possible - now that we have the "number" class defined, it should be easy to add the additional registers. Specifically which registers do you need? I could add another commit to add them.

@binsentsu
Copy link
Owner

binsentsu commented Sep 15, 2021

@mpredfearn Thanks for this one. Mayb better to remove the stubs now entirely to eliminate future discussion about them being useless in deployment :) I only have a single inverter at home, so will start with pulling this one in. Do you have feedback on the usage of pymodbusTCP.client iso pymodbus.client as proposed in #39 ?

@nerfherder
Copy link
Contributor

@mpredfearn The export limit control is defined on pages 15 and 16 of https://www.photovoltaikforum.com/core/attachment/88445-power-control-open-protocol-for-solaredge-inverters-pdf/.

There are a few intialisation steps described there which I did manually with the mtcp app on iphone.
image

After that is done you can set export limits by writing to E002/F702 with a Float32 value.

image

@mpredfearn
Copy link
Contributor Author

@binsentsu sure, I will adapt my PR to drop the stubs.
I have not tested the changes from #39 in my own system yet, but the change seems good. As you proposed, let's get this merged first then @nerfherder can rebase that change on top :-).

@mpredfearn mpredfearn force-pushed the mpredfearn/add_storedge_control branch from 7e56eaf to a2d1950 Compare September 16, 2021 07:33
The stub functions were used for testing without hardware, but are
unnecessary. Drop them.
@mpredfearn mpredfearn force-pushed the mpredfearn/add_storedge_control branch from a2d1950 to 2fee4e2 Compare September 16, 2021 07:34
@mpredfearn
Copy link
Contributor Author

@nerfherder Thanks for the details. If it's OK with you I'd like to try to get this support merged first, then I will add a commit later to add support for the export control block.

@nerfherder
Copy link
Contributor

@mpredfearn yeah no worries, let's do it as a seperate one

Add support for reading the modbus registers relating to batteries 1&2
attached to the inverter.
Add flags to the configuration flow. Translations are from Google
translate.
The battery 1&2 charged / discharged sensors can be used for Home
Assistants energy monitor.
Extend the integration to create number & select entities for the
Storedge control registers.
Through these registers one can control the battery charge / discharge
profile.
@mpredfearn mpredfearn force-pushed the mpredfearn/add_storedge_control branch from 2fee4e2 to b6b42f5 Compare September 16, 2021 18:47
@mpredfearn
Copy link
Contributor Author

Just a couple of minor fixups. Ready for review and hopefully merge 🤞

@WillCodeForCats
Copy link

The control stuff is a pretty extensive addition, someone better at Python than me might have to figure out how to make that work with a multiple inverter system. I can work with Python out of necessity because I'm forced to with homeassistant, but I don't work in it otherwise.

Battery status looks easy enough to port to multiple inverters.

@binsentsu
Copy link
Owner

@mpredfearn Looks good to me. Nice effort! Is there any modbus documentation reference we could add in the readme for battery stuff? The one I referenced from SolarEdge doesn't say a word about batteries :)

@nerfherder
Copy link
Contributor

Power Control Open Protocol for SolarEdge Inverters.pdf

@binsentsu I found it on the photovoltaikforum website, it isn't hosted on the solaredge website - they ask you to contact support to get a hold of it.

https://www.photovoltaikforum.com/core/attachment/88445-power-control-open-protocol-for-solaredge-inverters-pdf/

@mpredfearn
Copy link
Contributor Author

@binsentsu I Used the doc that @nerfherder pointed me to (above) as reference for the implementation. Agreed it would be nice to add some stuff about batteries, and also control of the storedge interface into the Readme. Is that something you want me to add to this PR?

@binsentsu
Copy link
Owner

@mpredfearn if it's possible, that would be great. Together with a link to above pdf.

@mpredfearn
Copy link
Contributor Author

@binsentsu done :-)

Add some stuff about changing battery modes to the readme, and a pointer
to the document describing the MODBUS registers that are used to
implement Storedge control and battery status monitoring.
@mpredfearn mpredfearn force-pushed the mpredfearn/add_storedge_control branch from c5eb178 to 86eb975 Compare September 20, 2021 09:53
@binsentsu
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants