9static inline uint16_t get_u16(std::vector<uint8_t> &
message,
int start) {
13static inline int16_t get_i16(std::vector<uint8_t> &
message,
int start) {
18 ESP_LOGCONFIG(TAG,
"Deltasol BS Plus:");
19 LOG_SENSOR(
" ",
"Temperature 1", this->temperature1_sensor_);
20 LOG_SENSOR(
" ",
"Temperature 2", this->temperature2_sensor_);
21 LOG_SENSOR(
" ",
"Temperature 3", this->temperature3_sensor_);
22 LOG_SENSOR(
" ",
"Temperature 4", this->temperature4_sensor_);
23 LOG_SENSOR(
" ",
"Pump Speed 1", this->pump_speed1_sensor_);
24 LOG_SENSOR(
" ",
"Pump Speed 2", this->pump_speed2_sensor_);
25 LOG_SENSOR(
" ",
"Operating Hours 1", this->operating_hours1_sensor_);
26 LOG_SENSOR(
" ",
"Operating Hours 2", this->operating_hours2_sensor_);
27 LOG_SENSOR(
" ",
"Heat Quantity", this->heat_quantity_sensor_);
28 LOG_SENSOR(
" ",
"System Time", this->time_sensor_);
29 LOG_SENSOR(
" ",
"FW Version", this->version_sensor_);
33 PUBLISH_STATE(this->temperature1_sensor_, get_i16(
message, 0) * 0.1f);
34 PUBLISH_STATE(this->temperature2_sensor_, get_i16(
message, 2) * 0.1f);
35 PUBLISH_STATE(this->temperature3_sensor_, get_i16(
message, 4) * 0.1f);
36 PUBLISH_STATE(this->temperature4_sensor_, get_i16(
message, 6) * 0.1f);
37 PUBLISH_STATE(this->pump_speed1_sensor_,
message[8]);
38 PUBLISH_STATE(this->pump_speed2_sensor_,
message[9]);
39 PUBLISH_STATE(this->operating_hours1_sensor_, get_u16(
message, 16));
40 PUBLISH_STATE(this->operating_hours2_sensor_, get_u16(
message, 18));
41 PUBLISH_STATE(this->heat_quantity_sensor_,
43 PUBLISH_STATE(this->time_sensor_, get_u16(
message, 12));
44 PUBLISH_STATE(this->version_sensor_, get_u16(
message, 26) * 0.01f);
48 ESP_LOGCONFIG(TAG,
"Deltasol BS 2009:");
49 LOG_SENSOR(
" ",
"Temperature 1", this->temperature1_sensor_);
50 LOG_SENSOR(
" ",
"Temperature 2", this->temperature2_sensor_);
51 LOG_SENSOR(
" ",
"Temperature 3", this->temperature3_sensor_);
52 LOG_SENSOR(
" ",
"Temperature 4", this->temperature4_sensor_);
53 LOG_SENSOR(
" ",
"Pump Speed 1", this->pump_speed1_sensor_);
54 LOG_SENSOR(
" ",
"Pump Speed 2", this->pump_speed2_sensor_);
55 LOG_SENSOR(
" ",
"Operating Hours 1", this->operating_hours1_sensor_);
56 LOG_SENSOR(
" ",
"Operating Hours 2", this->operating_hours2_sensor_);
57 LOG_SENSOR(
" ",
"Heat Quantity", this->heat_quantity_sensor_);
58 LOG_SENSOR(
" ",
"System Time", this->time_sensor_);
59 LOG_SENSOR(
" ",
"FW Version", this->version_sensor_);
63 PUBLISH_STATE(this->temperature1_sensor_, get_i16(
message, 0) * 0.1f);
64 PUBLISH_STATE(this->temperature2_sensor_, get_i16(
message, 2) * 0.1f);
65 PUBLISH_STATE(this->temperature3_sensor_, get_i16(
message, 4) * 0.1f);
66 PUBLISH_STATE(this->temperature4_sensor_, get_i16(
message, 6) * 0.1f);
67 PUBLISH_STATE(this->pump_speed1_sensor_,
message[8]);
68 PUBLISH_STATE(this->pump_speed2_sensor_,
message[12]);
69 PUBLISH_STATE(this->operating_hours1_sensor_, get_u16(
message, 10));
70 PUBLISH_STATE(this->operating_hours2_sensor_, get_u16(
message, 18));
71 PUBLISH_STATE(this->heat_quantity_sensor_, get_u16(
message, 28) + get_u16(
message, 30) * 1000);
72 PUBLISH_STATE(this->time_sensor_, get_u16(
message, 22));
73 PUBLISH_STATE(this->version_sensor_, get_u16(
message, 32) * 0.01f);
77 ESP_LOGCONFIG(TAG,
"Deltasol C:");
78 LOG_SENSOR(
" ",
"Temperature 1", this->temperature1_sensor_);
79 LOG_SENSOR(
" ",
"Temperature 2", this->temperature2_sensor_);
80 LOG_SENSOR(
" ",
"Temperature 3", this->temperature3_sensor_);
81 LOG_SENSOR(
" ",
"Temperature 4", this->temperature4_sensor_);
82 LOG_SENSOR(
" ",
"Pump Speed 1", this->pump_speed1_sensor_);
83 LOG_SENSOR(
" ",
"Pump Speed 2", this->pump_speed2_sensor_);
84 LOG_SENSOR(
" ",
"Operating Hours 1", this->operating_hours1_sensor_);
85 LOG_SENSOR(
" ",
"Operating Hours 2", this->operating_hours2_sensor_);
86 LOG_SENSOR(
" ",
"Heat Quantity", this->heat_quantity_sensor_);
87 LOG_SENSOR(
" ",
"System Time", this->time_sensor_);
91 PUBLISH_STATE(this->temperature1_sensor_, get_i16(
message, 0) * 0.1f);
92 PUBLISH_STATE(this->temperature2_sensor_, get_i16(
message, 2) * 0.1f);
93 PUBLISH_STATE(this->temperature3_sensor_, get_i16(
message, 4) * 0.1f);
94 PUBLISH_STATE(this->temperature4_sensor_, get_i16(
message, 6) * 0.1f);
95 PUBLISH_STATE(this->pump_speed1_sensor_,
message[8]);
96 PUBLISH_STATE(this->pump_speed2_sensor_,
message[9]);
97 PUBLISH_STATE(this->operating_hours1_sensor_, get_u16(
message, 12));
98 PUBLISH_STATE(this->operating_hours2_sensor_, get_u16(
message, 14));
99 PUBLISH_STATE(this->heat_quantity_sensor_,
101 PUBLISH_STATE(this->time_sensor_, get_u16(
message, 22));
105 ESP_LOGCONFIG(TAG,
"Deltasol CS2:");
106 LOG_SENSOR(
" ",
"Temperature 1", this->temperature1_sensor_);
107 LOG_SENSOR(
" ",
"Temperature 2", this->temperature2_sensor_);
108 LOG_SENSOR(
" ",
"Temperature 3", this->temperature3_sensor_);
109 LOG_SENSOR(
" ",
"Temperature 4", this->temperature4_sensor_);
110 LOG_SENSOR(
" ",
"Pump Speed", this->pump_speed_sensor_);
111 LOG_SENSOR(
" ",
"Operating Hours", this->operating_hours_sensor_);
112 LOG_SENSOR(
" ",
"Heat Quantity", this->heat_quantity_sensor_);
113 LOG_SENSOR(
" ",
"FW Version", this->version_sensor_);
117 PUBLISH_STATE(this->temperature1_sensor_, get_i16(
message, 0) * 0.1f);
118 PUBLISH_STATE(this->temperature2_sensor_, get_i16(
message, 2) * 0.1f);
119 PUBLISH_STATE(this->temperature3_sensor_, get_i16(
message, 4) * 0.1f);
120 PUBLISH_STATE(this->temperature4_sensor_, get_i16(
message, 6) * 0.1f);
121 PUBLISH_STATE(this->pump_speed_sensor_,
message[12]);
122 PUBLISH_STATE(this->operating_hours_sensor_, get_u16(
message, 14));
123 PUBLISH_STATE(this->heat_quantity_sensor_,
125 PUBLISH_STATE(this->version_sensor_, get_u16(
message, 28) * 0.01f);
129 ESP_LOGCONFIG(TAG,
"Deltasol CS4:");
130 LOG_SENSOR(
" ",
"Temperature 1", this->temperature1_sensor_);
131 LOG_SENSOR(
" ",
"Temperature 2", this->temperature2_sensor_);
132 LOG_SENSOR(
" ",
"Temperature 3", this->temperature3_sensor_);
133 LOG_SENSOR(
" ",
"Temperature 4", this->temperature4_sensor_);
134 LOG_SENSOR(
" ",
"Temperature 5", this->temperature5_sensor_);
135 LOG_SENSOR(
" ",
"Pump Speed 1", this->pump_speed1_sensor_);
136 LOG_SENSOR(
" ",
"Pump Speed 2", this->pump_speed2_sensor_);
137 LOG_SENSOR(
" ",
"Operating Hours 1", this->operating_hours1_sensor_);
138 LOG_SENSOR(
" ",
"Operating Hours 2", this->operating_hours2_sensor_);
139 LOG_SENSOR(
" ",
"Heat Quantity", this->heat_quantity_sensor_);
140 LOG_SENSOR(
" ",
"System Time", this->time_sensor_);
141 LOG_SENSOR(
" ",
"FW Version", this->version_sensor_);
142 LOG_SENSOR(
" ",
"Flow Rate", this->flow_rate_sensor_);
146 PUBLISH_STATE(this->temperature1_sensor_, get_i16(
message, 0) * 0.1f);
147 PUBLISH_STATE(this->temperature2_sensor_, get_i16(
message, 2) * 0.1f);
148 PUBLISH_STATE(this->temperature3_sensor_, get_i16(
message, 4) * 0.1f);
149 PUBLISH_STATE(this->temperature4_sensor_, get_i16(
message, 6) * 0.1f);
150 PUBLISH_STATE(this->temperature5_sensor_, get_i16(
message, 36) * 0.1f);
151 PUBLISH_STATE(this->pump_speed1_sensor_,
message[8]);
152 PUBLISH_STATE(this->pump_speed2_sensor_,
message[12]);
153 PUBLISH_STATE(this->operating_hours1_sensor_, get_u16(
message, 10));
154 PUBLISH_STATE(this->operating_hours2_sensor_, get_u16(
message, 14));
155 PUBLISH_STATE(this->heat_quantity_sensor_,
157 PUBLISH_STATE(this->time_sensor_, get_u16(
message, 22));
158 PUBLISH_STATE(this->version_sensor_, get_u16(
message, 32) * 0.01f);
159 PUBLISH_STATE(this->flow_rate_sensor_, get_u16(
message, 38));
163 ESP_LOGCONFIG(TAG,
"Deltasol CS Plus:");
164 LOG_SENSOR(
" ",
"Temperature 1", this->temperature1_sensor_);
165 LOG_SENSOR(
" ",
"Temperature 2", this->temperature2_sensor_);
166 LOG_SENSOR(
" ",
"Temperature 3", this->temperature3_sensor_);
167 LOG_SENSOR(
" ",
"Temperature 4", this->temperature4_sensor_);
168 LOG_SENSOR(
" ",
"Temperature 5", this->temperature5_sensor_);
169 LOG_SENSOR(
" ",
"Pump Speed 1", this->pump_speed1_sensor_);
170 LOG_SENSOR(
" ",
"Pump Speed 2", this->pump_speed2_sensor_);
171 LOG_SENSOR(
" ",
"Operating Hours 1", this->operating_hours1_sensor_);
172 LOG_SENSOR(
" ",
"Operating Hours 2", this->operating_hours2_sensor_);
173 LOG_SENSOR(
" ",
"Heat Quantity", this->heat_quantity_sensor_);
174 LOG_SENSOR(
" ",
"System Time", this->time_sensor_);
175 LOG_SENSOR(
" ",
"FW Version", this->version_sensor_);
176 LOG_SENSOR(
" ",
"Flow Rate", this->flow_rate_sensor_);
180 PUBLISH_STATE(this->temperature1_sensor_, get_i16(
message, 0) * 0.1f);
181 PUBLISH_STATE(this->temperature2_sensor_, get_i16(
message, 2) * 0.1f);
182 PUBLISH_STATE(this->temperature3_sensor_, get_i16(
message, 4) * 0.1f);
183 PUBLISH_STATE(this->temperature4_sensor_, get_i16(
message, 6) * 0.1f);
184 PUBLISH_STATE(this->temperature5_sensor_, get_i16(
message, 36) * 0.1f);
185 PUBLISH_STATE(this->pump_speed1_sensor_,
message[8]);
186 PUBLISH_STATE(this->pump_speed2_sensor_,
message[12]);
187 PUBLISH_STATE(this->operating_hours1_sensor_, get_u16(
message, 10));
188 PUBLISH_STATE(this->operating_hours2_sensor_, get_u16(
message, 14));
189 PUBLISH_STATE(this->heat_quantity_sensor_,
191 PUBLISH_STATE(this->time_sensor_, get_u16(
message, 22));
192 PUBLISH_STATE(this->version_sensor_, get_u16(
message, 32) * 0.01f);
193 PUBLISH_STATE(this->flow_rate_sensor_, get_u16(
message, 38));
197 ESP_LOGCONFIG(TAG,
"DeltaSol BS/2 (DrainBack):");
198 LOG_SENSOR(
" ",
"Temperature 1", this->temperature1_sensor_);
199 LOG_SENSOR(
" ",
"Temperature 2", this->temperature2_sensor_);
200 LOG_SENSOR(
" ",
"Temperature 3", this->temperature3_sensor_);
201 LOG_SENSOR(
" ",
"Temperature 4", this->temperature4_sensor_);
202 LOG_SENSOR(
" ",
"Pump Speed 1", this->pump_speed1_sensor_);
203 LOG_SENSOR(
" ",
"Pump Speed 2", this->pump_speed2_sensor_);
204 LOG_SENSOR(
" ",
"Operating Hours 1", this->operating_hours1_sensor_);
205 LOG_SENSOR(
" ",
"Operating Hours 2", this->operating_hours2_sensor_);
206 LOG_SENSOR(
" ",
"Heat Quantity", this->heat_quantity_sensor_);
207 LOG_SENSOR(
" ",
"FW Version", this->version_sensor_);
211 PUBLISH_STATE(this->temperature1_sensor_, get_i16(
message, 0) * 0.1f);
212 PUBLISH_STATE(this->temperature2_sensor_, get_i16(
message, 2) * 0.1f);
213 PUBLISH_STATE(this->temperature3_sensor_, get_i16(
message, 4) * 0.1f);
214 PUBLISH_STATE(this->temperature4_sensor_, get_i16(
message, 6) * 0.1f);
215 PUBLISH_STATE(this->pump_speed1_sensor_,
message[8]);
216 PUBLISH_STATE(this->pump_speed2_sensor_,
message[9]);
217 PUBLISH_STATE(this->operating_hours1_sensor_, get_u16(
message, 12));
218 PUBLISH_STATE(this->operating_hours2_sensor_, get_u16(
message, 14));
219 PUBLISH_STATE(this->heat_quantity_sensor_,
221 PUBLISH_STATE(this->version_sensor_, get_u16(
message, 24) * 0.01f);
225 ESP_LOGCONFIG(TAG,
"VBus Custom Sensor:");
227 ESP_LOGCONFIG(TAG,
" Source address: ANY");
229 ESP_LOGCONFIG(TAG,
" Source address: 0x%04x", this->
source_);
231 if (this->
dest_ == 0xffff) {
232 ESP_LOGCONFIG(TAG,
" Dest address: ANY");
234 ESP_LOGCONFIG(TAG,
" Dest address: 0x%04x", this->
dest_);
237 ESP_LOGCONFIG(TAG,
" Command: ANY");
239 ESP_LOGCONFIG(TAG,
" Command: 0x%04x", this->
command_);
241 ESP_LOGCONFIG(TAG,
" Sensors:");
243 LOG_SENSOR(
" ",
"-", sensor);
249 sensor->parse_message(
message);
void publish_state(float state)
Publish a new state to the front-end.
void dump_config() override
void dump_config() override
void dump_config() override
void dump_config() override
void dump_config() override
void dump_config() override
void dump_config() override
void handle_message(std::vector< uint8_t > &message) override
void dump_config() override
std::vector< VBusCustomSubSensor * > sensors_
void parse_message(std::vector< uint8_t > &message)
message_parser_t message_parser_
virtual void handle_message(std::vector< uint8_t > &message)=0
const LogString * message
ESPHOME_LOG_TAG(TAG, "vbus.binary_sensor")
constexpr T encode_value_le(const uint8_t *bytes)
Encode a value from its constituent bytes (from least to most significant) in an array with length si...