mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 09:19:51 +03:00
add ventilation bypass
This commit is contained in:
@@ -29,6 +29,7 @@ Ventilation::Ventilation(uint8_t device_type, uint8_t device_id, uint8_t product
|
||||
register_telegram_type(0x585, "Blowerspeed", false, MAKE_PF_CB(process_BlowerMessage));
|
||||
register_telegram_type(0x583, "VentilationMonitor", false, MAKE_PF_CB(process_MonitorMessage));
|
||||
register_telegram_type(0x5D9, "Airquality", false, MAKE_PF_CB(process_VOCMessage));
|
||||
register_telegram_type(0x587, "Bypass", false, MAKE_PF_CB(process_BypassMessage));
|
||||
// register_telegram_type(0x5, "VentilationSet", true, MAKE_PF_CB(process_SetMessage));
|
||||
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
@@ -44,7 +45,8 @@ Ventilation::Ventilation(uint8_t device_type, uint8_t device_id, uint8_t product
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &ventOutSpeed_, DeviceValueType::UINT, FL_(ventOutSpeed), DeviceValueUOM::PERCENT);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_DEVICE_DATA, &mode_, DeviceValueType::ENUM, FL_(enum_ventMode), FL_(ventInSpeed), DeviceValueUOM::NONE, MAKE_CF_CB(set_ventMode));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &voc_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(airquality), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &voc_, DeviceValueType::USHORT, FL_(airquality), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &bypass_, DeviceValueType::BOOL, FL_(bypass), DeviceValueUOM::NONE, MAKE_CF_CB(set_bypass));
|
||||
}
|
||||
|
||||
// message
|
||||
@@ -81,6 +83,11 @@ void Ventilation::process_ModeMessage(std::shared_ptr<const Telegram> telegram)
|
||||
has_enumupdate(telegram, mode_, 0, -1);
|
||||
}
|
||||
|
||||
// message 0x0587, data: 01 00
|
||||
void Ventilation::process_BypassMessage(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, bypass_, 1);
|
||||
}
|
||||
|
||||
bool Ventilation::set_ventMode(const char * value, const int8_t id) {
|
||||
uint8_t v;
|
||||
if (!Helpers::value2enum(value, v, FL_(enum_ventMode))) {
|
||||
@@ -99,4 +106,13 @@ bool Ventilation::set_filter(const char * value, const int8_t id) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Ventilation::set_bypass(const char * value, const int8_t id) {
|
||||
bool b;
|
||||
if (!Helpers::value2bool(value, b)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x55C, 1, b ? 1 : 0, 0x587);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
@@ -34,7 +34,7 @@ class Ventilation : public EMSdevice {
|
||||
int16_t inEx_;
|
||||
int16_t outEx_;
|
||||
uint16_t voc_;
|
||||
// uint8_t bypass_;
|
||||
uint8_t bypass_;
|
||||
// uint16_t filterRemain_;
|
||||
uint8_t ventInSpeed_;
|
||||
uint8_t ventOutSpeed_;
|
||||
@@ -45,8 +45,10 @@ class Ventilation : public EMSdevice {
|
||||
void process_ModeMessage(std::shared_ptr<const Telegram> telegram); // 0x56B
|
||||
void process_BlowerMessage(std::shared_ptr<const Telegram> telegram); // 0x56B
|
||||
void process_VOCMessage(std::shared_ptr<const Telegram> telegram); // 0x56B
|
||||
void process_BypassMessage(std::shared_ptr<const Telegram> telegram); // 0x56B
|
||||
|
||||
bool set_ventMode(const char * value, const int8_t id);
|
||||
bool set_bypass(const char * value, const int8_t id);
|
||||
bool set_filter(const char * value, const int8_t id);
|
||||
|
||||
|
||||
|
||||
@@ -597,6 +597,7 @@ void EMSESP::publish_other_values() {
|
||||
publish_device_values(EMSdevice::DeviceType::SWITCH);
|
||||
publish_device_values(EMSdevice::DeviceType::HEATPUMP);
|
||||
publish_device_values(EMSdevice::DeviceType::HEATSOURCE);
|
||||
publish_device_values(EMSdevice::DeviceType::VENTILATION);
|
||||
// other devices without values yet
|
||||
// publish_device_values(EMSdevice::DeviceType::GATEWAY);
|
||||
// publish_device_values(EMSdevice::DeviceType::CONNECT);
|
||||
|
||||
Reference in New Issue
Block a user