-
Notifications
You must be signed in to change notification settings - Fork 25
/
driver_c5isf.h
executable file
·36 lines (29 loc) · 1.07 KB
/
driver_c5isf.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
Based on: https://github.com/wmbusmeters/wmbusmeters/blob/master/src/driver_c5isf.cc
Copyright (C) 2017-2022 Fredrik Öhrström (gpl-3.0-or-later)
*/
#pragma once
#include "driver.h"
#include <vector>
#include <string>
struct C5isf: Driver
{
C5isf(std::string key = "") : Driver(std::string("c5isf"), key) {};
virtual esphome::optional<std::map<std::string, double>> get_values(std::vector<unsigned char> &telegram) override {
std::map<std::string, double> ret_val{};
add_to_map(ret_val, "total_heating_kwh", this->get_0C0E(telegram));
add_to_map(ret_val, "total_heating_kwh", this->get_0C03(telegram));
add_to_map(ret_val, "total_water_m3", this->get_0C13(telegram));
add_to_map(ret_val, "flow_temperature_c", this->get_0A5A(telegram));
add_to_map(ret_val, "return_temperature_c", this->get_0A5E(telegram));
add_to_map(ret_val, "power_kw", this->get_0B2D(telegram));
add_to_map(ret_val, "volume_flow_lh", this->get_0B3B(telegram));
if (ret_val.size() > 0) {
return ret_val;
}
else {
return {};
}
};
private:
};