From 346897ac944a2736a809a9be00d908e33d937e5b Mon Sep 17 00:00:00 2001
From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com>
Date: Mon, 18 Dec 2023 22:38:32 +0100
Subject: [PATCH] Initial support to `addon_climate_dual`
---
ReleaseNotes.md | 20 +++++++++
.../nspanel_esphome_addon_climate_base.yaml | 2 +-
.../nspanel_esphome_addon_upload_tft.yaml | 1 -
.../esphome/nspanel_esphome_advanced.yaml | 1 -
advanced/esphome/nspanel_esphome_core.yaml | 1 -
docs/addon_climate.md | 6 +--
docs/customization.md | 1 +
docs/install.md | 5 +--
docs/nspanel_blank.md | 1 +
nspanel_esphome_addon_climate_cool.yaml | 6 +--
nspanel_esphome_addon_climate_dual.yaml | 43 +++++++++++++++++++
nspanel_esphome_addon_climate_heat.yaml | 6 +--
12 files changed, 75 insertions(+), 18 deletions(-)
create mode 100644 nspanel_esphome_addon_climate_dual.yaml
diff --git a/ReleaseNotes.md b/ReleaseNotes.md
index ad961be..31cede4 100644
--- a/ReleaseNotes.md
+++ b/ReleaseNotes.md
@@ -77,6 +77,7 @@ wifi:
10. Chips can be inverted
11. Add swipe control to screensaver page
12. Enhanced control for automation entities on buttons
+13. Dual thermostat controller support (add-on)
## Details of noteworthy changes
@@ -161,6 +162,25 @@ We're pleased to announce a new feature that offers users enhanced control over
1. Apply the setting. This will then be effective across all relevant entities.
This update is specially designed to cater to diverse user needs, ensuring a more intuitive and responsive smart home experience.
+
+
+### 13. Dual thermostat controller support (add-on)
+This new add-on enables the NSPanel to manage both heating and cooling systems simultaneously, utilizing its dual relay functionality.
+
+#### Key Benefits:
+- **Versatility:** Users can now configure their NSPanel to control both a heater and a cooler, offering increased flexibility in home temperature management.
+- **Efficiency:** With the ability to control both heating and cooling systems, the NSPanel can more effectively maintain desired temperatures, potentially leading to energy savings.
+- **User Experience:** This update simplifies the user interface by integrating control of both systems into one panel, making it easier to manage home climate.
+
+#### Implementation Details:
+- The dual thermostat controller functionality allows the NSPanel to utilize both of its relays for separate heating and cooling control.
+Users can configure their heating and cooling settings independently, providing a tailored climate control experience.
+- The update is designed to be intuitive and user-friendly, ensuring a seamless transition for existing NSPanel users.
+- Additional Documentation: For detailed instructions and configurations, refer to the updated [add-on climate documentation](docs/addon_climate.md).
+
+#### Note to Users:
+This feature enhances the capabilities of the NSPanel without compromising its existing functionalities. Users who previously used the NSPanel for single-mode (either heating or cooling) control can now explore dual-mode options for a more comprehensive climate control solution.
+
## What's Next?
Discover what's next and what we are working on right now in our [Milestones](https://github.com/Blackymas/NSPanel_HA_Blueprint/milestones?direction=asc&sort=due_date)
diff --git a/advanced/esphome/nspanel_esphome_addon_climate_base.yaml b/advanced/esphome/nspanel_esphome_addon_climate_base.yaml
index 512fd1c..724f4b6 100644
--- a/advanced/esphome/nspanel_esphome_addon_climate_base.yaml
+++ b/advanced/esphome/nspanel_esphome_addon_climate_base.yaml
@@ -6,7 +6,6 @@
#####################################################################################################
##### ATTENTION: This will add climate elements to the core system and requires the core part. #####
#####################################################################################################
-
---
substitutions:
### Local thermostat defaults ###
@@ -24,6 +23,7 @@ substitutions:
##### DO NOT CHANGE THIS #####
addon_climate_cool: "false"
addon_climate_heat: "false"
+ addon_climate_dual: "false"
##############################
climate:
diff --git a/advanced/esphome/nspanel_esphome_addon_upload_tft.yaml b/advanced/esphome/nspanel_esphome_addon_upload_tft.yaml
index 1354cbc..e8b19e5 100644
--- a/advanced/esphome/nspanel_esphome_addon_upload_tft.yaml
+++ b/advanced/esphome/nspanel_esphome_addon_upload_tft.yaml
@@ -6,7 +6,6 @@
#####################################################################################################
##### ATTENTION: This will add advanced elements to the core system and requires the core part. #####
#####################################################################################################
-
---
substitutions:
################## Defaults ##################
diff --git a/advanced/esphome/nspanel_esphome_advanced.yaml b/advanced/esphome/nspanel_esphome_advanced.yaml
index bfc85ad..098fd2c 100644
--- a/advanced/esphome/nspanel_esphome_advanced.yaml
+++ b/advanced/esphome/nspanel_esphome_advanced.yaml
@@ -6,7 +6,6 @@
#####################################################################################################
##### ATTENTION: This will add advanced elements to the core system and requires the core part. #####
#####################################################################################################
-
---
button:
##### EXIT REPARSE TFT DISPLAY #####
diff --git a/advanced/esphome/nspanel_esphome_core.yaml b/advanced/esphome/nspanel_esphome_core.yaml
index 38162fa..e32c754 100644
--- a/advanced/esphome/nspanel_esphome_core.yaml
+++ b/advanced/esphome/nspanel_esphome_core.yaml
@@ -4,7 +4,6 @@
##### PLEASE only make changes if it is necessary and also the required knowledge is available. #####
##### For normal use with the Blueprint, no changes are necessary. #####
#####################################################################################################
-
---
substitutions:
##### DON'T CHANGE THIS #####
diff --git a/docs/addon_climate.md b/docs/addon_climate.md
index 6d46f07..d5a2743 100644
--- a/docs/addon_climate.md
+++ b/docs/addon_climate.md
@@ -9,12 +9,11 @@ This add-on enables the use of your panel's relays to act as a thermostat (eithe
- 300W/220V/Gang, 600W/220V/Total
- More details on the [Sonoff NSPanel's page](https://sonoff.tech/product/central-control-panel/nspanel/) and the [product specifications document](https://sonoff.tech/wp-content/uploads/2021/11/%E4%BA%A7%E5%93%81%E5%8F%82%E6%95%B0%E8%A1%A8-NSPanel-20210831.pdf).
-2. At this moment you have to choose between `heat` or `cool`. The dual/simultaneous operation is not supported at this moment.
-3. A target temperature must be set on the climate entity in Home Assistant or the page Climate in your panel.
+2. A target temperature must be set on the climate entity in Home Assistant or the page Climate in your panel.
## Installation
-You will need to add the reference to `addon_climate_heat` or `addon_climate_cool` files on your ESPHome settings in the `package` section and after te `remote_package` (base code), as shown bellow (for `heat` in this example):
+You will need to add the reference to `addon_climate_heat`, `addon_climate_cool` or `addon_climate_dual` files on your ESPHome settings in the `package` section and after the `remote_package` (base code), as shown bellow (for `heat` in this example):
```yaml
substitutions:
@@ -101,6 +100,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:
diff --git a/docs/customization.md b/docs/customization.md
index 0a05bd3..8c033a8 100644
--- a/docs/customization.md
+++ b/docs/customization.md
@@ -73,6 +73,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:
diff --git a/docs/install.md b/docs/install.md
index 66f9024..43a9f22 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -84,7 +84,8 @@ packages:
# - advanced/esphome/nspanel_esphome_advanced.yaml # activate advanced (legacy) elements - can be useful for troubleshooting
# - nspanel_esphome_addon_climate_cool.yaml # activate for local climate (cooling) control
# - nspanel_esphome_addon_climate_heat.yaml # activate for local climate (heater) control
- refresh: 1s
+ # - nspanel_esphome_addon_climate_dual.yaml # activate for local climate (dual) control
+ refresh: 300s
esp32:
framework:
@@ -164,5 +165,3 @@ esp32:
* Blueprint file _**"nspanel_blueprint.yaml "**_ can also be installed manually.
* There is also the possibility to upload the TFT file _**"nspanel_us.tft "**_ manually. The whole thing can also be combined with a _**"Folder Watcher "**_.
* additionally we provide the HMI files _**"nspanel_xx.HMI "**_ for the Nextion Editor to customize graphics and programming if needed.
-
-
diff --git a/docs/nspanel_blank.md b/docs/nspanel_blank.md
index 8307aad..aac745e 100644
--- a/docs/nspanel_blank.md
+++ b/docs/nspanel_blank.md
@@ -39,6 +39,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:
diff --git a/nspanel_esphome_addon_climate_cool.yaml b/nspanel_esphome_addon_climate_cool.yaml
index bc2aff3..58927a7 100644
--- a/nspanel_esphome_addon_climate_cool.yaml
+++ b/nspanel_esphome_addon_climate_cool.yaml
@@ -6,7 +6,6 @@
#####################################################################################################
##### ATTENTION: This will add climate elements to the core system and requires the core part. #####
#####################################################################################################
-
---
substitutions:
### Local thermostat defaults ###
@@ -18,7 +17,6 @@ substitutions:
##### DO NOT CHANGE THIS #####
addon_climate_cool: "true"
- addon_climate_heat: "false"
##############################
climate:
@@ -29,10 +27,10 @@ climate:
- switch.turn_on: relay_${cooler_relay}
preset:
- name: "Off"
- default_target_temperature_high: ${temp_min} ${temp_units}
+ default_target_temperature_high: ${temp_max} ${temp_units}
mode: "off"
- name: Home
- default_target_temperature_high: 21 ${temp_units}
+ default_target_temperature_high: 24 ${temp_units}
packages:
climate_base_package: !include advanced/esphome/nspanel_esphome_addon_climate_base.yaml
diff --git a/nspanel_esphome_addon_climate_dual.yaml b/nspanel_esphome_addon_climate_dual.yaml
new file mode 100644
index 0000000..3f03775
--- /dev/null
+++ b/nspanel_esphome_addon_climate_dual.yaml
@@ -0,0 +1,43 @@
+#####################################################################################################
+##### NSPANEL ESPHOME created by Blackymas - https://github.com/Blackymas/NSPanel_HA_Blueprint #####
+##### ESPHome Add-on for Climate control - Dual #####
+##### PLEASE only make changes if it is necessary and also the required knowledge is available. #####
+##### For normal use with the Blueprint, no changes are necessary. #####
+#####################################################################################################
+##### ATTENTION: This will add climate elements to the core system and requires the core part. #####
+#####################################################################################################
+---
+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"
+ ##############################
+
+climate:
+ - id: !extend thermostat_embedded
+ min_cooling_off_time: ${min_off_time}s
+ min_heating_off_time: ${min_off_time}s
+ min_cooling_run_time: ${min_run_time}s
+ min_heating_run_time: ${min_run_time}s
+ cool_action:
+ - switch.turn_on: relay_${cooler_relay}
+ heat_action:
+ - 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}
+ mode: "off"
+ - name: Home
+ default_target_temperature_high: 24 ${temp_units}
+ default_target_temperature_low: 18 ${temp_units}
+
+packages:
+ climate_base_package: !include advanced/esphome/nspanel_esphome_addon_climate_base.yaml
diff --git a/nspanel_esphome_addon_climate_heat.yaml b/nspanel_esphome_addon_climate_heat.yaml
index 6882417..4f2e484 100644
--- a/nspanel_esphome_addon_climate_heat.yaml
+++ b/nspanel_esphome_addon_climate_heat.yaml
@@ -6,7 +6,6 @@
#####################################################################################################
##### ATTENTION: This will add climate elements to the core system and requires the core part. #####
#####################################################################################################
-
---
substitutions:
### Local thermostat defaults ###
@@ -14,10 +13,9 @@ substitutions:
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: "25"
+ temp_max: "45"
##### DO NOT CHANGE THIS #####
- addon_climate_cool: "false"
addon_climate_heat: "true"
##############################
@@ -32,7 +30,7 @@ climate:
default_target_temperature_low: ${temp_min} ${temp_units}
mode: "off"
- name: Home
- default_target_temperature_low: 21 ${temp_units}
+ default_target_temperature_low: 18 ${temp_units}
packages:
climate_base_package: !include advanced/esphome/nspanel_esphome_addon_climate_base.yaml