diff --git a/modbus-mqtt/examples/sungrow-sh5.0rs.json b/modbus-mqtt/examples/sungrow-sh5.0rs.json index 93adafe..e32c350 100644 --- a/modbus-mqtt/examples/sungrow-sh5.0rs.json +++ b/modbus-mqtt/examples/sungrow-sh5.0rs.json @@ -59,34 +59,41 @@ { "address": 5036, "name": "grid_frequency", - "period": "1m" + "period": "1m", + "scale": -2 }, { "address": 5019, "name": "phase_a_voltage", - "period": "1m" + "period": "1m", + "scale": -1 }, { "address": 13031, "name": "phase_a_current", - "period": "1m" + "period": "1m", + "scale": -1 }, { "address": 5011, - "name": "mppt1_voltage" + "name": "mppt1_voltage", + "scale": -1 }, { "address": 5012, - "name": "mppt1_current" + "name": "mppt1_current", + "scale": -1 }, { "address": 5012, - "name": "mppt2_voltage" + "name": "mppt2_voltage", + "scale": -1 }, { "address": 5013, - "name": "mppt2_current" - } + "name": "mppt2_current", + "scale": -1 + }, { "register_type": "holding", "address": 13058, diff --git a/modbus-mqtt/src/modbus/connection.rs b/modbus-mqtt/src/modbus/connection.rs index 387c6bd..72e624a 100644 --- a/modbus-mqtt/src/modbus/connection.rs +++ b/modbus-mqtt/src/modbus/connection.rs @@ -53,7 +53,7 @@ pub(crate) async fn run( if let Err(error) = result { error!(?error, "Modbus connection failed"); - mqtt.publish("state", "errorered").await.unwrap(); + mqtt.publish("state", "error").await.unwrap(); mqtt.publish("last_error", format!("{error:?}")) .await .unwrap();