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

JK BMS: Support for MQTT #432

Merged
merged 4 commits into from
Sep 13, 2023
Merged

Conversation

schlimmchen
Copy link
Member

This changeset implements publishing all JK BMS data points (with two exceptions) to the MQTT broker.

@schlimmchen
Copy link
Member Author

I'll let this run in my setup for a while before marking this ready. It's also too late and I am too tired to be sure that I did not miss something.

this changes the interpretation of the timestamp in data containers that
are merely updated from other data containers: this is the oldest
timestamp known where the value was as recorded by the data point in its
respective container.

the data container constructed from an answer will -- naturally -- have
the timetamps of its data points set to the time they were constructed.
all values are still published once every minute if the MQTT retain flag
is NOT set. otherwise, the constant values are only published once on
startup.
@schlimmchen
Copy link
Member Author

My device ran for nearly 46h without problems and the JK BMS values are dutifully published to the broker. I will mark this PR ready.

@schlimmchen schlimmchen marked this pull request as ready for review September 12, 2023 19:47
@helgeerbe helgeerbe merged commit 24018a1 into hoylabs:development Sep 13, 2023
8 checks passed
@schlimmchen schlimmchen deleted the jkbms-mqtt branch September 13, 2023 18:39
helgeerbe pushed a commit that referenced this pull request Sep 15, 2023
* JK BMS: avoid trailing whitespace in debug output

* JK BMS: publish data points through MQTT

* JK BMS: updateFrom: skip data points with equal value

this changes the interpretation of the timestamp in data containers that
are merely updated from other data containers: this is the oldest
timestamp known where the value was as recorded by the data point in its
respective container.

the data container constructed from an answer will -- naturally -- have
the timetamps of its data points set to the time they were constructed.

* JK BMS: only publish changed values to MQTT broker

all values are still published once every minute if the MQTT retain flag
is NOT set. otherwise, the constant values are only published once on
startup.
schlimmchen added a commit to schlimmchen/OpenDTU-OnBattery that referenced this pull request Sep 21, 2023
* JK BMS: avoid trailing whitespace in debug output

* JK BMS: publish data points through MQTT

* JK BMS: updateFrom: skip data points with equal value

this changes the interpretation of the timestamp in data containers that
are merely updated from other data containers: this is the oldest
timestamp known where the value was as recorded by the data point in its
respective container.

the data container constructed from an answer will -- naturally -- have
the timetamps of its data points set to the time they were constructed.

* JK BMS: only publish changed values to MQTT broker

all values are still published once every minute if the MQTT retain flag
is NOT set. otherwise, the constant values are only published once on
startup.
Copy link

github-actions bot commented Apr 5, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants