@@ -201,30 +201,37 @@ script:
|
|||||||
- id: !extend watchdog
|
- id: !extend watchdog
|
||||||
then:
|
then:
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
|
// Check if more than one or none of the climate options are defined
|
||||||
|
#if defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_COOL) && defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT)
|
||||||
|
#error "Invalid settings for add-on Climate. More than one option selected: Cool + Heat."
|
||||||
|
#elif defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_COOL) && defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL)
|
||||||
|
#error "Invalid settings for add-on Climate. More than one option selected: Cool + Dual."
|
||||||
|
#elif defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT) && defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL)
|
||||||
|
#error "Invalid settings for add-on Climate. More than one option selected: Heat + Dual."
|
||||||
|
#elif !defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_COOL) && !defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT) && !defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL)
|
||||||
|
#error "Invalid settings for add-on Climate. No option selected between Cool, Heat or Dual."
|
||||||
|
#endif
|
||||||
if (!id(is_uploading_tft)) {
|
if (!id(is_uploading_tft)) {
|
||||||
static const char *const TAG = "addon_climate_base.script.watchdog";
|
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 cooler_relay = ${cooler_relay};
|
||||||
uint heater_relay = ${heater_relay};
|
uint heater_relay = ${heater_relay};
|
||||||
ESP_LOGI(TAG, "Add-on climate:");
|
ESP_LOGI(TAG, "Add-on climate:");
|
||||||
if (addon_climate_cool) {
|
#ifdef NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_COOL
|
||||||
ESP_LOGI(TAG, " Cool: %s", addon_climate_cool ? "Enabled" : "Disabled");
|
ESP_LOGI(TAG, " Cool: Enabled");
|
||||||
if (cooler_relay == 1 or cooler_relay == 2)
|
if (cooler_relay == 1 or cooler_relay == 2)
|
||||||
ESP_LOGI(TAG, " Relay: %u", cooler_relay);
|
ESP_LOGI(TAG, " Relay: %u", cooler_relay);
|
||||||
else
|
else
|
||||||
ESP_LOGE(TAG, " Relay: %u", cooler_relay);
|
ESP_LOGE(TAG, " Relay: %u", cooler_relay);
|
||||||
}
|
#endif
|
||||||
if (addon_climate_heat) {
|
#ifdef NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT
|
||||||
ESP_LOGI(TAG, " Heat: %s", addon_climate_heat ? "Enabled" : "Disabled");
|
ESP_LOGI(TAG, " Heat: Enabled");
|
||||||
if (heater_relay == 1 or heater_relay == 2)
|
if (heater_relay == 1 or heater_relay == 2)
|
||||||
ESP_LOGI(TAG, " Relay: %u", heater_relay);
|
ESP_LOGI(TAG, " Relay: %u", heater_relay);
|
||||||
else
|
else
|
||||||
ESP_LOGE(TAG, " Relay: %u", heater_relay);
|
ESP_LOGE(TAG, " Relay: %u", heater_relay);
|
||||||
}
|
#endif
|
||||||
if (addon_climate_dual) {
|
#ifdef NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL
|
||||||
ESP_LOGI(TAG, " Dual: %s", addon_climate_dual ? "Enabled" : "Disabled");
|
ESP_LOGI(TAG, " Dual: Enabled");
|
||||||
if (cooler_relay == 1 or cooler_relay == 2)
|
if (cooler_relay == 1 or cooler_relay == 2)
|
||||||
ESP_LOGI(TAG, " Relay (cooler): %u", cooler_relay);
|
ESP_LOGI(TAG, " Relay (cooler): %u", cooler_relay);
|
||||||
else
|
else
|
||||||
@@ -235,13 +242,6 @@ script:
|
|||||||
ESP_LOGE(TAG, " Relay (heater): %u", heater_relay);
|
ESP_LOGE(TAG, " Relay (heater): %u", heater_relay);
|
||||||
if (cooler_relay == heater_relay)
|
if (cooler_relay == heater_relay)
|
||||||
ESP_LOGE(TAG, " Double relay assignment");
|
ESP_LOGE(TAG, " Double relay assignment");
|
||||||
}
|
#endif
|
||||||
|
|
||||||
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");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
...
|
...
|
||||||
|
|||||||
@@ -10,14 +10,13 @@
|
|||||||
#####################################################################################################
|
#####################################################################################################
|
||||||
substitutions:
|
substitutions:
|
||||||
heater_relay: "1" # Possible values: 1/2
|
heater_relay: "1" # Possible values: 1/2
|
||||||
temp_units: "°C" # Temperatures in Fahrenheit
|
|
||||||
temp_min: "16" # Min supported temperature is 40°F
|
temp_min: "16" # Min supported temperature is 40°F
|
||||||
temp_max: "26" # Max supported temperature is 80°F
|
temp_max: "26" # Max supported temperature is 80°F
|
||||||
temp_step: "0.5" # Temperature granularity is 1°F
|
temp_step: "0.5" # Temperature granularity is 1°F
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
climate_heat: !include ../esphome/nspanel_esphome_addon_climate_heat.yaml
|
|
||||||
prebuilt_package: !include nspanel_esphome_prebuilt.yaml
|
prebuilt_package: !include nspanel_esphome_prebuilt.yaml
|
||||||
|
climate_heat: !include ../esphome/nspanel_esphome_addon_climate_heat.yaml
|
||||||
|
|
||||||
dashboard_import:
|
dashboard_import:
|
||||||
package_import_url: github://Blackymas/NSPanel_HA_Blueprint/prebuilt/Wall_Display.yaml@main
|
package_import_url: github://Blackymas/NSPanel_HA_Blueprint/prebuilt/Wall_Display.yaml@main
|
||||||
|
|||||||
Reference in New Issue
Block a user