Skip to content

Commit 3fe9296

Browse files
committed
EM100 to Alert, add first telegrams
1 parent c533e91 commit 3fe9296

File tree

3 files changed

+45
-3
lines changed

3 files changed

+45
-3
lines changed

src/device_library.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
{215, DeviceType::THERMOSTAT, "Comfort RF", DeviceFlags::EMS_DEVICE_FLAG_CRF | DeviceFlags::EMS_DEVICE_FLAG_NO_WRITE}, // 0x18
102102
{216, DeviceType::THERMOSTAT, "CRF200S", DeviceFlags::EMS_DEVICE_FLAG_CRF | DeviceFlags::EMS_DEVICE_FLAG_NO_WRITE}, // 0x18
103103
{246, DeviceType::THERMOSTAT, "Comfort+2RF", DeviceFlags::EMS_DEVICE_FLAG_CRF | DeviceFlags::EMS_DEVICE_FLAG_NO_WRITE}, // 0x18
104-
{253, DeviceType::THERMOSTAT, "Rego 3000/UI800", DeviceFlags::EMS_DEVICE_FLAG_RC300}, // 0x10
104+
{253, DeviceType::THERMOSTAT, "Rego 3000/UI800/BC400", DeviceFlags::EMS_DEVICE_FLAG_RC300}, // 0x10
105105

106106
// Thermostat - Sieger - 0x10 / 0x17
107107
{ 66, DeviceType::THERMOSTAT, "ES72/RC20", DeviceFlags::EMS_DEVICE_FLAG_RC20_N}, // 0x17 or remote
@@ -169,8 +169,8 @@
169169
// Switches - 0x11
170170
{ 71, DeviceType::SWITCH, "WM10", DeviceFlags::EMS_DEVICE_FLAG_NONE},
171171

172-
// PM10 Pump module - 0x15
173-
{ 243, DeviceType::PUMP, "PM10", DeviceFlags::EMS_DEVICE_FLAG_NONE},
172+
// EM10/EM100 module - 0x15
173+
{ 243, DeviceType::ALERT, "EM10/EM100", DeviceFlags::EMS_DEVICE_FLAG_NONE},
174174

175175
// EM10 error contact and analog flowtemp control- 0x12
176176
{ 74, DeviceType::ALERT, "EM10", DeviceFlags::EMS_DEVICE_FLAG_NONE},

src/devices/alert.cpp

+30
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,36 @@ REGISTER_FACTORY(Alert, EMSdevice::DeviceType::ALERT);
2424

2525
Alert::Alert(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
2626
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
27+
register_telegram_type(0x937, "EM100TempMessage", false, MAKE_PF_CB(process_EM100TempMessage));
28+
register_telegram_type(0x93A, "EM100SetMessage", false, MAKE_PF_CB(process_EM100SetMessage));
29+
register_telegram_type(0x936, "EM100MonitorMessage", false, MAKE_PF_CB(process_EM100MonitorMessage));
30+
31+
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
32+
&headerTemp_,
33+
DeviceValueType::SHORT,
34+
DeviceValueNumOp::DV_NUMOP_DIV10,
35+
FL_(flowTempVf),
36+
DeviceValueUOM::DEGREES);
37+
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &dip_, DeviceValueType::UINT, FL_(mode), DeviceValueUOM::NONE);
38+
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &outPower_, DeviceValueType::UINT, FL_(power), DeviceValueUOM::PERCENT);
39+
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &errorState_, DeviceValueType::BOOL, FL_(error), DeviceValueUOM::NONE);
40+
}
41+
42+
43+
// alert(0x15) -B-> All(0x00), ?(0x093A), data: 00 00 00 00 00 00 00 00 00 03 01
44+
void Alert::process_EM100SetMessage(std::shared_ptr<const Telegram> telegram) {
45+
has_update(telegram, dip_, 9);
46+
}
47+
// one of 0x936, 0x937, 0x938, 0x939, 0x93A
48+
void Alert::process_EM100MonitorMessage(std::shared_ptr<const Telegram> telegram) {
49+
has_update(telegram, errorState_, 0); // OE1
50+
has_update(telegram, errorPump_, 0); // IE0
51+
has_update(telegram, outPower_, 0); // IO1 percent
52+
has_update(telegram, input_, 0); //IO1
53+
}
54+
// alert(0x15) -B-> All(0x00), ?(0x0937), data: 80 00
55+
void Alert::process_EM100TempMessage(std::shared_ptr<const Telegram> telegram) {
56+
has_update(telegram, headerTemp_, 0);
2757
}
2858

2959
} // namespace emsesp

src/devices/alert.h

+12
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ namespace emsesp {
2626
class Alert : public EMSdevice {
2727
public:
2828
Alert(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand);
29+
30+
private:
31+
void process_EM100SetMessage(std::shared_ptr<const Telegram> telegram);
32+
void process_EM100MonitorMessage(std::shared_ptr<const Telegram> telegram);
33+
void process_EM100TempMessage(std::shared_ptr<const Telegram> telegram);
34+
35+
int16_t headerTemp_; // T0
36+
int16_t input_; // IO1
37+
uint8_t errorState_; // OE1
38+
uint8_t errorPump_; // IE0
39+
uint8_t outPower_; // IO1
40+
uint8_t dip_; // dip switch
2941
};
3042

3143
} // namespace emsesp

0 commit comments

Comments
 (0)