8 static const char *
const TAG =
"vbus.sensor";
10 static inline uint16_t get_u16(std::vector<uint8_t> &message,
int start) {
11 return (message[start + 1] << 8) + message[start];
14 static inline int16_t get_i16(std::vector<uint8_t> &message,
int start) {
15 return (int16_t) ((message[start + 1] << 8) + message[start]);
19 ESP_LOGCONFIG(TAG,
"Deltasol BS Plus:");
52 get_u16(message, 24) * 1000000);
61 ESP_LOGCONFIG(TAG,
"Deltasol BS 2009:");
102 ESP_LOGCONFIG(TAG,
"Deltasol C:");
134 get_u16(message, 20) * 1000000);
141 ESP_LOGCONFIG(TAG,
"Deltasol CS2:");
146 LOG_SENSOR(
" ",
"Pump Speed", this->pump_speed_sensor_);
147 LOG_SENSOR(
" ",
"Operating Hours", this->operating_hours_sensor_);
161 if (this->pump_speed_sensor_ !=
nullptr)
162 this->pump_speed_sensor_->publish_state(message[12]);
163 if (this->operating_hours_sensor_ !=
nullptr)
164 this->operating_hours_sensor_->publish_state(get_u16(message, 14));
172 ESP_LOGCONFIG(TAG,
"Deltasol CS Plus:");
177 LOG_SENSOR(
" ",
"Temperature 5", this->temperature5_sensor_);
185 LOG_SENSOR(
" ",
"Flow Rate", this->flow_rate_sensor_);
197 if (this->temperature5_sensor_ !=
nullptr)
198 this->temperature5_sensor_->publish_state(get_i16(message, 36) * 0.1f);
213 if (this->flow_rate_sensor_ !=
nullptr)
214 this->flow_rate_sensor_->publish_state(get_u16(message, 38));
218 ESP_LOGCONFIG(TAG,
"VBus Custom Sensor:");
220 ESP_LOGCONFIG(TAG,
" Source address: ANY");
222 ESP_LOGCONFIG(TAG,
" Source address: 0x%04x", this->
source_);
224 if (this->
dest_ == 0xffff) {
225 ESP_LOGCONFIG(TAG,
" Dest address: ANY");
227 ESP_LOGCONFIG(TAG,
" Dest address: 0x%04x", this->
dest_);
230 ESP_LOGCONFIG(TAG,
" Command: ANY");
232 ESP_LOGCONFIG(TAG,
" Command: 0x%04x", this->
command_);
234 ESP_LOGCONFIG(TAG,
" Sensors:");
236 LOG_SENSOR(
" ",
"-",
sensor);
242 sensor->parse_message(message);
246 this->publish_state(this->message_parser_(message));
void handle_message(std::vector< uint8_t > &message) override
void handle_message(std::vector< uint8_t > &message) override
void parse_message(std::vector< uint8_t > &message)
sensor::Sensor * heat_quantity_sensor_
sensor::Sensor * temperature4_sensor_
void dump_config() override
sensor::Sensor * pump_speed2_sensor_
void handle_message(std::vector< uint8_t > &message) override
sensor::Sensor * temperature1_sensor_
sensor::Sensor * temperature3_sensor_
void handle_message(std::vector< uint8_t > &message) override
void dump_config() override
void dump_config() override
void dump_config() override
void publish_state(float state)
Publish a new state to the front-end.
sensor::Sensor * time_sensor_
void handle_message(std::vector< uint8_t > &message) override
sensor::Sensor * operating_hours1_sensor_
void dump_config() override
sensor::Sensor * version_sensor_
void handle_message(std::vector< uint8_t > &message) override
Implementation of SPI Controller mode.
sensor::Sensor * temperature2_sensor_
sensor::Sensor * pump_speed1_sensor_
void dump_config() override
esphome::sensor::Sensor * sensor
sensor::Sensor * operating_hours2_sensor_