diff --git a/Cargo.lock b/Cargo.lock
index 17c9fa2..92f165d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3131,7 +3131,7 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
[[package]]
name = "sunspec_gateway"
-version = "0.5.0"
+version = "0.5.1"
dependencies = [
"actix-web",
"actix-web-prom",
@@ -3172,7 +3172,9 @@ dependencies = [
[[package]]
name = "sunspec_rs"
-version = "0.6.1"
+version = "0.6.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0976b030742c5e312e180327110512c01f697acc96733cace23584fbb2a7d50a"
dependencies = [
"anyhow",
"async-recursion",
diff --git a/Cargo.toml b/Cargo.toml
index d730ded..53ab911 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sunspec_gateway"
-version = "0.5.0"
+version = "0.5.1"
edition = "2021"
authors = ["Peter Grace"]
description = "Translate sunspec-compliant equipment metrics into MQTT"
@@ -27,7 +27,8 @@ serde = {version="1.0.185", features=["derive"]}
serde_json = "1.0.105"
serde_yaml = "=0.8.26"
prometheus = {version = "0.13.3", features=["process"]}
-sunspec_rs = "0.6.1"
+sunspec_rs = "0.6.3"
+#sunspec_rs = {path = "/home/pgrace/repos/sunspec_rs"}
console-subscriber = "0.1.10"
chrono = "0.4.28"
rand = "0.8.5"
diff --git a/kustomize/config.yaml b/kustomize/config.yaml
index b9d16f8..d3dc42b 100644
--- a/kustomize/config.yaml
+++ b/kustomize/config.yaml
@@ -199,14 +199,14 @@ models:
device_class: "voltage"
state_class: "measurement"
value_min: 0
- value_max: 300
+ value_max: 350
- point: "CellVMax"
interval: 60
precision: 1
device_class: "voltage"
state_class: "measurement"
value_min: 0
- value_max: 300
+ value_max: 350
- point: "W"
interval: 60
precision: 1
@@ -260,7 +260,7 @@ models:
state_class: "measurement"
precision: 1
value_min: 0
- value_max: 300
+ value_max: 350
"64200":
- point: "SysMd"
interval: 60
@@ -436,7 +436,7 @@ models:
precision: 1
uom: "V"
value_min: 0
- value_max: 300
+ value_max: 350
"64263":
- point: "Enable"
interval: 60
diff --git a/kustomize/kustomization.yaml b/kustomize/kustomization.yaml
index 9fbcc2d..2f187ca 100644
--- a/kustomize/kustomization.yaml
+++ b/kustomize/kustomization.yaml
@@ -11,7 +11,7 @@ resources:
images:
- name: IMAGE:TAG
newName: docker.io/petergrace/sunspec_gateway
- newTag: v0.6.0
+ newTag: v0.5.1
secretGenerator:
- files:
diff --git a/models/generac/smdx_64001.xml b/models/generac/smdx_64001.xml
new file mode 100644
index 0000000..00bd60e
--- /dev/null
+++ b/models/generac/smdx_64001.xml
@@ -0,0 +1,220 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/models/generac/smdx_64020.xml b/models/generac/smdx_64020.xml
new file mode 100644
index 0000000..f7b6d49
--- /dev/null
+++ b/models/generac/smdx_64020.xml
@@ -0,0 +1,215 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ scale of 0-10V
+
+
+
+
+ scale of 0-10V
+
+
+
+
+ scale of 0-10V
+
+
+
+
+ scale of 0-10V
+
+
+
+
+ scale of 0-10V
+
+
+
+
+ scale of 0-10V
+
+
+
+
+ scale of 0-10V
+
+
+
+
+ scale of 4-20mA
+
+
+
+
+ in 4-20mA or 4-20mA
+
+
+
+
+ in 4-20mA or 4-20mA
+
+
+
+
+ in 4-20mA or 4-20mA
+
+
+
+
+ in 4-20mA or 4-20mA
+
+
+
+
+ in 4-20mA or 4-20mA
+
+
+
+
+ in 4-20mA or 4-20mA
+
+
+
+
+ frequency in Hz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ always 0 in reading, used the code 0xC0DA during the writing for resetting them
+
+
+
+
+ always 0 in reading, used the code 0xC0DA during the writing for resetting the system
+
+
+
+
+ strings of 16 characters
+
+
+
+
+ string of 11 characters
+
+
+
+
+
+
+
+
+
diff --git a/models/generac/smdx_64101.xml b/models/generac/smdx_64101.xml
new file mode 100644
index 0000000..98164c8
--- /dev/null
+++ b/models/generac/smdx_64101.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/models/generac/smdx_64110.xml b/models/generac/smdx_64110.xml
new file mode 100644
index 0000000..360783d
--- /dev/null
+++ b/models/generac/smdx_64110.xml
@@ -0,0 +1,350 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ 1
+
+
+
+
+
+
+
+
+
+ 0
+ 1
+
+
+
+
+
+
+
+
+
+ 0
+ 1
+ 2
+
+
+
+ 0
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/models/generac/smdx_64111.xml b/models/generac/smdx_64111.xml
new file mode 100644
index 0000000..9e70156
--- /dev/null
+++ b/models/generac/smdx_64111.xml
@@ -0,0 +1,159 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ 1
+ 2
+ 3
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/models/generac/smdx_64112.xml b/models/generac/smdx_64112.xml
new file mode 100644
index 0000000..bf49091
--- /dev/null
+++ b/models/generac/smdx_64112.xml
@@ -0,0 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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/models/generac/smdx_64205.xml b/models/generac/smdx_64205.xml
index 0b4129d..1859883 100644
--- a/models/generac/smdx_64205.xml
+++ b/models/generac/smdx_64205.xml
@@ -14,7 +14,7 @@
2
3
4
- 5
+ 5
6
7
8
@@ -29,7 +29,7 @@
17
18
19
- 20
+ 20
21
22
23
@@ -37,6 +37,12 @@
25
26
27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
0
@@ -80,7 +86,7 @@
Configure for Puerto Rico (PREPA) settings.
-
+
Configure ISO New England settings.
@@ -121,7 +127,7 @@
-
+
@@ -155,7 +161,7 @@
-
+
@@ -195,6 +201,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/models/generac/smdx_64206.xml b/models/generac/smdx_64206.xml
index 14eafbd..bdc7049 100644
--- a/models/generac/smdx_64206.xml
+++ b/models/generac/smdx_64206.xml
@@ -13,7 +13,7 @@
2
3
4
- 5
+ 5
6
7
8
@@ -28,7 +28,7 @@
17
18
19
- 20
+ 20
21
22
23
@@ -36,6 +36,12 @@
25
26
27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
0
@@ -207,7 +213,7 @@
Configure for Puerto Rico (PREPA) settings.
-
+
Configure ISO New England settings.
@@ -248,7 +254,7 @@
-
+
@@ -282,7 +288,7 @@
-
+
@@ -322,6 +328,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/models/generac/smdx_64259.xml b/models/generac/smdx_64259.xml
index 13f6380..b224fe7 100644
--- a/models/generac/smdx_64259.xml
+++ b/models/generac/smdx_64259.xml
@@ -1,7 +1,7 @@
-
-
+
+
0
@@ -61,8 +61,15 @@
-
-
+
+
+
+
+
+
+
+
+
@@ -286,5 +293,45 @@
Estimated maximum amount of power the site is capable of sourcing at present
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/models/generac/smdx_64260.xml b/models/generac/smdx_64260.xml
index 09c8803..a14e432 100644
--- a/models/generac/smdx_64260.xml
+++ b/models/generac/smdx_64260.xml
@@ -1,5 +1,5 @@
-
+
@@ -18,7 +18,7 @@
-
+
Set/get device's local time zone
diff --git a/models/generac/smdx_64268.xml b/models/generac/smdx_64268.xml
index 47ec366..e299b00 100644
--- a/models/generac/smdx_64268.xml
+++ b/models/generac/smdx_64268.xml
@@ -1,71 +1,64 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
0
1
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
0
1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -76,12 +69,12 @@
- The average grid voltage as reported by the GSL
+ The average grid voltage as reported by the GSL - when the ATS is grid connected, these measurements are taken from the AC input of the inverter, while when the ATS is not grid connected, the measurements are taken from the interconnect via the CTs and ATS connection to the inverter
- The grid frequency as reported by the GSL
+ The grid frequency as reported by the GSL - this is calculated using the voltage measurements' period
@@ -106,7 +99,7 @@
- The frequency watt control algorithm's active status
+ Active status of the frequency watt control algorithm
@@ -130,7 +123,7 @@
-
+
The target for reactive power based on the constant reactive power command
@@ -171,7 +164,7 @@
- Positive and negative threshold for reactive amps target
+ The absolute threshold for the reactive amps target
@@ -186,7 +179,7 @@
- Reactive amps target from GSL
+ Target for reactive amps from GSL
@@ -209,104 +202,54 @@
Integral form of the reactive amps target
-
-
+
+
Target from divy - total
-
-
- Target from divy - phase 1 component
-
-
-
-
- Target from divy - phase 2 component
-
-
Restricts all combined real and reactive amps from exceeding this limit
-
-
- Negative real power limit for phase 1
-
-
-
-
- Negative real power limit for phase 2
-
-
-
-
- Positive real power limit for phase 1
-
-
-
-
- Positive real power limit for phase 2
-
-
-
-
- Real power target dependent on mode - phase 1 component
-
-
-
-
- Real power target dependent on mode - phase 2 component
-
-
-
-
- Amps required to reach the real power target - phase 1 component
-
-
-
-
- Amps required to reach the real power target - phase 2 component
-
-
-
-
- CT target for self supply for phase 1
+
+
+ Negative real power limit
-
-
- CT target for self supply for phase 2
+
+
+ Positive real power limit
-
-
- CT target for zero export for phase 1
+
+
+ Target for real power dependent on mode
-
-
- CT target for zero export for phase 2
+
+
+ Amps required to reach the target for real power
-
-
- CT target for zero import for phase 1
+
+
+ CT target for self supply
-
-
- CT target for zero import for phase 2
+
+
+ CT target for zero export
-
-
- CT target when generator connected for phase 1
+
+
+ CT target for zero import
-
-
- CT target when generator connected for phase 2
+
+
+ CT target when generator connected
diff --git a/models/manifest.xml b/models/manifest.xml
index 92df8cd..6f57ebf 100644
--- a/models/manifest.xml
+++ b/models/manifest.xml
@@ -101,8 +101,8 @@
-
-
+
+
@@ -123,12 +123,12 @@
-
-
+
+
-
+
diff --git a/src/main.rs b/src/main.rs
index 7348754..4f60b92 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -200,7 +200,7 @@ async fn main() {
match SunSpecUnit::new(u.addr.clone(), s.to_string()).await {
Ok(p) => devices.push(p),
Err(e) => {
- die(&format!("Unable to create connection to SunSpec Unit: {e}"));
+ error!("Unable to create connection to SunSpec Unit: {e}");
}
};
}