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

Fix battery temperature sensor #258

Merged
merged 5 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 2 additions & 6 deletions src/sunsynk/definitions3phhv.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
# Battery
##########
SENSORS += (
Sensor(
586, "Battery 1 temperature", CELSIUS, 0.1
), # this one seems to not follow the convention of other temperatures. 290 = 29c
TempSensor(586, "Battery 1 temperature", CELSIUS, 0.1),
Sensor(587, "Battery 1 voltage", VOLT, 0.1),
Sensor(588, "Battery 1 SOC", "%"),
Sensor(590, "Battery 1 power", WATT, -10),
Expand All @@ -35,9 +33,7 @@
Sensor(593, "Battery 2 voltage", VOLT, 0.1),
Sensor(594, "Battery 2 current", AMPS, -0.01),
Sensor(595, "Battery 2 power", WATT, -10),
Sensor(
596, "Battery 2 temperature", CELSIUS, 0.1
), # this one seems to not follow the convention of other temperatures. 290 = 29c
TempSensor(596, "Battery 2 temperature", CELSIUS, 0.1),
)

#############
Expand Down
14 changes: 5 additions & 9 deletions src/tests/sunsynk/migration/old_hv.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
# Battery
##########
SENSORS += (
Sensor(
586, "Battery 1 temperature", CELSIUS, 0.1
), # this one seems to not follow the convention of other temperatures. 290 = 29c
TempSensor(586, "Battery 1 temperature", CELSIUS, 0.1),
Sensor(587, "Battery 1 voltage", VOLT, 0.1),
Sensor(588, "Battery 1 SOC", "%"),
Sensor(590, "Battery 1 power", WATT, -10),
Expand All @@ -39,9 +37,7 @@
Sensor(593, "Battery 2 voltage", VOLT, 0.1),
Sensor(594, "Battery 2 current", AMPS, -0.01),
Sensor(595, "Battery 2 power", WATT, -10),
Sensor(
596, "Battery 2 temperature", CELSIUS, 0.1
), # this one seems to not follow the convention of other temperatures. 290 = 29c
TempSensor(596, "Battery 2 temperature", CELSIUS, 0.1),
)

#################
Expand Down Expand Up @@ -245,14 +241,14 @@
# Settings
###########
SENSORS += (
NumberRWSensor(128, "Grid Charge Battery current", AMPS, max=210),
NumberRWSensor(128, "Grid Charge Battery current", AMPS, max=240),
SwitchRWSensor(130, "Grid Charge enabled"),
NumberRWSensor(127, "Grid Charge Start Battery SOC", "%"),
SwitchRWSensor(146, "Use Timer", on=255),
SwitchRWSensor(145, "Solar Export"),
NumberRWSensor(143, "Export Limit power", WATT, max=RATED_POWER),
NumberRWSensor(108, "Battery Max Charge current", AMPS, max=210),
NumberRWSensor(109, "Battery Max Discharge current", AMPS, max=210),
NumberRWSensor(108, "Battery Max Charge current", AMPS, max=240),
NumberRWSensor(109, "Battery Max Discharge current", AMPS, max=240),
NumberRWSensor(102, "Battery Capacity current", "Ah", max=2000),
NumberRWSensor(191, "Grid Peak Shaving power", WATT, 10, max=100000),
)
Expand Down
6 changes: 3 additions & 3 deletions src/tests/sunsynk/migration/old_lv.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,13 @@
# Settings
###########
SENSORS += (
NumberRWSensor(128, "Grid Charge Battery current", AMPS, max=210),
NumberRWSensor(128, "Grid Charge Battery current", AMPS, max=240),
SwitchRWSensor(130, "Grid Charge enabled"),
SwitchRWSensor(146, "Use Timer", on=255),
SwitchRWSensor(145, "Solar Export"),
NumberRWSensor(143, "Export Limit power", WATT, max=RATED_POWER),
NumberRWSensor(108, "Battery Max Charge current", AMPS, max=210),
NumberRWSensor(109, "Battery Max Discharge current", AMPS, max=210),
NumberRWSensor(108, "Battery Max Charge current", AMPS, max=240),
NumberRWSensor(109, "Battery Max Discharge current", AMPS, max=240),
NumberRWSensor(102, "Battery Capacity current", AMPS, max=2000),
NumberRWSensor(191, "Grid Peak Shaving power", WATT, max=100000),
)
Expand Down
Loading