ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
havells_solar.h
Go to the documentation of this file.
1#pragma once
2
6
7#include <span>
8
10
12 public:
13 void set_voltage_sensor(uint8_t phase, sensor::Sensor *voltage_sensor) {
14 this->phases_[phase].setup = true;
15 this->phases_[phase].voltage_sensor_ = voltage_sensor;
16 }
17 void set_current_sensor(uint8_t phase, sensor::Sensor *current_sensor) {
18 this->phases_[phase].setup = true;
19 this->phases_[phase].current_sensor_ = current_sensor;
20 }
21 void set_voltage_sensor_pv(uint8_t pv, sensor::Sensor *voltage_sensor) {
22 this->pvs_[pv].setup = true;
23 this->pvs_[pv].voltage_sensor_ = voltage_sensor;
24 }
25 void set_current_sensor_pv(uint8_t pv, sensor::Sensor *current_sensor) {
26 this->pvs_[pv].setup = true;
27 this->pvs_[pv].current_sensor_ = current_sensor;
28 }
29 void set_active_power_sensor_pv(uint8_t pv, sensor::Sensor *active_power_sensor) {
30 this->pvs_[pv].setup = true;
31 this->pvs_[pv].active_power_sensor_ = active_power_sensor;
32 }
34 sensor::Sensor *voltage_sampled_by_secondary_cpu_sensor) {
35 this->pvs_[pv].setup = true;
36 this->pvs_[pv].voltage_sampled_by_secondary_cpu_sensor_ = voltage_sampled_by_secondary_cpu_sensor;
37 }
38 void set_insulation_of_p_to_ground_sensor_pv(uint8_t pv, sensor::Sensor *insulation_of_p_to_ground_sensor) {
39 this->pvs_[pv].setup = true;
40 this->pvs_[pv].insulation_of_p_to_ground_sensor_ = insulation_of_p_to_ground_sensor;
41 }
43 SUB_SENSOR(active_power)
44 SUB_SENSOR(reactive_power)
45 SUB_SENSOR(today_production)
46 SUB_SENSOR(total_energy_production)
47 SUB_SENSOR(total_generation_time)
48 SUB_SENSOR(today_generation_time)
49 SUB_SENSOR(inverter_module_temp)
50 SUB_SENSOR(inverter_inner_temp)
51 SUB_SENSOR(inverter_bus_voltage)
52 SUB_SENSOR(insulation_pv_n_to_ground)
53 SUB_SENSOR(gfci_value)
54 SUB_SENSOR(dci_of_r)
55 SUB_SENSOR(dci_of_s)
56 SUB_SENSOR(dci_of_t)
57
58 void update() override;
59
60 void on_read_holding_registers(uint16_t start_address, std::span<const uint16_t> registers,
61 modbus::ResponseStatus status) override;
62
63 void dump_config() override;
64
65 protected:
79};
80
81} // namespace esphome::havells_solar
uint16_le_t frequency
Definition bl0942.h:6
This class simplifies creating components that periodically check a state.
Definition component.h:532
virtual void update()=0
void set_insulation_of_p_to_ground_sensor_pv(uint8_t pv, sensor::Sensor *insulation_of_p_to_ground_sensor)
void set_current_sensor_pv(uint8_t pv, sensor::Sensor *current_sensor)
void on_read_holding_registers(uint16_t start_address, std::span< const uint16_t > registers, modbus::ResponseStatus status) override
void set_active_power_sensor_pv(uint8_t pv, sensor::Sensor *active_power_sensor)
void set_voltage_sampled_by_secondary_cpu_sensor_pv(uint8_t pv, sensor::Sensor *voltage_sampled_by_secondary_cpu_sensor)
struct esphome::havells_solar::HavellsSolar::HAVELLSPV pvs_[2]
void set_voltage_sensor(uint8_t phase, sensor::Sensor *voltage_sensor)
void set_voltage_sensor_pv(uint8_t pv, sensor::Sensor *voltage_sensor)
struct esphome::havells_solar::HavellsSolar::HAVELLSPhase phases_[3]
SUB_SENSOR(frequency) SUB_SENSOR(active_power) SUB_SENSOR(reactive_power) SUB_SENSOR(today_production) SUB_SENSOR(total_energy_production) SUB_SENSOR(total_generation_time) SUB_SENSOR(today_generation_time) SUB_SENSOR(inverter_module_temp) SUB_SENSOR(inverter_inner_temp) SUB_SENSOR(inverter_bus_voltage) SUB_SENSOR(insulation_pv_n_to_ground) SUB_SENSOR(gfci_value) SUB_SENSOR(dci_of_r) SUB_SENSOR(dci_of_s) SUB_SENSOR(dci_of_t) void update() override
void set_current_sensor(uint8_t phase, sensor::Sensor *current_sensor)
Base-class for all sensors.
Definition sensor.h:48
std::optional< ExceptionCode > ResponseStatus
Definition modbus.h:329