-
Notifications
You must be signed in to change notification settings - Fork 16
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
Battery strategy 2 #62
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution(s). Great work.
I have added code to migrate from old settings (either with max_feed_in_percentage or without) to the new settings in index_m.html and plenticore.js. Do you know how the make it work that the strategy dropdown updates to the actual setting when load the setting page? |
In index_m.html around line 47 there is a check for the input type. I think you need to loop through the corresponding option elements in the form and then add "selected" to that one matching the settings value. |
In index_m.html from line 127 (the save handler) you could just add something like obj['max_feed_in_percentage'] = null, I think. |
I found a way how it works. Programming the logic is easy but as I am not a Javascript developer some of the stuff around is hard :-) |
I've added this as proposed. Because I am not very familiar with Javascript I am not sure if the entry is now really gone or if it now jus has the value null. To be on the safe side, I added a check for null in getMaxFeedInPower(). By this I found a mistake there. |
Is in index_m.html the function fillInstances() still used? Or could this be removed to keep the code clean? |
I think it was just for the weather forecast adapter selection and should no longer be used. |
Looks good to me how you solved it 👍 |
Function is not used anymore
I have removed it. Just as a proposal you can decide on. |
Thank you. I will issue a new release. |
This time a little bigger change - actually it is not a change but an addition.
I propose an alternative strategy when to switch on/off the KOSTAL Smart Battery Management. The main information about the strategy is added in Readme.md and Readme_de.md. I've added there a section "Smart battery control".
The new strategy is added as option which can be selected in the adapter settings. The default strategy is the previous strategy.
(!) There is one change in the settings compare to the current github version: I changed the setting for the feed-in limitation from a percentage to an absolute value. It give a little more flexibility (e.g. if the actually panel efficiency is different from the nominal one).
I am using this strategy since a while now and it seems to work quite well.
(!) There is one thing which I did not manage: When you open the adapter settings, it shown always strategy 1 as current selection. I did nit figute out how to set the dropdown list to the previously select value when loading the settings.
When transferring the implementation from my experimental branch to this proposed one, I split the changes in three pull request:
Test usual: Additional testing and feedback welcome :-) I am using strategy 2 so that this one wil lbe tested anyhow (at least with my setup).