Skip to content

Commit

Permalink
Fix WS69 battery state decode
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Crossley committed Oct 19, 2024
1 parent 7d48d6c commit 25c6e11
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ but you also want to see the two minute values then you can use these new tags
- Fix web tag `<#NewBuildNumber>` showing the latest build number as "0000"
- Error when logging enabled at start-up with SFTP uploads
- Windy pressure uploads failing
- Fix Ecowitt WS69 battery state decode in TCP API station

### Package Updates
- SQLite
Expand Down
8 changes: 2 additions & 6 deletions CumulusMX/GW1000Station.cs
Original file line number Diff line number Diff line change
Expand Up @@ -789,12 +789,10 @@ private bool PrintSensorInfoNew(byte[] data, int idx)

break;

case "WH24":
case "WH24/WH65":
case "WH25":
case "WH26":
case string wh31 when wh31.StartsWith("WH31"): // ch 1-8
case "WH65":
case "WS69":
batt = TestBattery1(data[battPos], 1); // 0 or 1
break;

Expand All @@ -819,17 +817,15 @@ private bool PrintSensorInfoNew(byte[] data, int idx)
case string wh34 when wh34.StartsWith("WH34"): // ch 1-8
case string wh35 when wh35.StartsWith("WH35"): // ch 1-8
case "WH68":
case "WS69":
battV = data[battPos] * 0.02;
batt = $"{battV:f2}V ({(battV > 1.2 ? "OK" : "Low")})";
break;

case string wh51 when wh51.StartsWith("WH51"): // ch 1-8
case string wh51 when wh51.StartsWith("WH51"): // ch 1-16
battV = data[battPos] * 0.1;
batt = $"{battV:f2}V ({TestBattery10(data[battPos])})"; // volts/10, low = 1.2V
break;

case "WH80":
case "WS80":
// if a WS80 is connected, it has a 4.75 second update rate, so reduce the MX update rate from the default 10 seconds
if (updateRate > 4000 && updateRate != 4000)
Expand Down

0 comments on commit 25c6e11

Please sign in to comment.