8 namespace kamstrup_kmp {
58 static const uint16_t CMD_HEAT_ENERGY = 0x003C;
59 static const uint16_t CMD_POWER = 0x0050;
60 static const uint16_t CMD_TEMP1 = 0x0056;
61 static const uint16_t CMD_TEMP2 = 0x0057;
62 static const uint16_t CMD_TEMP_DIFF = 0x0059;
63 static const uint16_t CMD_FLOW = 0x004A;
64 static const uint16_t CMD_VOLUME = 0x0044;
67 static const char *
const UNITS[] = {
68 "",
"Wh",
"kWh",
"MWh",
"GWh",
"J",
"kJ",
"MJ",
"GJ",
"Cal",
69 "kCal",
"Mcal",
"Gcal",
"varh",
"kvarh",
"Mvarh",
"Gvarh",
"VAh",
"kVAh",
"MVAh",
70 "GVAh",
"kW",
"kW",
"MW",
"GW",
"kvar",
"kvar",
"Mvar",
"Gvar",
"VA",
71 "kVA",
"MVA",
"GVA",
"V",
"A",
"kV",
"kA",
"C",
"K",
"l",
72 "m3",
"l/h",
"m3/h",
"m3xC",
"ton",
"ton/h",
"h",
"hh:mm:ss",
"yy:mm:dd",
"yyyy:mm:dd",
73 "mm:dd",
"",
"bar",
"RTC",
"ASCII",
"m3 x 10",
"ton x 10",
"GJ x 10",
"minutes",
"Bitfield",
74 "s",
"ms",
"days",
"RTC-Q",
"Datetime"};
void read_command_(uint16_t command)
void set_temp_diff_sensor(sensor::Sensor *sensor)
void set_heat_energy_sensor(sensor::Sensor *sensor)
sensor::Sensor * heat_energy_sensor_
std::queue< uint16_t > command_queue_
void send_message_(const uint8_t *msg, int msg_len)
sensor::Sensor * temp_diff_sensor_
void parse_command_message_(uint16_t command, const uint8_t *msg, int msg_len)
void clear_uart_rx_buffer_()
void set_temp2_sensor(sensor::Sensor *sensor)
This class simplifies creating components that periodically check a state.
float get_setup_priority() const override
void set_sensor_value_(uint16_t command, float value, uint8_t unit_idx)
std::vector< sensor::Sensor * > custom_sensors_
sensor::Sensor * temp1_sensor_
sensor::Sensor * power_sensor_
void set_temp1_sensor(sensor::Sensor *sensor)
void dump_config() override
void set_flow_sensor(sensor::Sensor *sensor)
sensor::Sensor * temp2_sensor_
void set_power_sensor(sensor::Sensor *sensor)
Implementation of SPI Controller mode.
Base-class for all sensors.
void send_command_(uint16_t command)
void add_custom_sensor(sensor::Sensor *sensor, uint16_t command)
void set_volume_sensor(sensor::Sensor *sensor)
std::vector< uint16_t > custom_commands_
uint16_t crc16_ccitt(const uint8_t *buffer, int len)
esphome::sensor::Sensor * sensor
sensor::Sensor * flow_sensor_
sensor::Sensor * volume_sensor_