1
0
mirror of https://github.com/beestat/app.git synced 2025-07-09 03:04:07 -04:00

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.
This commit is contained in:
Jon Ziebell 2019-11-14 21:34:45 -05:00
parent ff7e378132
commit a8f022cbb8

View File

@ -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`,