Skip to content

Commit

Permalink
Fix oder of magnitude reported for current in HA plugin (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisOSRM authored Jan 22, 2024
1 parent c40b9d5 commit b3759da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hms2mqtt/src/home_assistant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl HMSStateResponse {
json[format!("pv_{}_vol", port.pv_port)] =
format!("{:.2}", port.pv_vol as f32 * 0.1).into();
json[format!("pv_{}_cur", port.pv_port)] =
format!("{:.2}", port.pv_cur as f32 * 0.1).into();
format!("{:.2}", port.pv_cur as f32 * 0.01).into();
json[format!("pv_{}_power", port.pv_port)] =
format!("{:.2}", port.pv_power as f32 * 0.1).into();
json[format!("pv_{}_energy_total", port.pv_port)] = port.pv_energy_total.into();
Expand Down
2 changes: 1 addition & 1 deletion hms2mqtt/src/protos/RealData.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ message PortState {
int64 pv_sn = 1; // serial number
int32 pv_port = 2; // id of the port
int32 pv_vol = 3; // [V], factor 0.1
int32 pv_cur = 4; // [A], factor 0.1
int32 pv_cur = 4; // [A], factor 0.01
int32 pv_power = 5; // [W], factor 0.1
int32 pv_energy_total = 6; // [Wh]
int32 pv_daily_yield = 7; // [Wh]
Expand Down

0 comments on commit b3759da

Please sign in to comment.