log some more fields
All checks were successful
Build .deb on release / Build-Deb (push) Successful in 1m53s
All checks were successful
Build .deb on release / Build-Deb (push) Successful in 1m53s
This commit is contained in:
parent
4e7f6a0616
commit
73b3a90462
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -2633,7 +2633,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tesla-charge-controller"
|
name = "tesla-charge-controller"
|
||||||
version = "1.0.26"
|
version = "1.0.27"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap 4.4.11",
|
"clap 4.4.11",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "tesla-charge-controller"
|
name = "tesla-charge-controller"
|
||||||
version = "1.0.26"
|
version = "1.0.27"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MITNFA"
|
license = "MITNFA"
|
||||||
description = "Controls Tesla charge rate based on solar charge data"
|
description = "Controls Tesla charge rate based on solar charge data"
|
||||||
|
|
|
@ -42,6 +42,11 @@ struct Metrics {
|
||||||
home: Gauge,
|
home: Gauge,
|
||||||
sentry_mode: Gauge,
|
sentry_mode: Gauge,
|
||||||
sentry_mode_available: Gauge,
|
sentry_mode_available: Gauge,
|
||||||
|
charger_actual_current: Gauge,
|
||||||
|
charger_phases: Gauge,
|
||||||
|
charger_pilot_current: Gauge,
|
||||||
|
charger_power: Gauge,
|
||||||
|
charger_voltage: Gauge,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Metrics {
|
impl Metrics {
|
||||||
|
@ -95,6 +100,17 @@ impl Metrics {
|
||||||
describe_gauge!("tesla_sentry_mode_available", "Sentry mode available");
|
describe_gauge!("tesla_sentry_mode_available", "Sentry mode available");
|
||||||
let sentry_mode_available = gauge!("tesla_sentry_mode_available");
|
let sentry_mode_available = gauge!("tesla_sentry_mode_available");
|
||||||
|
|
||||||
|
describe_gauge!("tesla_charger_actual_current", "Charger actual current");
|
||||||
|
let charger_actual_current = gauge!("tesla_charger_actual_current");
|
||||||
|
describe_gauge!("tesla_charger_phases", "Charger phases");
|
||||||
|
let charger_phases = gauge!("tesla_charger_phases");
|
||||||
|
describe_gauge!("tesla_charger_pilot_current", "Charger pilot current");
|
||||||
|
let charger_pilot_current = gauge!("tesla_charger_pilot_current");
|
||||||
|
describe_gauge!("tesla_charger_power", "Charger power");
|
||||||
|
let charger_power = gauge!("tesla_charger_power");
|
||||||
|
describe_gauge!("tesla_charger_voltage", "Charger voltage");
|
||||||
|
let charger_voltage = gauge!("tesla_charger_voltage");
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
battery_level,
|
battery_level,
|
||||||
charge_rate,
|
charge_rate,
|
||||||
|
@ -117,6 +133,11 @@ impl Metrics {
|
||||||
home,
|
home,
|
||||||
sentry_mode,
|
sentry_mode,
|
||||||
sentry_mode_available,
|
sentry_mode_available,
|
||||||
|
charger_actual_current,
|
||||||
|
charger_phases,
|
||||||
|
charger_pilot_current,
|
||||||
|
charger_power,
|
||||||
|
charger_voltage,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -425,6 +446,21 @@ impl TeslaInterface {
|
||||||
self.metrics
|
self.metrics
|
||||||
.charging_state
|
.charging_state
|
||||||
.set(new_charge_state.charging_state);
|
.set(new_charge_state.charging_state);
|
||||||
|
if let Some(v) = new_charge_state.charger_actual_current {
|
||||||
|
self.metrics.charger_actual_current.set(v as f64);
|
||||||
|
}
|
||||||
|
if let Some(v) = new_charge_state.charger_phases {
|
||||||
|
self.metrics.charger_phases.set(v as f64);
|
||||||
|
}
|
||||||
|
if let Some(v) = new_charge_state.charger_pilot_current {
|
||||||
|
self.metrics.charger_pilot_current.set(v as f64);
|
||||||
|
}
|
||||||
|
if let Some(v) = new_charge_state.charger_power {
|
||||||
|
self.metrics.charger_power.set(v as f64);
|
||||||
|
}
|
||||||
|
if let Some(v) = new_charge_state.charger_voltage {
|
||||||
|
self.metrics.charger_voltage.set(v as f64);
|
||||||
|
}
|
||||||
state.charge_state = Some(new_charge_state);
|
state.charge_state = Some(new_charge_state);
|
||||||
}
|
}
|
||||||
if let Some(new_location_data) = new_state.location_data {
|
if let Some(new_location_data) = new_state.location_data {
|
||||||
|
|
10
src/types.rs
10
src/types.rs
|
@ -82,6 +82,11 @@ pub struct ChargeState {
|
||||||
pub charge_enable_request: bool,
|
pub charge_enable_request: bool,
|
||||||
pub charging_state: ChargingState,
|
pub charging_state: ChargingState,
|
||||||
pub charge_limit_soc: i64,
|
pub charge_limit_soc: i64,
|
||||||
|
pub charger_actual_current: Option<i64>,
|
||||||
|
pub charger_phases: Option<i64>,
|
||||||
|
pub charger_pilot_current: Option<i64>,
|
||||||
|
pub charger_power: Option<i64>,
|
||||||
|
pub charger_voltage: Option<i64>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<teslatte::vehicles::ChargeState> for ChargeState {
|
impl From<teslatte::vehicles::ChargeState> for ChargeState {
|
||||||
|
@ -97,6 +102,11 @@ impl From<teslatte::vehicles::ChargeState> for ChargeState {
|
||||||
charge_enable_request: value.charge_enable_request,
|
charge_enable_request: value.charge_enable_request,
|
||||||
charging_state: value.charging_state,
|
charging_state: value.charging_state,
|
||||||
charge_limit_soc: value.charge_limit_soc,
|
charge_limit_soc: value.charge_limit_soc,
|
||||||
|
charger_actual_current: value.charger_actual_current,
|
||||||
|
charger_phases: value.charger_phases,
|
||||||
|
charger_pilot_current: value.charger_pilot_current,
|
||||||
|
charger_power: value.charger_power,
|
||||||
|
charger_voltage: value.charger_voltage,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue