Skip to content

Commit

Permalink
1.0.22: signed battery power
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseklm committed Oct 28, 2024
1 parent a785396 commit 6df72c5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ name: Docker
# documentation.

on:
schedule:
- cron: '19 5 * * *'
# schedule:
# - cron: '19 5 * * *'
push:
branches: [ "master" ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
tags: [ '*.*.*' ]
pull_request:
branches: [ "master" ]

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ Tested: SH10RT
services:
sungrowmodbus2mqtt:
container_name: sungrowmodbus2mqtt
image: ghcr.io/jesseklm/sungrowmodbus2mqtt:v1.0.21
image: ghcr.io/jesseklm/sungrowmodbus2mqtt:1.0.22
restart: unless-stopped
volumes:
- ./config.sh10rt.yaml:/config/config.yaml:ro
```
- `wget -O config.sh10rt.yaml https://raw.githubusercontent.com/jesseklm/sungrowmodbus2mqtt/v1.0.21/config.sh10rt.example.yaml`
- `wget -O config.sh10rt.yaml https://raw.githubusercontent.com/jesseklm/sungrowmodbus2mqtt/1.0.22/config.sh10rt.example.yaml`
- adjust your config yaml
- `docker compose up -d`
10 changes: 7 additions & 3 deletions config.sh10rt.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ input:
address: 5036
scale: 0.1
unit: 'Hz'
- pub_topic: battery_power
type: int32
address: 5214
unit: 'W'
- pub_topic: running_state
address: 13000
value_map:
Expand Down Expand Up @@ -321,9 +325,9 @@ input:
address: 13021
scale: 0.1
unit: 'A'
- pub_topic: battery_power
address: 13022
unit: 'W'
# - pub_topic: battery_power
# address: 13022
# unit: 'W'
- pub_topic: battery_level
address: 13023
scale: 0.1
Expand Down
2 changes: 1 addition & 1 deletion mqtt_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def on_connect(self, client: mqtt.Client, userdata: Any, connect_flags: ConnectF
else:
logging.error(f'mqtt connection to %s:%s failed, %s.', self.host, self.port, reason_code)

def publish(self, topic: str, payload: str | int | float, retain=False) -> None:
def publish(self, topic: str, payload: str | int | float, retain: bool = False) -> None:
self.publishing_queue.put({
'topic': self.topic_prefix + topic,
'payload': payload,
Expand Down
2 changes: 1 addition & 1 deletion sungrowmodbus2mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from modbus_handler import ModbusHandler
from mqtt_handler import MqttHandler

__version__ = '1.0.21'
__version__ = '1.0.22'


class SungrowModbus2Mqtt:
Expand Down

0 comments on commit 6df72c5

Please sign in to comment.