21 if (sensor ==
nullptr)
24 sensor->publish_state(*
value);
27 for (uint8_t i = 0; i < 3; i++) {
31 publish(SDM_PHASE_1_VOLTAGE + i * 2, phase.voltage_sensor_);
32 publish(SDM_PHASE_1_CURRENT + i * 2, phase.current_sensor_);
33 publish(SDM_PHASE_1_ACTIVE_POWER + i * 2, phase.active_power_sensor_);
34 publish(SDM_PHASE_1_APPARENT_POWER + i * 2, phase.apparent_power_sensor_);
35 publish(SDM_PHASE_1_REACTIVE_POWER + i * 2, phase.reactive_power_sensor_);
36 publish(SDM_PHASE_1_POWER_FACTOR + i * 2, phase.power_factor_sensor_);
37 publish(SDM_PHASE_1_ANGLE + i * 2, phase.phase_angle_sensor_);
40 publish(SDM_TOTAL_SYSTEM_POWER, this->total_power_sensor_);
41 publish(SDM_FREQUENCY, this->frequency_sensor_);
42 publish(SDM_IMPORT_ACTIVE_ENERGY, this->import_active_energy_sensor_);
43 publish(SDM_EXPORT_ACTIVE_ENERGY, this->export_active_energy_sensor_);
44 publish(SDM_IMPORT_REACTIVE_ENERGY, this->import_reactive_energy_sensor_);
45 publish(SDM_EXPORT_REACTIVE_ENERGY, this->export_reactive_energy_sensor_);
54 for (uint8_t i = 0; i < 3; i++) {
58 ESP_LOGCONFIG(TAG,
" Phase %c", i +
'A');
59 LOG_SENSOR(
" ",
"Voltage", phase.voltage_sensor_);
60 LOG_SENSOR(
" ",
"Current", phase.current_sensor_);
61 LOG_SENSOR(
" ",
"Active Power", phase.active_power_sensor_);
62 LOG_SENSOR(
" ",
"Apparent Power", phase.apparent_power_sensor_);
63 LOG_SENSOR(
" ",
"Reactive Power", phase.reactive_power_sensor_);
64 LOG_SENSOR(
" ",
"Power Factor", phase.power_factor_sensor_);
65 LOG_SENSOR(
" ",
"Phase Angle", phase.phase_angle_sensor_);
67 LOG_SENSOR(
" ",
"Total Power", this->total_power_sensor_);
68 LOG_SENSOR(
" ",
"Frequency", this->frequency_sensor_);
69 LOG_SENSOR(
" ",
"Import Active Energy", this->import_active_energy_sensor_);
70 LOG_SENSOR(
" ",
"Export Active Energy", this->export_active_energy_sensor_);
71 LOG_SENSOR(
" ",
"Import Reactive Energy", this->import_reactive_energy_sensor_);
72 LOG_SENSOR(
" ",
"Export Reactive Energy", this->export_reactive_energy_sensor_);