Skip to content

Support writing of the battery configuration #28

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

Draft
wants to merge 35 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
448fab6
Enable tls options for mqtt broker when port is 8883
rjpearce Nov 10, 2024
83537c8
Publish discovery more often
rjpearce Nov 10, 2024
3ccf0b4
Bump to python:3.13.0-alpine3.20
rjpearce Nov 10, 2024
db9d277
Add depth_of_discharge, fix format
rjpearce Dec 14, 2024
fec3e1e
Stupid json
rjpearce Dec 14, 2024
f791ffe
Add all the scary battery_config registers
rjpearce Dec 14, 2024
ef2db66
Use serial number to determine model and modbus protocol
rjpearce Dec 15, 2024
8a61ec7
Ignore retained messages
rjpearce Dec 15, 2024
22829c7
Adjust read_and_publish to break it properly into two functions
rjpearce Dec 15, 2024
1a6467a
Remove space
rjpearce Dec 15, 2024
7a2b7fb
Fix quotes
rjpearce Dec 15, 2024
64bf80e
Put name back to how it was
rjpearce Dec 15, 2024
2255da3
WIP
rjpearce Dec 15, 2024
d5c2abe
WIP
rjpearce Dec 15, 2024
519cb8c
WIP
rjpearce Dec 15, 2024
70bce20
Make dev cycle quicker
rjpearce Dec 15, 2024
1b382de
Working but more to do to make it work properly
rjpearce Dec 21, 2024
8d38c32
Almost fully working
rjpearce Dec 21, 2024
5da1f1e
Update icons
rjpearce Dec 21, 2024
518a372
Functional alpha
rjpearce Dec 21, 2024
79c7682
Convert this to a function
rjpearce Dec 22, 2024
11c1297
Cut over exclusively to raw_data
rjpearce Dec 22, 2024
20a7e97
Fix bugs, improve stability
rjpearce Dec 23, 2024
c7bf808
Fix bugs
rjpearce Dec 23, 2024
7b467bf
Add retry logic, move mutex
rjpearce Dec 23, 2024
50b7ff0
Fix another bug
rjpearce Dec 23, 2024
44d4ea7
Ensure that the json file exists
rjpearce Dec 23, 2024
feccb90
Swap first and second lookup
rjpearce Jan 1, 2025
538ba89
Validate serial number, reduce log verbosity on errors
rjpearce Jan 1, 2025
39433df
Use terminate instead of exit
rjpearce Jan 1, 2025
5671f15
Bump to latest python 3.20 image
rjpearce Jan 1, 2025
ffc4145
Add more validation, be more gentle writing blocks
rjpearce Jan 2, 2025
f4c9594
Terminate will fail if there is no self.client
rjpearce Jan 2, 2025
6b762b4
Delay MQTT auto config until version info is available
rjpearce Jan 2, 2025
3432f28
Add new registers with write_blocks
rjpearce Jan 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM python:3.12.2-alpine
FROM python:3-alpine3.20

WORKDIR /opt/sofar2mqtt

COPY requirements.txt sofar2mqtt-v2.py *.json ./
COPY requirements.txt ./

ARG TARGETOS
ARG TARGETARCH
Expand All @@ -25,5 +25,7 @@ ENV CONFIG_FILE=sofar-hyd-ep.json \
WRITE_RETRY_ATTEMPTS=5 \
WRITE_RETRY_DELAY=5

COPY sofar2mqtt-v2.py *.json ./

CMD [ "python", "sofar2mqtt-v2.py" ]

Loading
Loading