-
-
Notifications
You must be signed in to change notification settings - Fork 93
/
boiler.h
294 lines (275 loc) · 14.6 KB
/
boiler.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
/*
* EMS-ESP - https://github.com/emsesp/EMS-ESP
* Copyright 2020 Paul Derbyshire
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EMSESP_BOILER_H
#define EMSESP_BOILER_H
#include "emsesp.h"
namespace emsesp {
class Boiler : public EMSdevice {
public:
Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const char * version, const std::string & name, uint8_t flags, uint8_t brand);
private:
static uuid::log::Logger logger_;
// specific boiler characteristics, stripping the top 4 bits
inline uint8_t model() const {
return (flags() & 0x0F);
}
void check_active(const bool force = false);
uint8_t boilerState_ = EMS_VALUE_UINT_NOTSET; // Boiler state flag - FOR INTERNAL USE
static constexpr uint8_t EMS_TYPE_UBASettingsWW = 0x26;
static constexpr uint8_t EMS_TYPE_UBAParameterWW = 0x33;
static constexpr uint8_t EMS_TYPE_UBAFunctionTest = 0x1D;
static constexpr uint8_t EMS_TYPE_UBAFlags = 0x35;
static constexpr uint8_t EMS_TYPE_UBASetPoints = 0x1A;
static constexpr uint8_t EMS_TYPE_UBAParameters = 0x16;
static constexpr uint8_t EMS_TYPE_UBAParametersPlus = 0xE6;
static constexpr uint8_t EMS_TYPE_UBAParameterWWPlus = 0xEA;
static constexpr uint16_t EMS_TYPE_UBAInformation = 0x495;
static constexpr uint16_t EMS_TYPE_UBAEnergySupplied = 0x494;
// ww
uint8_t wwSetTemp_; // DHW set temperature
uint8_t wwSelTemp_; // DHW selected temperature
uint8_t wwSelTempLow_; // DHW lower selected temperature
uint8_t wwSelTempOff_; // DHW selected temperature for off position
uint8_t wwSelTempSingle_; // DHW single charge temperature
uint8_t wwType_; // 0-off, 1-flow, 2-flowbuffer, 3-buffer, 4-layered buffer
uint8_t wwComfort_; // WW comfort mode
uint8_t wwComfort1_; // WW comfort mode RC310
uint8_t wwCircPump_; // DHW circulation pump available
uint8_t wwChargeType_; // DHW charge type (pump or 3-way-valve)
uint8_t wwChargeOptimization_; // DHW charge optimization
uint8_t wwDisinfectionTemp_; // DHW disinfection temperature to prevent infection
uint8_t wwCircMode_; // DHW circulation pump mode
uint8_t wwCirc_; // Circulation on/off
uint16_t wwCurTemp_; // DHW current temperature
uint16_t wwCurTemp2_; // DHW current temperature storage
uint8_t wwCurFlow_; // DHW current flow temp in l/min
uint16_t wwStorageTemp1_; // DHW storage temp 1
uint16_t wwStorageTemp2_; // DHW storage temp 2
uint8_t wwActivated_; // DHW activated
uint8_t wwOneTime_; // DHW one time function on/off
uint8_t wwDisinfect_; // DHW disinfection on/off
uint8_t wwCharging_; // DHW charging on/off
uint8_t wwRecharging_; // DHW recharge on/off
uint8_t wwTempOK_; // DHW temperature ok on/off
uint8_t wwActive_; //
uint8_t ww3wayValve_; // 3-way valve on WW
uint8_t wwSetPumpPower_; // ww pump speed/power?
uint8_t wwFlowTempOffset_; // Boiler offset for ww heating
uint8_t wwMaxPower_; // DHW maximum power
uint8_t wwMaxTemp_; // DHW maximum temperature
uint32_t wwStarts_; // DHW starts
uint32_t wwStarts2_; // DHW control starts
uint32_t wwWorkM_; // DHW minutes
int8_t wwHystOn_;
int8_t wwHystOff_;
uint8_t wwTapActivated_; // maintenance-mode to switch DHW off
uint16_t wwMixerTemp_; // mixing temperature
uint16_t wwCylMiddleTemp_; // Cyl middle temperature (TS3)
// main
uint8_t reset_; // for reset command
uint8_t heatingActive_; // Central heating is on/off
uint8_t tapwaterActive_; // Hot tap water is on/off
uint8_t selFlowTemp_; // Selected flow temperature
uint8_t selBurnPow_; // Burner max power % (can be > 100%)
uint8_t heatingPump2Mod_; // heatpump modulation from 0xE3 (heatpumps)
uint8_t heatingPumpMod_; // Pump modulation %
int16_t outdoorTemp_; // Outside temperature
uint16_t curFlowTemp_; // Current flow temperature
uint16_t retTemp_; // Return temperature
uint16_t switchTemp_; // Switch temperature
uint8_t sysPress_; // System pressure
uint16_t boilTemp_; // Boiler temperature
uint16_t exhaustTemp_; // Exhaust temperature
uint8_t burnGas_; // Gas on/off
uint8_t burnGas2_; // Gas stage 2 on/off
uint16_t flameCurr_; // Flame current in micro amps
uint8_t heatingPump_; // Boiler heating pump on/off
uint8_t fanWork_; // Fan on/off
uint8_t ignWork_; // Ignition on/off
uint8_t oilPreHeat_; // oil preheating on
uint8_t heatingActivated_; // Heating activated on the boiler
uint8_t heatingTemp_; // Heating temperature setting on the boiler
uint8_t pumpModMax_; // Boiler circuit pump modulation max. power %
uint8_t pumpModMin_; // Boiler circuit pump modulation min. power
uint8_t pumpDelay_;
uint8_t burnMinPeriod_;
uint8_t burnMinPower_;
uint8_t burnMaxPower_;
int8_t boilHystOn_;
int8_t boilHystOff_;
uint8_t setFlowTemp_; // boiler setpoint temp
uint8_t curBurnPow_; // Burner current power %
uint8_t setBurnPow_; // max output power in %
uint32_t burnStarts_; // burner restarts
uint32_t burnWorkMin_; // Total burner operating time
uint32_t burn2WorkMin_; // burner stage 2 operating time
uint32_t heatWorkMin_; // Total heat operating time
uint32_t UBAuptime_; // Total UBA working hours
char lastCode_[50]; // last error code
char serviceCode_[4]; // 3 character status/service code
uint16_t serviceCodeNumber_; // error/service code
// info
uint32_t upTimeControl_; // Operating time control
uint32_t upTimeCompHeating_; // Operating time compressor heating
uint32_t upTimeCompCooling_; // Operating time compressor cooling
uint32_t upTimeCompWw_; // Operating time compressor DHW
uint32_t upTimeCompPool_; // Operating time compressor pool
uint32_t totalCompStarts_; // Total Commpressor control starts
uint32_t heatingStarts_; // Heating control starts
uint32_t coolingStarts_; // Cooling control starts
uint32_t poolStarts_; // DHW control starts
uint32_t nrgConsTotal_; // Energy consumption total
uint32_t nrgConsCompTotal_; // Energy consumption compressor total
uint32_t nrgConsCompHeating_; // Energy consumption compressor heating
uint32_t nrgConsCompWw_; // Energy consumption compressor DHW
uint32_t nrgConsCompCooling_; // Energy consumption compressor cooling
uint32_t nrgConsCompPool_; // Energy consumption compressor pool
uint32_t nrgSuppTotal_; // Energy supplied total
uint32_t nrgSuppHeating_; // Energy supplied heating
uint32_t nrgSuppWw_; // Energy supplied DHW
uint32_t nrgSuppCooling_; // Energy supplied cooling
uint32_t nrgSuppPool_; // Energy supplied pool
uint32_t auxElecHeatNrgConsTotal_; // Auxiliary electrical heater energy consumption total
uint32_t auxElecHeatNrgConsHeating_; // Auxiliary electrical heater energy consumption heating
uint32_t auxElecHeatNrgConsWW_; // Auxiliary electrical heater energy consumption DHW
uint32_t auxElecHeatNrgConsPool_; // Auxiliary electrical heater energy consumption Pool
char maintenanceMessage_[4];
char maintenanceDate_[12];
uint8_t maintenanceType_;
uint16_t maintenanceTime_;
// heatpump
uint8_t hpPower_;
uint8_t hpCompOn_;
uint8_t hpBrinePumpSpd_;
uint8_t hpCompSpd_;
uint8_t hpCircSpd_;
uint16_t hpBrineIn_;
uint16_t hpBrineOut_;
uint16_t hpSuctionGas_;
uint16_t hpHotGas_;
uint8_t hpSwitchValve_;
uint8_t hpActivity_;
uint8_t hpHeatingOn_;
uint8_t hpCoolingOn_;
uint8_t hpWwOn_;
uint8_t hpPoolOn_;
int16_t hpTc0_;
int16_t hpTc1_;
int16_t hpTc3_;
int16_t hpTr3_;
int16_t hpTr4_;
int16_t hpTr5_;
int16_t hpTr6_;
int16_t hpTr7_;
int16_t hpTl2_;
int16_t hpPl1_;
int16_t hpPh1_;
// Pool unit
int8_t poolSetTemp_;
/*
* Hybrid heatpump with telegram 0xBB is readable and writeable in boiler and thermostat
* thermostat always overwrites settings in boiler
* enable settings here if no thermostat is used in system
*
// HybridHP
uint8_t hybridStrategy_; // cost = 2, temperature = 3, mix = 4
int8_t switchOverTemp_; // degrees
uint8_t energyCostRatio_; // is *10
uint8_t fossileFactor_; // is * 10
uint8_t electricFactor_; // is * 10
uint8_t delayBoiler_; // minutes
uint8_t tempDiffBoiler_; // relative temperature degrees
*/
void process_UBAParameterWW(std::shared_ptr<const Telegram> telegram);
void process_UBAMonitorFast(std::shared_ptr<const Telegram> telegram);
void process_UBATotalUptime(std::shared_ptr<const Telegram> telegram);
void process_UBAParameters(std::shared_ptr<const Telegram> telegram);
void process_UBAMonitorWW(std::shared_ptr<const Telegram> telegram);
void process_UBAMonitorFastPlus(std::shared_ptr<const Telegram> telegram);
void process_UBAMonitorSlow(std::shared_ptr<const Telegram> telegram);
void process_UBAMonitorSlowPlus(std::shared_ptr<const Telegram> telegram);
void process_UBAMonitorSlowPlus2(std::shared_ptr<const Telegram> telegram);
void process_UBAParametersPlus(std::shared_ptr<const Telegram> telegram);
void process_UBAParameterWWPlus(std::shared_ptr<const Telegram> telegram);
void process_UBAOutdoorTemp(std::shared_ptr<const Telegram> telegram);
void process_UBASetPoints(std::shared_ptr<const Telegram> telegram);
void process_UBAFlags(std::shared_ptr<const Telegram> telegram);
void process_MC110Status(std::shared_ptr<const Telegram> telegram);
void process_UBAMaintenanceStatus(std::shared_ptr<const Telegram> telegram);
void process_UBAMaintenanceData(std::shared_ptr<const Telegram> telegram);
void process_ErrorMessage(std::shared_ptr<const Telegram> telegram);
void process_UBAErrorMessage(std::shared_ptr<const Telegram> telegram);
void process_UBAErrorMessage2(std::shared_ptr<const Telegram> telegram);
void process_UBAMonitorWWPlus(std::shared_ptr<const Telegram> telegram);
void process_UBAInformation(std::shared_ptr<const Telegram> telegram);
void process_UBAEnergySupplied(std::shared_ptr<const Telegram> telegram);
void process_CascadeMessage(std::shared_ptr<const Telegram> telegram);
void process_UBASettingsWW(std::shared_ptr<const Telegram> telegram);
void process_HpPower(std::shared_ptr<const Telegram> telegram);
void process_HpOutdoor(std::shared_ptr<const Telegram> telegram);
void process_HpPool(std::shared_ptr<const Telegram> telegram);
void process_HybridHp(std::shared_ptr<const Telegram> telegram);
// commands - none of these use the additional id parameter
bool set_ww_mode(const char * value, const int8_t id);
bool set_ww_mode1(const char * value, const int8_t id);
bool set_ww_activated(const char * value, const int8_t id);
bool set_tapwarmwater_activated(const char * value, const int8_t id);
bool set_ww_onetime(const char * value, const int8_t id);
bool set_ww_disinfect(const char * value, const int8_t id);
bool set_ww_circulation(const char * value, const int8_t id);
bool set_ww_circulation_pump(const char * value, const int8_t id);
bool set_ww_circulation_mode(const char * value, const int8_t id);
bool set_ww_temp(const char * value, const int8_t id);
bool set_ww_temp_low(const char * value, const int8_t id);
bool set_ww_temp_single(const char * value, const int8_t id);
bool set_ww_disinfect_temp(const char * value, const int8_t id);
bool set_ww_maxpower(const char * value, const int8_t id);
bool set_ww_maxtemp(const char * value, const int8_t id);
bool set_ww_flowTempOffset(const char * value, const int8_t id);
bool set_ww_chargeOptimization(const char * value, const int8_t id);
bool set_flow_temp(const char * value, const int8_t id);
bool set_burn_power(const char * value, const int8_t id);
bool set_heating_activated(const char * value, const int8_t id);
bool set_heating_temp(const char * value, const int8_t id);
bool set_min_power(const char * value, const int8_t id);
bool set_max_power(const char * value, const int8_t id);
bool set_min_pump(const char * value, const int8_t id);
bool set_max_pump(const char * value, const int8_t id);
bool set_hyst_on(const char * value, const int8_t id);
bool set_hyst_off(const char * value, const int8_t id);
bool set_burn_period(const char * value, const int8_t id);
bool set_pump_delay(const char * value, const int8_t id);
bool set_reset(const char * value, const int8_t id);
bool set_maintenance(const char * value, const int8_t id);
bool set_maintenancetime(const char * value, const int8_t id);
bool set_maintenancedate(const char * value, const int8_t id);
bool set_ww_hyst_on(const char * value, const int8_t id);
bool set_ww_hyst_off(const char * value, const int8_t id);
bool set_pool_temp(const char * value, const int8_t id);
/*
bool set_hybridStrategy(const char * value, const int8_t id);
bool set_switchOverTemp(const char * value, const int8_t id);
bool set_energyCostRatio(const char * value, const int8_t id);
bool set_fossileFactor(const char * value, const int8_t id);
bool set_electricFactor(const char * value, const int8_t id);
bool set_delayBoiler(const char * value, const int8_t id);
bool set_tempDiffBoiler(const char * value, const int8_t id);
*/
};
} // namespace emsesp
#endif