diff --git a/mock-api/restServer.ts b/mock-api/restServer.ts index 47501ee2c..4d510bca0 100644 --- a/mock-api/restServer.ts +++ b/mock-api/restServer.ts @@ -130,7 +130,9 @@ let system_status = { // partitions: [], developer_mode: true, model: '', + board: '', // model: 'BBQKees Electronics EMS Gateway E32 V2 (E32 V2.0 P3/2024011)', + // board: 'E32V2', // status: 0, status: 3 }; diff --git a/project-words.txt b/project-words.txt index 53fee07eb..aaf3d1a7e 100644 --- a/project-words.txt +++ b/project-words.txt @@ -1446,3 +1446,5 @@ vchip SPIIO SPIDQS txpause +relais +pinout \ No newline at end of file diff --git a/src/core/mqtt.cpp b/src/core/mqtt.cpp index 03d9b2eb5..70eaa58a5 100644 --- a/src/core/mqtt.cpp +++ b/src/core/mqtt.cpp @@ -1424,11 +1424,13 @@ bool Mqtt::publish_ha_climate_config(const DeviceValue & dv, const bool has_room doc["mode_cmd_t"] = mode_cmd_s; // add hvac_action - https://github.com/emsesp/EMS-ESP32/discussions/2562 - doc["act_t"] = "~/boiler_data"; - doc["act_tpl"] = "{% if value_json.hpactivity=='cooling'%}cooling{%elif value_json.heatingactive=='on'%}heating{%else%}idle{%endif%}"; + doc["act_t"] = "~/boiler_data"; + char on_string[12]; + doc["act_tpl"] = "{% if value_json.hpactivity=='cooling'%}cooling{%elif value_json.heatingactive=='" + std::string(Helpers::render_boolean(on_string, true)) + + "'%}heating{%else%}idle{%endif%}"; // uses boolean translation for on/true // map EMS modes to HA climate modes - // EMS modes: auto, manual, heat, off, night, day, nofrost, eco, comfort, cool) + // EMS modes: auto, manual, heat, off, night, day, nofrost, eco, comfort, cool // HA supports: auto, off, cool, heat, dry, fan_only bool found_auto = false; bool found_heat = false; diff --git a/src/core/system.cpp b/src/core/system.cpp index 62972bc55..38c2ded31 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -2399,21 +2399,21 @@ bool System::load_board_profile(std::vector & data, const std::string & if (board_profile == "default") { return false; // unknown, return false } else if (board_profile == "S32") { - data = {2, 18, 23, 5, 0, PHY_type::PHY_TYPE_NONE, 0, 0, 0, 0}; // BBQKees Gateway S32 + data = {2, 18, 23, 5, 0, PHY_type::PHY_TYPE_NONE, 0, 0, 0, 0}; // BBQKees Gateway S32 valid_system_gpios_ = {0, 2, 5, 18, 23}; } else if (board_profile == "E32") { - data = {2, 4, 5, 17, 33, PHY_type::PHY_TYPE_LAN8720, 16, 1, 0, 0}; // BBQKees Gateway E32 + data = {2, 4, 5, 17, 33, PHY_type::PHY_TYPE_LAN8720, 16, 1, 0, 0}; // BBQKees Gateway E32 valid_system_gpios_ = {0, 2, 4, 5, 16, 17, 33}; } else if (board_profile == "E32V2") { - data = {2, 14, 4, 5, 34, PHY_type::PHY_TYPE_LAN8720, 15, 0, 1, 0}; // BBQKees Gateway E32 V2 + data = {2, 14, 4, 5, 34, PHY_type::PHY_TYPE_LAN8720, 15, 0, 1, 0}; // BBQKees Gateway E32 V2 valid_system_gpios_ = {0, 2, 4, 5, 14, 15, 34}; } else if (board_profile == "E32V2_2") { - data = {32, 14, 4, 5, 34, PHY_type::PHY_TYPE_LAN8720, 15, 0, 1, 1}; // BBQKees Gateway E32 V2.2, rgb led - valid_system_gpios_ = {0, 2, 4, 5, 14, 15, 32, 34, 36, 39}; // system analogs 36, 39, led 2 + data = {32, 14, 4, 5, 34, PHY_type::PHY_TYPE_LAN8720, 15, 0, 1, 1}; // BBQKees Gateway E32 V2.2, rgb led + valid_system_gpios_ = {0, 2, 4, 5, 14, 15, 32, 34, 36, 39}; // system analogs 36, 39, led 2 } else if (board_profile == "MH-ET") { data = {2, 18, 23, 5, 0, PHY_type::PHY_TYPE_NONE, 0, 0, 0, 0}; // MH-ET Live D1 Mini // allow only pins that are marked as `can always be used` - valid_system_gpios_ = {0, 2, 5, 18, 23, 12 ,13, 14, 15, 16, 17, 26, 27, 33}; + valid_system_gpios_ = {0, 2, 5, 18, 23, 12, 13, 14, 15, 16, 17, 26, 27, 33}; // can always be used: 12, 13 ,14, 15, 16, 17, 26, 27, 33 // can be used if no other function 2, 4, 5, 9, 10, 18, 19, 21, 22, 23, 25, 34, 35, 36, 39 } else if (board_profile == "NODEMCU") { @@ -2447,7 +2447,7 @@ bool System::load_board_profile(std::vector & data, const std::string & } else if (board_profile == "S3MINI") { data = {17, 18, 8, 5, 0, PHY_type::PHY_TYPE_NONE, 0, 0, 0, 0}; // Liligo S3 } else if (board_profile == "S32S3") { - data = {2, 18, 5, 17, 0, PHY_type::PHY_TYPE_NONE, 0, 0, 0, 0}; // BBQKees Gateway S3 + data = {2, 18, 5, 17, 0, PHY_type::PHY_TYPE_NONE, 0, 0, 0, 0}; // BBQKees Gateway S3 valid_system_gpios_ = {0, 2, 5, 17, 18}; } else { return false; // unknown, return false @@ -2976,7 +2976,7 @@ void System::set_valid_system_gpios() { // GPIO12 - GPIO15 = JTAG, normally not used // GPIO00, GPIO05, GPIO12, GPIO15 = strapping pins, can be used with care // GPIO34, GPIO35, GPIO37 = input only - // GPIO23 and GPIO18 are used by Ethernet, excuded later by eth config + // GPIO23 and GPIO18 are used by Ethernet, excluded later by eth config // GPIO00, GPIO02, GPIO04, GPIO12 - GPIO15, GPIO25 - GPIO27 = ADC2 (10 ch), used by WiFI-driver // GPIO32 - GPIO39 = ADC1 (8 ch), can always be used if (ESP.getPsramSize() > 0) {