From a8f022cbb88665ccafcb899831209f79873bc783 Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Thu, 14 Nov 2019 21:34:45 -0500 Subject: [PATCH] Fixed #186 - Fan and accessory runtime is not populating properly in summary tables Forgot to update this query to use the new "sum_" prefixed column names. --- api/runtime_thermostat_summary.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/api/runtime_thermostat_summary.php b/api/runtime_thermostat_summary.php index 1803a27..33f1376 100755 --- a/api/runtime_thermostat_summary.php +++ b/api/runtime_thermostat_summary.php @@ -95,17 +95,17 @@ class runtime_thermostat_summary extends cora\crud { `thermostat_id` `thermostat_id`, date(convert_tz(`timestamp`, "UTC", "' . $thermostat['time_zone'] . '")) `date`, count(*) `count`, - sum(case when `compressor_mode` = "cool" then `compressor_1` else 0 end) `compressor_cool_1`, - sum(case when `compressor_mode` = "cool" then `compressor_2` else 0 end) `compressor_cool_2`, - sum(case when `compressor_mode` = "heat" then `compressor_1` else 0 end) `compressor_heat_1`, - sum(case when `compressor_mode` = "heat" then `compressor_2` else 0 end) `compressor_heat_2`, - sum(`auxiliary_heat_1`) `auxiliary_heat_1`, - sum(`auxiliary_heat_2`) `auxiliary_heat_2`, + sum(case when `compressor_mode` = "cool" then `compressor_1` else 0 end) `sum_compressor_cool_1`, + sum(case when `compressor_mode` = "cool" then `compressor_2` else 0 end) `sum_compressor_cool_2`, + sum(case when `compressor_mode` = "heat" then `compressor_1` else 0 end) `sum_compressor_heat_1`, + sum(case when `compressor_mode` = "heat" then `compressor_2` else 0 end) `sum_compressor_heat_2`, + sum(`auxiliary_heat_1`) `sum_auxiliary_heat_1`, + sum(`auxiliary_heat_2`) `sum_auxiliary_heat_2`, sum(`fan`) `fan`, - sum(case when `accessory_type` = "humidifier" then `accessory` else 0 end) `humidifier`, - sum(case when `accessory_type` = "dehumidifier" then `accessory` else 0 end) `dehumidifier`, - sum(case when `accessory_type` = "ventilator" then `accessory` else 0 end) `ventilator`, - sum(case when `accessory_type` = "economizer" then `accessory` else 0 end) `economizer`, + sum(case when `accessory_type` = "humidifier" then `accessory` else 0 end) `sum_humidifier`, + sum(case when `accessory_type` = "dehumidifier" then `accessory` else 0 end) `sum_dehumidifier`, + sum(case when `accessory_type` = "ventilator" then `accessory` else 0 end) `sum_ventilator`, + sum(case when `accessory_type` = "economizer" then `accessory` else 0 end) `sum_economizer`, round(avg(`outdoor_temperature`)) `avg_outdoor_temperature`, round(avg(`outdoor_humidity`)) `avg_outdoor_humidity`, min(`outdoor_temperature`) `min_outdoor_temperature`,