It is no longer a good idea to have daily_totals_view pull from the device_hist view because device_hist now joins to weather for all readings and daily_totals_view only needs one row per day which is a grouping from device_data. So we need to pull from device_data and compute the things that are needed from device_hist inside the daily totals view.
It is no longer a good idea to have daily_totals_view pull from the device_hist view because device_hist now joins to weather for all readings and daily_totals_view only needs one row per day which is a grouping from device_data. So we need to pull from device_data and compute the things that are needed from device_hist inside the daily totals view.