diff --git a/esphome/nspanel_esphome_addon_climate_base.yaml b/esphome/nspanel_esphome_addon_climate_base.yaml index 0992193..dd57abd 100644 --- a/esphome/nspanel_esphome_addon_climate_base.yaml +++ b/esphome/nspanel_esphome_addon_climate_base.yaml @@ -32,6 +32,11 @@ substitutions: addon_climate_dual: "false" ############################## +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_BASE + climate: - platform: thermostat name: Thermostat @@ -192,4 +197,51 @@ script: - lambda: |- if (current_page->state == "climate" and !id(is_uploading_tft)) id(is_addon_climate_visible) = embedded_climate; + + - id: !extend watchdog + then: + - lambda: |- + if (!id(is_uploading_tft)) { + static const char *const TAG = "addon_climate_base.script.watchdog"; + bool addon_climate_cool = ${addon_climate_cool}; + bool addon_climate_heat = ${addon_climate_heat}; + bool addon_climate_dual = ${addon_climate_dual}; + uint cooler_relay = ${cooler_relay}; + uint heater_relay = ${heater_relay}; + ESP_LOGI(TAG, "Add-on climate:"); + if (addon_climate_cool) { + ESP_LOGI(TAG, " Cool: %s", addon_climate_cool ? "Enabled" : "Disabled"); + if (cooler_relay == 1 or cooler_relay == 2) + ESP_LOGI(TAG, " Relay: %u", cooler_relay); + else + ESP_LOGE(TAG, " Relay: %u", cooler_relay); + } + if (addon_climate_heat) { + ESP_LOGI(TAG, " Heat: %s", addon_climate_heat ? "Enabled" : "Disabled"); + if (heater_relay == 1 or heater_relay == 2) + ESP_LOGI(TAG, " Relay: %u", heater_relay); + else + ESP_LOGE(TAG, " Relay: %u", heater_relay); + } + if (addon_climate_dual) { + ESP_LOGI(TAG, " Dual: %s", addon_climate_dual ? "Enabled" : "Disabled"); + if (cooler_relay == 1 or cooler_relay == 2) + ESP_LOGI(TAG, " Relay (cooler): %u", cooler_relay); + else + ESP_LOGE(TAG, " Relay (cooler): %u", cooler_relay); + if (heater_relay == 1 or heater_relay == 2) + ESP_LOGI(TAG, " Relay (heater): %u", heater_relay); + else + ESP_LOGE(TAG, " Relay (heater): %u", heater_relay); + if (cooler_relay == heater_relay) + ESP_LOGE(TAG, " Double relay assignment"); + } + + if ((addon_climate_cool && addon_climate_heat) || + (addon_climate_cool && addon_climate_dual) || + (addon_climate_heat && addon_climate_dual) || + (!addon_climate_cool && !addon_climate_heat && !addon_climate_dual)) { + ESP_LOGE(TAG, "Invalid settings for add-on Climate"); + } + } ... diff --git a/esphome/nspanel_esphome_addon_climate_cool.yaml b/esphome/nspanel_esphome_addon_climate_cool.yaml index e1752c5..20e17e9 100644 --- a/esphome/nspanel_esphome_addon_climate_cool.yaml +++ b/esphome/nspanel_esphome_addon_climate_cool.yaml @@ -15,6 +15,11 @@ substitutions: addon_climate_cool: "true" ############################## +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_COOL + climate: - id: !extend thermostat_embedded min_cooling_off_time: ${min_off_time}s diff --git a/esphome/nspanel_esphome_addon_climate_dual.yaml b/esphome/nspanel_esphome_addon_climate_dual.yaml index 114d9d9..2e37eb3 100644 --- a/esphome/nspanel_esphome_addon_climate_dual.yaml +++ b/esphome/nspanel_esphome_addon_climate_dual.yaml @@ -12,6 +12,11 @@ substitutions: addon_climate_dual: "true" ############################## +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL + climate: - id: !extend thermostat_embedded min_cooling_off_time: ${min_off_time}s diff --git a/esphome/nspanel_esphome_addon_climate_heat.yaml b/esphome/nspanel_esphome_addon_climate_heat.yaml index 1b728c6..35b9855 100644 --- a/esphome/nspanel_esphome_addon_climate_heat.yaml +++ b/esphome/nspanel_esphome_addon_climate_heat.yaml @@ -15,6 +15,11 @@ substitutions: addon_climate_heat: "true" ############################## +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT + climate: - id: !extend thermostat_embedded min_heating_off_time: ${min_off_time}s diff --git a/esphome/nspanel_esphome_addon_upload_tft.yaml b/esphome/nspanel_esphome_addon_upload_tft.yaml index 627dfbf..b7c2c18 100644 --- a/esphome/nspanel_esphome_addon_upload_tft.yaml +++ b/esphome/nspanel_esphome_addon_upload_tft.yaml @@ -24,6 +24,11 @@ external_components: - nspanel_ha_blueprint_upload_tft refresh: 300s +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT + # yamllint disable rule:comments-indentation api: services: @@ -375,6 +380,16 @@ script: ESP_LOGI("addon_upload_tft.script.upload_tft_attempt", "Restarting ESPHome"); App.safe_reboot(); + - id: !extend watchdog + then: + - lambda: |- + if (!id(is_uploading_tft)) { + static const char *const TAG = "addon_upload_tft.script.watchdog"; + ESP_LOGI(TAG, "Add-on Upload TFT:"); + ESP_LOGI(TAG, " File model: %s", tft_file_model->state.c_str()); + ESP_LOGI(TAG, " Valid TFT: %s", YESNO(id(tft_is_valid))); + } + select: - id: tft_file_model name: Update TFT display - Model diff --git a/esphome/nspanel_esphome_advanced.yaml b/esphome/nspanel_esphome_advanced.yaml index 03da043..5b2124e 100644 --- a/esphome/nspanel_esphome_advanced.yaml +++ b/esphome/nspanel_esphome_advanced.yaml @@ -15,6 +15,11 @@ substitutions: web_password: ${wifi_password} ############################## +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_ADVANCED + button: - name: Exit reparse platform: template diff --git a/esphome/nspanel_esphome_core.yaml b/esphome/nspanel_esphome_core.yaml index b4b9957..8515e59 100644 --- a/esphome/nspanel_esphome_core.yaml +++ b/esphome/nspanel_esphome_core.yaml @@ -54,6 +54,7 @@ esphome: platformio_options: build_flags: - -Wno-missing-field-initializers + - -D NSPANEL_HA_BLUEPRINT_CORE on_boot: - priority: 600.0 # This is where most sensors are set up. @@ -100,8 +101,6 @@ esp32: framework: type: esp-idf -debug: - psram: id: ext_ram @@ -167,6 +166,7 @@ time: refresh_datetime->execute(); refresh_relays->execute(3); refresh_hardware_buttons_bars->execute(3); + refresh_wifi_icon->execute(); - seconds: 30 then: - script.execute: watchdog @@ -3110,6 +3110,7 @@ script: mode: restart then: - lambda: |- + #include static const char *const TAG = "script.watchdog"; if (id(is_uploading_tft)) { ESP_LOGW(TAG, "TFT upload in progress"); @@ -3220,6 +3221,40 @@ script: ESP_LOGW(TAG, " TFT: UNKNOWN"); else ESP_LOGI(TAG, " TFT: %s", version_tft->state.c_str()); + ESP_LOGI(TAG, "Packages:"); + #ifdef NSPANEL_HA_BLUEPRINT_CORE + ESP_LOGI(TAG, " - Core"); + #endif + #ifdef NSPANEL_HA_BLUEPRINT_ADVANCED + ESP_LOGI(TAG, " - Advanced"); + #endif + #ifdef NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT + ESP_LOGI(TAG, " - Upload TFT"); + #endif + #ifdef NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_BASE + ESP_LOGI(TAG, " - Climate - Base"); + #endif + #ifdef NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_COOL + ESP_LOGI(TAG, " - Climate - Cool"); + #endif + #ifdef NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL + ESP_LOGI(TAG, " - Climate - Dual"); + #endif + #ifdef NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT + ESP_LOGI(TAG, " - Climate - Heat"); + #endif + #if defined(USE_BLUETOOTH_PROXY) || defined(USE_WEBSERVER) || defined(USE_CAPTIVE_PORTAL) + ESP_LOGI(TAG, "Non-standard components:"); + #ifdef USE_CAPTIVE_PORTAL + ESP_LOGI(TAG, " - Captive portal"); + #endif + #ifdef USE_BLUETOOTH_PROXY + ESP_LOGI(TAG, " - Bluetooth proxy"); + #endif + #ifdef USE_WEBSERVER + ESP_LOGI(TAG, " - Web server"); + #endif + #endif refresh_wifi_icon->execute(); } ... diff --git a/prebuilt/nspanel_esphome_prebuilt.yaml b/prebuilt/nspanel_esphome_prebuilt.yaml index 5a57821..ed26787 100644 --- a/prebuilt/nspanel_esphome_prebuilt.yaml +++ b/prebuilt/nspanel_esphome_prebuilt.yaml @@ -26,6 +26,11 @@ packages: core_package: !include ../esphome/nspanel_esphome_core.yaml upload_tft_package: !include ../esphome/nspanel_esphome_addon_upload_tft.yaml +esphome: + platformio_options: + build_flags: + - -D NSPANEL_HA_BLUEPRINT_PREBUILT + api: services: - service: firmware_update @@ -88,6 +93,7 @@ ota: password: !remove ota_http: + exclude_certificate_bundle: true select: - id: !extend tft_file_model