From 0dddf674ab615e5fe102f6367c187f4c3da6ed5d Mon Sep 17 00:00:00 2001 From: Alastair D'Silva Date: Fri, 30 Aug 2024 04:28:53 +0000 Subject: [PATCH 1/4] Simplify LED ops Signed-off-by: Alastair D'Silva --- InverterMonitor.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/InverterMonitor.h b/InverterMonitor.h index 4450f05..c1ab7f4 100644 --- a/InverterMonitor.h +++ b/InverterMonitor.h @@ -51,7 +51,6 @@ class InverterMonitor : public PollingComponent private: ABBAurora *inverter; - bool led_state; uint8_t connection = 0; public: @@ -81,7 +80,6 @@ class InverterMonitor : public PollingComponent { ESP_LOGD(TAG, "Setupping"); pinMode(LED, OUTPUT); - led_state = LOW; ABBAurora::setup(INVERTER_MONITOR_SERIAL, RX, TX, TX_CONTROL_GPIO); inverter = new ABBAurora(INVERTER_ADDRESS); connection_status->publish_state(DISCONNECTED); @@ -191,18 +189,12 @@ class InverterMonitor : public PollingComponent void turn_led_on() { - if (led_state) - return; - led_state = HIGH; - digitalWrite(LED, led_state); + digitalWrite(LED, HIGH); } void turn_led_off() { - if (!led_state) - return; - led_state = LOW; - digitalWrite(LED, led_state); + digitalWrite(LED, LOW); } }; From dd5ce7cb5befd0b10be62e62deb9bd56e9675b7d Mon Sep 17 00:00:00 2001 From: Alastair D'Silva Date: Fri, 30 Aug 2024 04:30:03 +0000 Subject: [PATCH 2/4] Fix typos in log messages Signed-off-by: Alastair D'Silva --- InverterMonitor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InverterMonitor.h b/InverterMonitor.h index c1ab7f4..b41e31a 100644 --- a/InverterMonitor.h +++ b/InverterMonitor.h @@ -78,7 +78,7 @@ class InverterMonitor : public PollingComponent void setup() override { - ESP_LOGD(TAG, "Setupping"); + ESP_LOGD(TAG, "Setting up"); pinMode(LED, OUTPUT); ABBAurora::setup(INVERTER_MONITOR_SERIAL, RX, TX, TX_CONTROL_GPIO); inverter = new ABBAurora(INVERTER_ADDRESS); @@ -183,7 +183,7 @@ class InverterMonitor : public PollingComponent connection = 0; connection_status->publish_state(DISCONNECTED); } - ESP_LOGD(TAG, "Inverter not conntected"); + ESP_LOGD(TAG, "Inverter not connected"); } } From 6b50192242b3a40ee4fee5199cb942623fbb7a4e Mon Sep 17 00:00:00 2001 From: Alastair D'Silva Date: Fri, 30 Aug 2024 05:46:35 +0000 Subject: [PATCH 3/4] Add all DSP values Signed-off-by: Alastair D'Silva --- ABBAuroraEnums.h | 4 +- InverterMonitor.h | 198 ++++++++++++++-------- config.yaml | 422 +++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 540 insertions(+), 84 deletions(-) diff --git a/ABBAuroraEnums.h b/ABBAuroraEnums.h index 0c284bc..198152a 100644 --- a/ABBAuroraEnums.h +++ b/ABBAuroraEnums.h @@ -59,8 +59,8 @@ enum DSP_VALUE_TYPE enum DSP_GLOBAL { - GLOBAL_MESSUREMENT = 1, - MODULE_MESSUREMENT = 0, + GLOBAL_MEASUREMENT = 1, + MODULE_MEASUREMENT = 0, }; enum CUMULATED_ENERGY_TYPE diff --git a/InverterMonitor.h b/InverterMonitor.h index b41e31a..91b0af8 100644 --- a/InverterMonitor.h +++ b/InverterMonitor.h @@ -75,6 +75,46 @@ class InverterMonitor : public PollingComponent Sensor *cumulated_energy_month = new Sensor(); Sensor *cumulated_energy_year = new Sensor(); Sensor *cumulated_energy_total = new Sensor(); + Sensor *grid_voltage = new Sensor(); + Sensor *grid_current = new Sensor(); + Sensor *grid_power = new Sensor(); + Sensor *frequency = new Sensor(); + Sensor *v_bulk = new Sensor(); + Sensor *i_leak_dc_dc = new Sensor(); + Sensor *i_leak_inverter = new Sensor(); + Sensor *dc_dc_grid_voltage = new Sensor(); + Sensor *dc_dc_grid_frequency = new Sensor(); + Sensor *isolation_resistance = new Sensor(); + Sensor *dc_dc_v_bulk = new Sensor(); + Sensor *average_grid_voltage = new Sensor(); + Sensor *v_bulk_mid = new Sensor(); + Sensor *grid_voltage_neutral = new Sensor(); + Sensor *wind_generator_frequency = new Sensor(); + Sensor *grid_voltage_neutral_phase = new Sensor(); + Sensor *grid_current_phase_r = new Sensor(); + Sensor *grid_current_phase_s = new Sensor(); + Sensor *grid_current_phase_t = new Sensor(); + Sensor *frequency_phase_r = new Sensor(); + Sensor *frequency_phase_s = new Sensor(); + Sensor *frequency_phase_t = new Sensor(); + Sensor *v_bulk_positive = new Sensor(); + Sensor *v_bulk_negative = new Sensor(); + Sensor *temperature_supervisor = new Sensor(); + Sensor *temperature_alim = new Sensor(); + Sensor *temperature_heat_sink = new Sensor(); + Sensor *temperature_1 = new Sensor(); + Sensor *temperature_2 = new Sensor(); + Sensor *temperature_3 = new Sensor(); + Sensor *fan_speed_1 = new Sensor(); + Sensor *fan_speed_2 = new Sensor(); + Sensor *fan_speed_3 = new Sensor(); + Sensor *fan_speed_4 = new Sensor(); + Sensor *fan_speed_5 = new Sensor(); + Sensor *power_saturation_limit = new Sensor(); + Sensor *v_panel_micro = new Sensor(); + Sensor *grid_voltage_phase_r = new Sensor(); + Sensor *grid_voltage_phase_s = new Sensor(); + Sensor *grid_voltage_phase_t = new Sensor(); void setup() override { @@ -85,6 +125,34 @@ class InverterMonitor : public PollingComponent connection_status->publish_state(DISCONNECTED); } + void publish_dsp_value(DSP_VALUE_TYPE type, Sensor *sensor) + { + if (inverter->ReadDSPValue(type, MODULE_MEASUREMENT)) { + ESP_LOGD(TAG, "ReadDSPValue %d %f", type, inverter->DSP.Value); + sensor->publish_state(inverter->DSP.Value); + } + yield(); + } + + void publish_temperature(DSP_VALUE_TYPE type, Sensor *sensor) + { + if (inverter->ReadDSPValue(type, MODULE_MEASUREMENT)) { + float temp = inverter->DSP.Value / 10; + ESP_LOGD(TAG, "ReadDSPValue %d %f", type, temp); + sensor->publish_state(temp); + } + yield(); + } + + void publish_cumulated_energy(CUMULATED_ENERGY_TYPE type, Sensor *sensor) + { + if (inverter->ReadCumulatedEnergy(type)) { + ESP_LOGD(TAG, "ReadCumulatedEnergy %d %f.0", type, inverter->CumulatedEnergy.Energy); + sensor->publish_state(inverter->CumulatedEnergy.Energy); + } + yield(); + } + void update() override { //If inverter is connected @@ -97,82 +165,62 @@ class InverterMonitor : public PollingComponent } turn_led_on(); - ESP_LOGD(TAG, "ReadDSPValue V_IN_1"); - if (inverter->ReadDSPValue(V_IN_1, MODULE_MESSUREMENT)) - v_in_1->publish_state(inverter->DSP.Value); - yield(); - - ESP_LOGD(TAG, "ReadDSPValue V_IN_2"); - if (inverter->ReadDSPValue(V_IN_2, MODULE_MESSUREMENT)) - v_in_2->publish_state(inverter->DSP.Value); - yield(); - - ESP_LOGD(TAG, "ReadDSPValue I_IN_1"); - if (inverter->ReadDSPValue(I_IN_1, MODULE_MESSUREMENT)) - i_in_1->publish_state(inverter->DSP.Value); - yield(); - - ESP_LOGD(TAG, "ReadDSPValue I_IN_2"); - if (inverter->ReadDSPValue(I_IN_2, MODULE_MESSUREMENT)) - i_in_2->publish_state(inverter->DSP.Value); - yield(); - - ESP_LOGD(TAG, "ReadDSPValue POWER_IN_1"); - if (inverter->ReadDSPValue(POWER_IN_1, MODULE_MESSUREMENT)) - power_in_1->publish_state(inverter->DSP.Value); - yield(); - - ESP_LOGD(TAG, "ReadDSPValue POWER_IN_2"); - if (inverter->ReadDSPValue(POWER_IN_2, MODULE_MESSUREMENT)) - power_in_2->publish_state(inverter->DSP.Value); - yield(); - + publish_dsp_value(V_IN_1, v_in_1); + publish_dsp_value(V_IN_2, v_in_2); + publish_dsp_value(I_IN_1, i_in_1); + publish_dsp_value(I_IN_2, i_in_2); + publish_dsp_value(POWER_IN_1, power_in_1); + publish_dsp_value(POWER_IN_2, power_in_2); power_in_total->publish_state(power_in_1->get_state() + power_in_2->get_state()); - - ESP_LOGD(TAG, "ReadDSPValue POWER_PEAK_TODAY"); - if (inverter->ReadDSPValue(POWER_PEAK_TODAY, MODULE_MESSUREMENT)) - power_peak_today->publish_state(inverter->DSP.Value); - yield(); - - ESP_LOGD(TAG, "ReadDSPValue POWER_PEAK"); - if (inverter->ReadDSPValue(POWER_PEAK, MODULE_MESSUREMENT)) - power_peak_max->publish_state(inverter->DSP.Value); - yield(); - - ESP_LOGD(TAG, "ReadDSPValue TEMPERATURE_INVERTER"); - if (inverter->ReadDSPValue(TEMPERATURE_INVERTER, MODULE_MESSUREMENT)) - temperature_inverter->publish_state(inverter->DSP.Value); - yield(); - - ESP_LOGD(TAG, "ReadDSPValue TEMPERATURE_BOOSTER"); - if (inverter->ReadDSPValue(TEMPERATURE_BOOSTER, MODULE_MESSUREMENT)) - temperature_booster->publish_state(inverter->DSP.Value); - yield(); - - ESP_LOGD(TAG, "ReadCumulatedEnergy CUMULATED_ENERGY_CURRENT_DAY"); - if (inverter->ReadCumulatedEnergy(CURRENT_DAY)) - cumulated_energy_today->publish_state(inverter->CumulatedEnergy.Energy); - yield(); - - ESP_LOGD(TAG, "ReadCumulatedEnergy CUMULATED_ENERGY_CURRENT_WEEK"); - if (inverter->ReadCumulatedEnergy(CURRENT_WEEK)) - cumulated_energy_week->publish_state(inverter->CumulatedEnergy.Energy); - yield(); - - ESP_LOGD(TAG, "ReadCumulatedEnergy CUMULATED_ENERGY_CURRENT_MONTH"); - if (inverter->ReadCumulatedEnergy(CURRENT_MONTH)) - cumulated_energy_month->publish_state(inverter->CumulatedEnergy.Energy); - yield(); - - ESP_LOGD(TAG, "ReadCumulatedEnergy CUMULATED_ENERGY_CURRENT_YEAR"); - if (inverter->ReadCumulatedEnergy(CURRENT_YEAR)) - cumulated_energy_year->publish_state(inverter->CumulatedEnergy.Energy); - yield(); - - ESP_LOGD(TAG, "ReadCumulatedEnergy CUMULATED_ENERGY_TOTAL"); - if (inverter->ReadCumulatedEnergy(TOTAL)) - cumulated_energy_total->publish_state(inverter->CumulatedEnergy.Energy); - yield(); + publish_dsp_value(POWER_PEAK_TODAY, power_peak_today); + publish_dsp_value(POWER_PEAK, power_peak_max); + publish_dsp_value(TEMPERATURE_INVERTER, temperature_inverter); + publish_dsp_value(TEMPERATURE_BOOSTER, temperature_booster); + publish_cumulated_energy(CURRENT_DAY, cumulated_energy_today); + publish_cumulated_energy(CURRENT_WEEK, cumulated_energy_week); + publish_cumulated_energy(CURRENT_MONTH, cumulated_energy_month); + publish_cumulated_energy(CURRENT_YEAR, cumulated_energy_year); + publish_cumulated_energy(TOTAL, cumulated_energy_total); + publish_dsp_value(GRID_VOLTAGE, grid_voltage); + publish_dsp_value(GRID_CURRENT, grid_current); + publish_dsp_value(GRID_POWER, grid_power); + publish_dsp_value(FREQUENCY, frequency); + publish_dsp_value(V_BULK, v_bulk); + publish_dsp_value(I_LEAK_DC_DC, i_leak_dc_dc); + publish_dsp_value(I_LEAK_INVERTER, i_leak_inverter); + publish_dsp_value(DC_DC_GRID_VOLTAGE, dc_dc_grid_voltage); + publish_dsp_value(DC_DC_GRID_FREQUENCY, dc_dc_grid_frequency); + publish_dsp_value(ISOLATION_RESISTANCE, isolation_resistance); + publish_dsp_value(DC_DC_V_BULK, dc_dc_v_bulk); + publish_dsp_value(AVERAGE_GRID_VOLTAGE, average_grid_voltage); + publish_dsp_value(V_BULK_MID, v_bulk_mid); + publish_dsp_value(GRID_VOLTAGE_NEUTRAL, grid_voltage_neutral); + publish_dsp_value(WIND_GENERATOR_FREQENCY, wind_generator_frequency); + publish_dsp_value(GRID_VOLTAGE_NEUTRAL_PHASE, grid_voltage_neutral_phase); + publish_dsp_value(GRID_CURRENT_PHASE_R, grid_current_phase_r); + publish_dsp_value(GRID_CURRENT_PHASE_S, grid_current_phase_s); + publish_dsp_value(GRID_CURRENT_PHASE_T, grid_current_phase_t); + publish_dsp_value(FREQUENCY_PHASE_R, frequency_phase_r); + publish_dsp_value(FREQUENCY_PHASE_S, frequency_phase_s); + publish_dsp_value(FREQUENCY_PHASE_T, frequency_phase_t); + publish_dsp_value(V_BULK_POSITIVE, v_bulk_positive); + publish_dsp_value(V_BULK_NEGATIVE, v_bulk_negative); + publish_temperature(TEMPERATURE_SUPERVISOR, temperature_supervisor); + publish_temperature(TEMPERATURE_ALIM, temperature_alim); + publish_temperature(TEMPERATURE_HEAT_SINK, temperature_heat_sink); + publish_temperature(TEMPERATURE_1, temperature_1); + publish_temperature(TEMPERATURE_2, temperature_2); + publish_temperature(TEMPERATURE_3, temperature_3); + publish_dsp_value(FAN_SPEED_1, fan_speed_1); + publish_dsp_value(FAN_SPEED_2, fan_speed_2); + publish_dsp_value(FAN_SPEED_3, fan_speed_3); + publish_dsp_value(FAN_SPEED_4, fan_speed_4); + publish_dsp_value(FAN_SPEED_5, fan_speed_5); + publish_dsp_value(POWER_SATURATION_LIMIT, power_saturation_limit); + publish_dsp_value(V_PANEL_MICRO, v_panel_micro); + publish_dsp_value(GRID_VOLTAGE_PHASE_R, grid_voltage_phase_r); + publish_dsp_value(GRID_VOLTAGE_PHASE_S, grid_voltage_phase_s); + publish_dsp_value(GRID_VOLTAGE_PHASE_T, grid_voltage_phase_t); turn_led_off(); } diff --git a/config.yaml b/config.yaml index 0afd1d6..c78c95b 100644 --- a/config.yaml +++ b/config.yaml @@ -42,6 +42,46 @@ sensor: App.register_sensor(monitor->cumulated_energy_month); App.register_sensor(monitor->cumulated_energy_year); App.register_sensor(monitor->cumulated_energy_total); + App.register_sensor(monitor->grid_voltage); + App.register_sensor(monitor->grid_current); + App.register_sensor(monitor->grid_power); + App.register_sensor(monitor->frequency); + App.register_sensor(monitor->v_bulk); + App.register_sensor(monitor->i_leak_dc_dc); + App.register_sensor(monitor->i_leak_inverter); + App.register_sensor(monitor->dc_dc_grid_voltage); + App.register_sensor(monitor->dc_dc_grid_frequency); + App.register_sensor(monitor->isolation_resistance); + App.register_sensor(monitor->dc_dc_v_bulk); + App.register_sensor(monitor->average_grid_voltage); + App.register_sensor(monitor->v_bulk_mid); + App.register_sensor(monitor->grid_voltage_neutral); + App.register_sensor(monitor->wind_generator_frequency); + App.register_sensor(monitor->grid_voltage_neutral_phase); + App.register_sensor(monitor->grid_current_phase_r); + App.register_sensor(monitor->grid_current_phase_s); + App.register_sensor(monitor->grid_current_phase_t); + App.register_sensor(monitor->frequency_phase_r); + App.register_sensor(monitor->frequency_phase_s); + App.register_sensor(monitor->frequency_phase_t); + App.register_sensor(monitor->v_bulk_positive); + App.register_sensor(monitor->v_bulk_negative); + App.register_sensor(monitor->temperature_supervisor); + App.register_sensor(monitor->temperature_alim); + App.register_sensor(monitor->temperature_heat_sink); + App.register_sensor(monitor->temperature_1); + App.register_sensor(monitor->temperature_2); + App.register_sensor(monitor->temperature_3); + App.register_sensor(monitor->fan_speed_1); + App.register_sensor(monitor->fan_speed_2); + App.register_sensor(monitor->fan_speed_3); + App.register_sensor(monitor->fan_speed_4); + App.register_sensor(monitor->fan_speed_5); + App.register_sensor(monitor->power_saturation_limit); + App.register_sensor(monitor->v_panel_micro); + App.register_sensor(monitor->grid_voltage_phase_r); + App.register_sensor(monitor->grid_voltage_phase_s); + App.register_sensor(monitor->grid_voltage_phase_t); return { monitor->v_in_1, @@ -59,111 +99,479 @@ sensor: monitor->cumulated_energy_week, monitor->cumulated_energy_month, monitor->cumulated_energy_year, - monitor->cumulated_energy_total + monitor->cumulated_energy_total, + monitor->grid_voltage, + monitor->grid_current, + monitor->grid_power, + monitor->frequency, + monitor->v_bulk, + monitor->i_leak_dc_dc, + monitor->i_leak_inverter, + monitor->dc_dc_grid_voltage, + monitor->dc_dc_grid_frequency, + monitor->isolation_resistance, + monitor->dc_dc_v_bulk, + monitor->average_grid_voltage, + monitor->v_bulk_mid, + monitor->grid_voltage_neutral, + monitor->wind_generator_frequency, + monitor->grid_voltage_neutral_phase, + monitor->grid_current_phase_r, + monitor->grid_current_phase_s, + monitor->grid_current_phase_t, + monitor->frequency_phase_r, + monitor->frequency_phase_s, + monitor->frequency_phase_t, + monitor->v_bulk_positive, + monitor->v_bulk_negative, + monitor->temperature_supervisor, + monitor->temperature_alim, + monitor->temperature_heat_sink, + monitor->temperature_1, + monitor->temperature_2, + monitor->temperature_3, + monitor->fan_speed_1, + monitor->fan_speed_2, + monitor->fan_speed_3, + monitor->fan_speed_4, + monitor->fan_speed_5, + monitor->power_saturation_limit, + monitor->v_panel_micro, + monitor->grid_voltage_phase_r, + monitor->grid_voltage_phase_s, }; - sensors: - #Voltage + sensors: - name: v_in_1 + id: v_in_1 unit_of_measurement: V accuracy_decimals: 2 icon: "mdi:lightning-bolt-outline" device_class: voltage state_class: measurement + - name: v_in_2 + id: v_in_2 unit_of_measurement: V accuracy_decimals: 2 icon: "mdi:lightning-bolt-outline" device_class: voltage state_class: measurement - #Current + - name: i_in_1 + id: i_in_1 unit_of_measurement: A accuracy_decimals: 2 icon: "mdi:current-ac" device_class: current state_class: measurement + - name: i_in_2 + id: i_in_2 unit_of_measurement: A accuracy_decimals: 2 icon: "mdi:current-ac" device_class: current state_class: measurement - #Power + - name: power_in_1 + id: power_in_1 unit_of_measurement: W accuracy_decimals: 0 icon: "mdi:solar-power" device_class: power state_class: measurement + - name: power_in_2 + id: power_in_2 unit_of_measurement: W accuracy_decimals: 0 icon: "mdi:solar-power" device_class: power state_class: measurement + - name: power_in_total + id: power_in_total unit_of_measurement: W accuracy_decimals: 0 icon: "mdi:solar-power" device_class: power state_class: measurement + - name: power_peak_today + id: power_peak_today unit_of_measurement: W accuracy_decimals: 0 icon: "mdi:solar-power" device_class: power state_class: measurement + - name: power_peak_max + id: power_peak_max unit_of_measurement: W accuracy_decimals: 0 icon: "mdi:solar-power" device_class: power state_class: measurement - #Temperatures + - name: inverter_temp + id: inverter_temp unit_of_measurement: "°C" accuracy_decimals: 2 icon: "mdi:thermometer" device_class: temperature state_class: measurement + - name: booster_temp + id: booster_temp unit_of_measurement: "°C" accuracy_decimals: 2 icon: "mdi:thermometer" device_class: temperature state_class: measurement - #Energy + - name: cumulated_energy_today + id: cumulated_energy_today unit_of_measurement: "Wh" accuracy_decimals: 0 icon: "mdi:car-battery" device_class: energy state_class: total_increasing + - name: cumulated_energy_week + id: cumulated_energy_week unit_of_measurement: "Wh" accuracy_decimals: 0 icon: "mdi:car-battery" device_class: energy state_class: total_increasing + - name: cumulated_energy_month + id: cumulated_energy_month unit_of_measurement: "Wh" accuracy_decimals: 0 icon: "mdi:car-battery" device_class: energy state_class: total_increasing + - name: cumulated_energy_year + id: cumulated_energy_year unit_of_measurement: "Wh" accuracy_decimals: 0 icon: "mdi:car-battery" device_class: energy state_class: total_increasing + - name: cumulated_energy_total + id: cumulated_energy_total unit_of_measurement: "Wh" accuracy_decimals: 0 icon: "mdi:car-battery" device_class: energy state_class: total_increasing + - name: Grid Voltage + id: grid_voltage + unit_of_measurement: V + accuracy_decimals: 2 + icon: "mdi:flash" + device_class: voltage + state_class: measurement + + - name: Grid Current + id: grid_current + unit_of_measurement: A + accuracy_decimals: 2 + icon: "mdi:current-ac" + device_class: current + state_class: measurement + + - name: Grid Power + id: grid_power + unit_of_measurement: W + accuracy_decimals: 0 + icon: "mdi:flash" + device_class: power + state_class: measurement + + - name: Frequency + id: frequency + unit_of_measurement: Hz + accuracy_decimals: 2 + icon: "mdi:sine-wave" + device_class: frequency + state_class: measurement + + - name: Bulk Voltage + id: v_bulk + unit_of_measurement: V + accuracy_decimals: 2 + icon: "mdi:flash" + device_class: voltage + state_class: measurement + + - name: DC-DC Grid Voltage + id: dc_dc_grid_voltage + unit_of_measurement: V + accuracy_decimals: 2 + icon: "mdi:flash" + device_class: voltage + state_class: measurement + + - name: DC-DC Grid Frequency + id: dc_dc_grid_frequency + unit_of_measurement: Hz + accuracy_decimals: 2 + icon: "mdi:sine-wave" + device_class: frequency + state_class: measurement + + - name: Isolation Resistance + id: isolation_resistance + unit_of_measurement: Ohm + accuracy_decimals: 2 + icon: "mdi:resistor" + device_class: voltage + state_class: measurement + + - name: DC-DC V Bulk + id: dc_dc_v_bulk + unit_of_measurement: V + accuracy_decimals: 2 + icon: "mdi:flash" + device_class: voltage + state_class: measurement + + - name: Average Grid Voltage + id: average_grid_voltage + unit_of_measurement: V + accuracy_decimals: 2 + icon: "mdi:flash" + device_class: voltage + state_class: measurement + + - name: Bulk Mid Voltage + id: v_bulk_mid + unit_of_measurement: V + accuracy_decimals: 2 + icon: "mdi:flash" + device_class: voltage + state_class: measurement + + - name: Grid Voltage Neutral + id: grid_voltage_neutral + unit_of_measurement: V + accuracy_decimals: 2 + icon: "mdi:flash" + device_class: voltage + state_class: measurement + + - name: Wind Generator Frequency + id: wind_generator_frequency + unit_of_measurement: Hz + accuracy_decimals: 2 + icon: "mdi:sine-wave" + device_class: frequency + state_class: measurement + + - name: Grid Voltage Neutral Phase + id: grid_voltage_neutral_phase + unit_of_measurement: V + accuracy_decimals: 2 + icon: "mdi:flash" + device_class: voltage + state_class: measurement + + - name: Grid Current Phase R + id: grid_current_phase_r + unit_of_measurement: A + accuracy_decimals: 2 + icon: "mdi:current-ac" + device_class: current + state_class: measurement + + - name: Grid Current Phase S + id: grid_current_phase_s + unit_of_measurement: A + accuracy_decimals: 2 + icon: "mdi:current-ac" + device_class: current + state_class: measurement + + - name: Grid Current Phase T + id: grid_current_phase_t + unit_of_measurement: A + accuracy_decimals: 2 + icon: "mdi:current-ac" + device_class: current + state_class: measurement + + - name: Frequency Phase R + id: frequency_phase_r + unit_of_measurement: Hz + accuracy_decimals: 2 + icon: "mdi:sine-wave" + device_class: frequency + state_class: measurement + + - name: Frequency Phase S + id: frequency_phase_s + unit_of_measurement: Hz + accuracy_decimals: 2 + icon: "mdi:sine-wave" + device_class: frequency + state_class: measurement + + - name: Frequency Phase T + id: frequency_phase_t + unit_of_measurement: Hz + accuracy_decimals: 2 + icon: "mdi:sine-wave" + device_class: frequency + state_class: measurement + + - name: Bulk Voltage Positive + id: v_bulk_positive + unit_of_measurement: V + accuracy_decimals: 2 + icon: "mdi:flash" + device_class: voltage + state_class: measurement + + - name: Bulk Voltage Negative + id: v_bulk_negative + unit_of_measurement: V + accuracy_decimals: 2 + icon: "mdi:flash" + device_class: voltage + + - name: Temperature Supervisor + id: temperature_supervisor + unit_of_measurement: "°C" + accuracy_decimals: 2 + icon: "mdi:thermometer" + device_class: temperature + state_class: measurement + + - name: Temperature Alim + id: temperature_alim + unit_of_measurement: "°C" + accuracy_decimals: 2 + icon: "mdi:thermometer" + device_class: temperature + state_class: measurement + + - name: Temperature Heat Sink + id: temperature_heat_sink + unit_of_measurement: "°C" + accuracy_decimals: 2 + icon: "mdi:thermometer" + device_class: temperature + state_class: measurement + + - name: Temperature 1 + id: temperature_1 + unit_of_measurement: "°C" + accuracy_decimals: 2 + icon: "mdi:thermometer" + device_class: temperature + state_class: measurement + + - name: Temperature 2 + id: temperature_2 + unit_of_measurement: "°C" + accuracy_decimals: 2 + icon: "mdi:thermometer" + device_class: temperature + state_class: measurement + + - name: Temperature 3 + id: temperature_3 + unit_of_measurement: "°C" + accuracy_decimals: 2 + icon: "mdi:thermometer" + device_class: temperature + state_class: measurement + + - name: Fan Speed 1 + id: fan_speed_1 + unit_of_measurement: RPM + accuracy_decimals: 0 + icon: "mdi:fan" + device_class: speed + state_class: measurement + + - name: Fan Speed 2 + id: fan_speed_2 + unit_of_measurement: RPM + accuracy_decimals: 0 + icon: "mdi:fan" + device_class: speed + state_class: measurement + + - name: Fan Speed 3 + id: fan_speed_3 + unit_of_measurement: RPM + accuracy_decimals: 0 + icon: "mdi:fan" + device_class: speed + state_class: measurement + + - name: Fan Speed 4 + id: fan_speed_4 + unit_of_measurement: RPM + accuracy_decimals: 0 + icon: "mdi:fan" + device_class: speed + state_class: measurement + + - name: Fan Speed 5 + id: fan_speed_5 + unit_of_measurement: RPM + accuracy_decimals: 0 + icon: "mdi:fan" + device_class: speed + state_class: measurement + + - name: Power Saturation Limit + id: power_saturation_limit + unit_of_measurement: W + accuracy_decimals: 0 + icon: "mdi:flash" + device_class: power + state_class: measurement + + - name: Panel Micro Voltage + id: v_panel_micro + unit_of_measurement: V + accuracy_decimals: 2 + icon: "mdi:flash" + device_class: voltage + state_class: measurement + + - name: Grid Voltage Phase R + id: grid_voltage_phase_r + unit_of_measurement: V + accuracy_decimals: 2 + icon: "mdi:flash" + device_class: voltage + state_class: measurement + + - name: Grid Voltage Phase S + id: grid_voltage_phase_s + unit_of_measurement: V + accuracy_decimals: 2 + icon: "mdi:flash" + device_class: voltage + state_class: measurement + + - name: Grid Voltage Phase T + id: grid_voltage_phase_t + unit_of_measurement: V + accuracy_decimals: 2 + icon: "mdi:flash" + device_class: voltage + state_class: measurement + text_sensor: - platform: custom lambda: |- From b78f967679bba77c651741f5dc57aef9788ee51c Mon Sep 17 00:00:00 2001 From: Alastair D'Silva Date: Fri, 30 Aug 2024 06:01:01 +0000 Subject: [PATCH 4/4] Reduce polling frequency At the default baud of 19200, it takes around 4 seconds to read all values, so we can safely reduce the polling frequency to 5 seconds. Signed-off-by: Alastair D'Silva --- InverterMonitor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InverterMonitor.h b/InverterMonitor.h index 91b0af8..416e47d 100644 --- a/InverterMonitor.h +++ b/InverterMonitor.h @@ -46,7 +46,7 @@ class InverterMonitor : public PollingComponent { protected: - InverterMonitor() : PollingComponent(15000) {} + InverterMonitor() : PollingComponent(5000) {} static InverterMonitor *instance_; private: