From abe75ef063ffebdb86ec823fe453aeb14d0bf92c Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sun, 12 Feb 2023 21:58:53 +0100 Subject: [PATCH] Thermostat: Add a setting to explicitly enable the automatic mode With the air conditioning features, this doesn't make much sense any more but it's kept any more for very simple use cases and easier migration. --- ...integrationplugingenericheatingcooling.cpp | 4 +++ ...ntegrationplugingenericheatingcooling.json | 25 ++++++++++++------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/genericheatingcooling/integrationplugingenericheatingcooling.cpp b/genericheatingcooling/integrationplugingenericheatingcooling.cpp index 8e7e153..4b5a2ba 100644 --- a/genericheatingcooling/integrationplugingenericheatingcooling.cpp +++ b/genericheatingcooling/integrationplugingenericheatingcooling.cpp @@ -185,6 +185,10 @@ void IntegrationPluginGenericHeatingCooling::executeAction(ThingActionInfo *info void IntegrationPluginGenericHeatingCooling::thermostatCheckPowerOutputState(Thing *thing) { + bool autoControl = thing->setting(thermostatSettingsAutoControlParamTypeId).toBool(); + if (!autoControl) { + return; + } double targetTemperature = thing->stateValue(thermostatTargetTemperatureStateTypeId).toDouble(); double actualTemperature = thing->stateValue(thermostatTemperatureStateTypeId).toDouble(); double temperatureDifference = thing->setting(thermostatSettingsTemperatureDifferenceParamTypeId).toDouble(); diff --git a/genericheatingcooling/integrationplugingenericheatingcooling.json b/genericheatingcooling/integrationplugingenericheatingcooling.json index 03e8f9f..5238f59 100644 --- a/genericheatingcooling/integrationplugingenericheatingcooling.json +++ b/genericheatingcooling/integrationplugingenericheatingcooling.json @@ -89,15 +89,6 @@ "createMethods": ["user"], "interfaces": ["thermostat"], "settingsTypes": [ - { - "id": "64bf308f-a543-4e02-b787-1a1714c1f978", - "name": "temperatureDifference", - "displayName": "Temperature difference", - "type": "double", - "unit": "DegreeCelsius", - "minValue": 0.00, - "defaultValue": 2.00 - }, { "id": "67451c97-50e1-4ea6-ac43-4386fbd26698", "name": "minTargetTemperature", @@ -117,6 +108,22 @@ "minValue": -99, "maxValue": 100, "defaultValue": 50 + }, + { + "id": "d14676ba-6f7d-439f-ac67-3e91788c9ed1", + "name": "autoControl", + "displayName": "Auto heating/cooling", + "type": "bool", + "defaultValue": false + }, + { + "id": "64bf308f-a543-4e02-b787-1a1714c1f978", + "name": "temperatureDifference", + "displayName": "Temperature difference", + "type": "double", + "unit": "DegreeCelsius", + "minValue": 0.00, + "defaultValue": 2.00 } ], "stateTypes": [