ESPHome  2024.3.2
vbus_sensor.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../vbus.h"
5 
6 namespace esphome {
7 namespace vbus {
8 
9 class DeltaSolBSPlusSensor : public VBusListener, public Component {
10  public:
11  void dump_config() override;
16  void set_pump_speed1_sensor(sensor::Sensor *sensor) { this->pump_speed1_sensor_ = sensor; }
17  void set_pump_speed2_sensor(sensor::Sensor *sensor) { this->pump_speed2_sensor_ = sensor; }
21  void set_time_sensor(sensor::Sensor *sensor) { this->time_sensor_ = sensor; }
22  void set_version_sensor(sensor::Sensor *sensor) { this->version_sensor_ = sensor; }
23 
24  protected:
36 
37  void handle_message(std::vector<uint8_t> &message) override;
38 };
39 
41  public:
42  void dump_config() override;
47  void set_pump_speed1_sensor(sensor::Sensor *sensor) { this->pump_speed1_sensor_ = sensor; }
48  void set_pump_speed2_sensor(sensor::Sensor *sensor) { this->pump_speed2_sensor_ = sensor; }
52  void set_time_sensor(sensor::Sensor *sensor) { this->time_sensor_ = sensor; }
53  void set_version_sensor(sensor::Sensor *sensor) { this->version_sensor_ = sensor; }
54 
55  protected:
67 
68  void handle_message(std::vector<uint8_t> &message) override;
69 };
70 
71 class DeltaSolCSensor : public VBusListener, public Component {
72  public:
73  void dump_config() override;
78  void set_pump_speed1_sensor(sensor::Sensor *sensor) { this->pump_speed1_sensor_ = sensor; }
79  void set_pump_speed2_sensor(sensor::Sensor *sensor) { this->pump_speed2_sensor_ = sensor; }
83  void set_time_sensor(sensor::Sensor *sensor) { this->time_sensor_ = sensor; }
84 
85  protected:
96 
97  void handle_message(std::vector<uint8_t> &message) override;
98 };
99 
100 class DeltaSolCS2Sensor : public VBusListener, public Component {
101  public:
102  void dump_config() override;
107  void set_pump_speed_sensor(sensor::Sensor *sensor) { this->pump_speed_sensor_ = sensor; }
108  void set_operating_hours_sensor(sensor::Sensor *sensor) { this->operating_hours_sensor_ = sensor; }
110  void set_version_sensor(sensor::Sensor *sensor) { this->version_sensor_ = sensor; }
111 
112  protected:
117  sensor::Sensor *pump_speed_sensor_{nullptr};
118  sensor::Sensor *operating_hours_sensor_{nullptr};
121 
122  void handle_message(std::vector<uint8_t> &message) override;
123 };
124 
126  public:
127  void dump_config() override;
132  void set_temperature5_sensor(sensor::Sensor *sensor) { this->temperature5_sensor_ = sensor; }
138  void set_time_sensor(sensor::Sensor *sensor) { this->time_sensor_ = sensor; }
139  void set_version_sensor(sensor::Sensor *sensor) { this->version_sensor_ = sensor; }
140  void set_flow_rate_sensor(sensor::Sensor *sensor) { this->flow_rate_sensor_ = sensor; }
141 
142  protected:
147  sensor::Sensor *temperature5_sensor_{nullptr};
155  sensor::Sensor *flow_rate_sensor_{nullptr};
156 
157  void handle_message(std::vector<uint8_t> &message) override;
158 };
159 
160 class VBusCustomSubSensor;
161 
162 class VBusCustomSensor : public VBusListener, public Component {
163  public:
164  void dump_config() override;
165  void set_sensors(std::vector<VBusCustomSubSensor *> sensors) { this->sensors_ = std::move(sensors); };
166 
167  protected:
168  std::vector<VBusCustomSubSensor *> sensors_;
169  void handle_message(std::vector<uint8_t> &message) override;
170 };
171 
173  public:
174  void set_message_parser(message_parser_t parser) { this->message_parser_ = std::move(parser); };
175  void parse_message(std::vector<uint8_t> &message);
176 
177  protected:
179 };
180 
181 } // namespace vbus
182 } // namespace esphome
void set_temperature4_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:131
void set_operating_hours1_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:18
void set_heat_quantity_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:82
void set_operating_hours2_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:50
void set_operating_hours1_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:49
void set_operating_hours2_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:136
void set_pump_speed1_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:16
void set_pump_speed1_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:133
void set_version_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:22
sensor::Sensor * heat_quantity_sensor_
Definition: vbus_sensor.h:33
sensor::Sensor * temperature4_sensor_
Definition: vbus_sensor.h:28
void set_temperature3_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:45
sensor::Sensor * pump_speed2_sensor_
Definition: vbus_sensor.h:30
void set_temperature1_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:103
void set_temperature4_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:46
void set_time_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:21
void set_temperature1_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:12
sensor::Sensor * temperature1_sensor_
Definition: vbus_sensor.h:25
void set_pump_speed1_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:78
std::function< float(std::vector< uint8_t > &)> message_parser_t
Definition: vbus.h:9
void set_temperature4_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:15
sensor::Sensor * temperature3_sensor_
Definition: vbus_sensor.h:27
void set_temperature2_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:104
void set_operating_hours1_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:80
void set_temperature3_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:130
void set_message_parser(message_parser_t parser)
Definition: vbus_sensor.h:174
void set_time_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:83
void set_flow_rate_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:140
void set_temperature4_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:77
void handle_message(std::vector< uint8_t > &message) override
Definition: vbus_sensor.cpp:33
void set_operating_hours2_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:19
void set_temperature3_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:76
void set_heat_quantity_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:137
void set_pump_speed2_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:134
void set_time_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:138
void set_temperature3_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:105
void set_operating_hours_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:108
void set_temperature1_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:43
void set_heat_quantity_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:109
void set_pump_speed_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:107
sensor::Sensor * operating_hours1_sensor_
Definition: vbus_sensor.h:31
void set_temperature1_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:74
void set_operating_hours1_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:135
void set_version_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:53
void set_sensors(std::vector< VBusCustomSubSensor *> sensors)
Definition: vbus_sensor.h:165
void set_heat_quantity_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:20
void set_heat_quantity_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:51
void set_pump_speed2_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:17
void set_temperature2_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:13
void set_operating_hours2_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:81
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
Definition: a01nyub.cpp:7
void set_time_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:52
sensor::Sensor * temperature2_sensor_
Definition: vbus_sensor.h:26
void set_pump_speed2_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:48
void set_pump_speed2_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:79
void set_temperature2_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:44
void set_temperature1_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:128
Base-class for all sensors.
Definition: sensor.h:57
sensor::Sensor * pump_speed1_sensor_
Definition: vbus_sensor.h:29
void set_temperature2_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:75
void set_temperature3_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:14
void set_version_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:110
void set_temperature5_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:132
void set_version_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:139
sensor::Sensor * operating_hours2_sensor_
Definition: vbus_sensor.h:32
void set_temperature2_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:129
void set_temperature4_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:106
void set_pump_speed1_sensor(sensor::Sensor *sensor)
Definition: vbus_sensor.h:47