Implements target_low and target_high substitutions

Solves #1418
This commit is contained in:
Edward Firmo
2023-12-18 23:22:36 +01:00
parent 5877af3493
commit 6e55c61032
5 changed files with 21 additions and 29 deletions

View File

@@ -19,6 +19,8 @@ substitutions:
temp_min: "5"
temp_max: "45"
temp_step: "0.5"
target_low: "18"
target_high: "24"
##### DO NOT CHANGE THIS #####
addon_climate_cool: "false"

View File

@@ -40,6 +40,7 @@ packages:
- nspanel_esphome.yaml # Core package
# - nspanel_esphome_addon_climate_cool.yaml # activate for local climate (cooling) control
- nspanel_esphome_addon_climate_heat.yaml # activate for local climate (heater) control
# - nspanel_esphome_addon_climate_dual.yaml # activate for local climate (dual) control
refresh: 300s
esp32:
@@ -54,14 +55,16 @@ The following keys are available to be used in your `substitutions`:
Key|Required|Supported values|Default|Description
:-|:-:|:-:|:-:|:-
cooler_relay|Mandatory for `cool`|`1` or `2`|`0` (disabled)|Relay used for control the cooler. User `1` for "Relay 1" or `2` for "Relay 2".
heater_relay|Mandatory for `heat`|`1` or `2`|`0` (disabled)|Relay used for control the heater. User `1` for "Relay 1" or `2` for "Relay 2".
cooler_relay|Mandatory for *cool* and *dual*|`1` or `2`|`0` (disabled)|Relay used for control the cooler. User `1` for "Relay 1" or `2` for "Relay 2".
heater_relay|Mandatory for *heat* and *dual*|`1` or `2`|`0` (disabled)|Relay used for control the heater. User `1` for "Relay 1" or `2` for "Relay 2".
temp_units|Optional|`°C` or `°F`|`°C`|Temperature unit.
min_off_time|Optional|Positive integer representing the number of seconds|`300`|Minimum duration (in seconds) the cooling/heating action must be disengaged before it may be engaged.
min_run_time|Optional|Positive integer representing the number of seconds|`300`|Minimum duration (in seconds) the cooling/heating action must be engaged before it may be disengaged.
min_idle_time|Optional|Positive integer representing the number of seconds|`30`|Minimum duration (in seconds) the idle action must be active before calling another climate action.
temp_min|Optional|Number representing a temperature in the selected unit|`15` for `cool`, `5` for `heat`|The minimum temperature the climate device can reach. Used to set the range of the frontend gauge.
temp_max|Optional|Number representing a temperature in the selected unit|`45` for `cool`, `25` for `heat`|The maximum temperature the climate device can reach. Used to set the range of the frontend gauge.
target_low|Optional|Number representing a temperature in the selected unit|`18`|The initial lower treshold for the target temperature.
target_high|Optional|Number representing a temperature in the selected unit|`24`|The initial higher treshold for the target temperature.
temp_min|Optional|Number representing a temperature in the selected unit|*cool: `15`*<br>*heat: `5`*<br>*dual: `5`* |The minimum temperature the climate device can reach. Used to set the range of the frontend gauge.
temp_max|Optional|Number representing a temperature in the selected unit|*cool: `45`*<br>*heat: `25`*<br>*dual: `45`* |The maximum temperature the climate device can reach. Used to set the range of the frontend gauge.
temp_step|Optional|Number representing a temperature in the selected unit|`0.5`|The granularity with which the target temperature can be controlled.
- All values must be delimited with `""`

View File

@@ -9,11 +9,7 @@
---
substitutions:
### Local thermostat defaults ###
# https://esphome.io/components/climate/thermostat.html
cooler_relay: "0" # Select 1 for "Relay 1", 2 for "Relay 2" or "0" to a dummy switch/disabled
# https://esphome.io/components/climate/index.html#base-climate-configuration
temp_min: "15"
temp_max: "45"
##### DO NOT CHANGE THIS #####
addon_climate_cool: "true"
@@ -27,10 +23,11 @@ climate:
- switch.turn_on: relay_${cooler_relay}
preset:
- name: "Off"
default_target_temperature_high: ${temp_max} ${temp_units}
default_target_temperature_high: ${target_high} ${temp_units}
mode: "off"
- name: Home
default_target_temperature_high: 24 ${temp_units}
default_target_temperature_high: ${target_high} ${temp_units}
mode: "cool"
packages:
climate_base_package: !include advanced/esphome/nspanel_esphome_addon_climate_base.yaml

View File

@@ -8,14 +8,6 @@
#####################################################################################################
---
substitutions:
### Local thermostat defaults ###
# https://esphome.io/components/climate/thermostat.html
heater_relay: "0" # Select 1 for "Relay 1", 2 for "Relay 2" or "0" to a dummy switch/disabled
cooler_relay: "0" # Select 1 for "Relay 1", 2 for "Relay 2" or "0" to a dummy switch/disabled
# https://esphome.io/components/climate/index.html#base-climate-configuration
temp_min: "5"
temp_max: "25"
##### DO NOT CHANGE THIS #####
addon_climate_dual: "true"
##############################
@@ -32,12 +24,13 @@ climate:
- switch.turn_on: relay_${heater_relay}
preset:
- name: "Off"
default_target_temperature_high: ${temp_max} ${temp_units}
default_target_temperature_low: ${temp_min} ${temp_units}
default_target_temperature_high: ${target_high} ${temp_units}
default_target_temperature_low: ${target_low} ${temp_units}
mode: "off"
- name: Home
default_target_temperature_high: 24 ${temp_units}
default_target_temperature_low: 18 ${temp_units}
default_target_temperature_high: ${target_high} ${temp_units}
default_target_temperature_low: ${target_low} ${temp_units}
mode: "auto"
packages:
climate_base_package: !include advanced/esphome/nspanel_esphome_addon_climate_base.yaml

View File

@@ -9,11 +9,7 @@
---
substitutions:
### Local thermostat defaults ###
# https://esphome.io/components/climate/thermostat.html
heater_relay: "0" # Select 1 for "Relay 1", 2 for "Relay 2" or "0" to a dummy switch/disabled
# https://esphome.io/components/climate/index.html#base-climate-configuration
temp_min: "5"
temp_max: "45"
temp_max: "25"
##### DO NOT CHANGE THIS #####
addon_climate_heat: "true"
@@ -27,10 +23,11 @@ climate:
- switch.turn_on: relay_${heater_relay}
preset:
- name: "Off"
default_target_temperature_low: ${temp_min} ${temp_units}
default_target_temperature_low: ${target_low} ${temp_units}
mode: "off"
- name: Home
default_target_temperature_low: 18 ${temp_units}
default_target_temperature_low: ${target_low} ${temp_units}
mode: "heat"
packages:
climate_base_package: !include advanced/esphome/nspanel_esphome_addon_climate_base.yaml