forked from tbnobody/OpenDTU
-
Notifications
You must be signed in to change notification settings - Fork 66
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
JK BMS Home Assistent Integration #640
Merged
helgeerbe
merged 2 commits into
hoylabs:development
from
schlimmchen:jkbms-home-assistent-pr
Feb 9, 2024
Merged
JK BMS Home Assistent Integration #640
helgeerbe
merged 2 commits into
hoylabs:development
from
schlimmchen:jkbms-home-assistent-pr
Feb 9, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
previously, the Pytlontech Home Assistent class implementation had an init() method, that was never called, as it did nothing. the class relied on its loop() method being called from the main loop(). after switching to the TaskScheduler approach, the Pylontech Home Assistent class init() method was adjusted to register a task that calls the loop() method periodically. however, the init() method was still not called.
This was referenced Feb 5, 2024
* pylontech HA integration: remove unused method/variable * make MqttHandlePylontechHassClass::publishConfig() private. there are no outside users of that method. * rename to MqttHandleBatteryHass * battery HA integration: merge methods and bring back forceUpdate(). even though the forceUpdate() method was not in use before, it makes sense to implement it and use it when the battery config changes. rather than controlling a separate flag, it now changes the _doPublish flag of the class, which also triggers publishing the device config to Home Assistant when an MQTT connection problem was detected. since both situations are now handled similarly, we can merge the loop() and publishConfig() methods. * battery: provider specific sensors for HA * move Battery MQTT loop to BatteryStats the BatteryStats class should handle the MQTT publishing, including the interval. for the calculation of a reasonable Home Assistent expiration value this class now also knows the maximum publish interval. * JK BMS: fix publishing values for Home Assistent Home Assistent values expire, because we set them to expire after three MQTT publish durations. for that reason, we need to re-publish all values after our self-inflicted full publish interval. * define JK BMS sensors for Home Assistent closes hoylabs#482.
schlimmchen
force-pushed
the
jkbms-home-assistent-pr
branch
from
February 5, 2024 20:22
2f15af4
to
1865113
Compare
I added |
From #482: |
Also closes #633. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changeset adds the Home Assistent integration for the JK BMS and prepares the previous Pylontech-specific Home Assistent class implementation to handle all the different battery providers.
Sadly, the diff for
src/MqttHandlePylontechHass.cpp
became so large that GIT did not track that the file was actually renamed and then changed.A fix is implemented that restores the Home Assistent integration for the Pylontech (and the general Battery Home Assistent integration), which is a regression from the TaskScheduler introduction.
@helgeerbe Please do NOT squash these commits when merging to preserve the intended changelog messages.