@@ -24,6 +24,36 @@ REGISTER_FACTORY(Alert, EMSdevice::DeviceType::ALERT);
24
24
25
25
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)
26
26
: 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 );
27
57
}
28
58
29
59
} // namespace emsesp
0 commit comments