Skip to content
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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ COPY db db
RUN cargo install --path .


FROM debian:bullseye-slim
RUN apt-get update && apt-get install -y libssl1.1 && rm -rf /var/lib/apt/lists/*
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y openssl && rm -rf /var/lib/apt/lists/*
Comment on lines -17 to +18

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice, might this help with the ssl build failures I was struggling with yesterday? The commits to master were trying to fix it, I ended up staying on an older rust compiler/clap version to work around it. I'll retry newer versions after merging this, hopefully it helps.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was getting ssl errors on startup and this is what fixed it for me.

COPY --from=builder /usr/local/cargo/bin/lxp-bridge /usr/local/bin/lxp-bridge
ENTRYPOINT ["lxp-bridge", "-c", "/etc/config.yaml"]
79 changes: 79 additions & 0 deletions src/home_assistant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,21 @@ impl Config {
name: "EPS Voltage",
..voltage.clone()
},
Entity {
key: "v_gen",
name: "Generator Voltage",
..voltage.clone()
},
Entity {
key: "v_eps_l1",
name: "EPS Voltage L1",
..voltage.clone()
},
Entity {
key: "v_eps_l2",
name: "EPS Voltage L2",
..voltage.clone()
},
Entity {
key: "f_ac",
name: "Grid Frequency",
Expand All @@ -288,13 +303,32 @@ impl Config {
name: "EPS Frequency",
..frequency.clone()
},
Entity {
key: "f_gen",
name: "Generator Frequency",
..frequency.clone()
},
Entity {
key: "s_eps",
name: "Apparent EPS Power",
device_class: Some("apparent_power"),
unit_of_measurement: Some("VA"),
..power.clone()
},
Entity {
key: "s_eps_l1",
name: "Apparent EPS Power L1",
device_class: Some("apparent_power"),
unit_of_measurement: Some("VA"),
..power.clone()
},
Entity {
key: "s_eps_l2",
name: "Apparent EPS Power L2",
device_class: Some("apparent_power"),
unit_of_measurement: Some("VA"),
..power.clone()
},
Entity {
key: "p_pv",
name: "PV Power (Array)",
Expand Down Expand Up @@ -360,6 +394,21 @@ impl Config {
name: "AC Charge Power",
..power.clone()
},
Entity {
key: "p_gen",
name: "Generator Power",
..power.clone()
},
Entity {
key: "p_eps_l1",
name: "EPS Power L1",
..power.clone()
},
Entity {
key: "p_eps_l2",
name: "EPS Power L2",
..power.clone()
},
Entity {
key: "e_pv_all",
name: "PV Generation (All time)",
Expand Down Expand Up @@ -470,6 +519,36 @@ impl Config {
name: "Energy of Inverter (Today)",
..energy.clone()
},
Entity {
key: "e_gen_all",
name: "Energy of Generator (All time)",
..energy.clone()
},
Entity {
key: "e_gen_day",
name: "Energy of Generator (Today)",
..energy.clone()
},
Entity {
key: "e_eps_l1_all",
name: "Energy of EPS L1 (All time)",
..energy.clone()
},
Entity {
key: "e_eps_l1_day",
name: "Energy of EPS L1 (Today)",
..energy.clone()
},
Entity {
key: "e_eps_l2_all",
name: "Energy of EPS L2 (All time)",
..energy.clone()
},
Entity {
key: "e_eps_l2_day",
name: "Energy of EPS L2 (Today)",
..energy.clone()
},
Entity {
key: "t_inner",
name: "Inverter Temperature",
Expand Down
42 changes: 42 additions & 0 deletions src/lxp/packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,22 @@ pub struct ReadInputAll {
pub e_gen_day: f64,
#[nom(Parse = "Utils::le_u32_div10")]
pub e_gen_all: f64,
#[nom(Parse = "Utils::le_u16_div10")]
pub v_eps_l1: f64,
#[nom(Parse = "Utils::le_u16_div10")]
pub v_eps_l2: f64,
pub p_eps_l1: u16,
pub p_eps_l2: u16,
pub s_eps_l1: u16,
pub s_eps_l2: u16,
#[nom(Parse = "Utils::le_u16_div10")]
pub e_eps_l1_day: f64,
#[nom(Parse = "Utils::le_u16_div10")]
pub e_eps_l2_day: f64,
#[nom(Parse = "Utils::le_u32_div10")]
pub e_eps_l1_all: f64,
#[nom(Parse = "Utils::le_u32_div10")]
pub e_eps_l2_all: f64,

// EPS data; unsure what this is

Expand Down Expand Up @@ -422,6 +438,22 @@ pub struct ReadInput4 {
pub e_gen_day: f64,
#[nom(Parse = "Utils::le_u32_div10")]
pub e_gen_all: f64,
#[nom(Parse = "Utils::le_u16_div10")]
pub v_eps_l1: f64,
#[nom(Parse = "Utils::le_u16_div10")]
pub v_eps_l2: f64,
pub p_eps_l1: u16,
pub p_eps_l2: u16,
pub s_eps_l1: u16,
pub s_eps_l2: u16,
#[nom(Parse = "Utils::le_u16_div10")]
pub e_eps_l1_day: f64,
#[nom(Parse = "Utils::le_u16_div10")]
pub e_eps_l2_day: f64,
#[nom(Parse = "Utils::le_u32_div10")]
pub e_eps_l1_all: f64,
#[nom(Parse = "Utils::le_u32_div10")]
pub e_eps_l2_all: f64,
// EPS data; unsure what this is
#[nom(Ignore)]
pub datalog: Serial,
Expand Down Expand Up @@ -552,6 +584,16 @@ impl ReadInputs {
p_gen: ri4.p_gen,
e_gen_day: ri4.e_gen_day,
e_gen_all: ri4.e_gen_all,
v_eps_l1: ri4.v_eps_l1,
v_eps_l2: ri4.v_eps_l2,
p_eps_l1: ri4.p_eps_l1,
p_eps_l2: ri4.p_eps_l2,
s_eps_l1: ri4.s_eps_l1,
s_eps_l2: ri4.s_eps_l2,
e_eps_l1_day: ri4.e_eps_l1_day,
e_eps_l2_day: ri4.e_eps_l2_day,
e_eps_l1_all: ri4.e_eps_l1_all,
e_eps_l2_all: ri4.e_eps_l2_all,
datalog: ri1.datalog,
time: ri1.time.clone(),
}),
Expand Down
1 change: 1 addition & 0 deletions src/mqtt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ impl Message {
["read", "inputs", "1"] => ReadInputs(inverter, 1),
["read", "inputs", "2"] => ReadInputs(inverter, 2),
["read", "inputs", "3"] => ReadInputs(inverter, 3),
["read", "inputs", "4"] => ReadInputs(inverter, 4),
["read", "input", register] => {
ReadInput(inverter, register.parse()?, self.payload_int_or_1()?)
}
Expand Down