def run(self, cur_time, points):
        """
        Check application pre-quisites and assemble analysis data set.
        Receives mapped data from the DrivenBaseClass.  Filters non-relevent
        data and assembles analysis data set for diagnostics.
        """
        # topics = self.inp.get_topics()
        # diagnostic_topic = topics[self.fan_status_name][0]
        # cur_time = self.inp.localize_sensor_time(diagnostic_topic, current_time)
        to_zone = dateutil.tz.gettz(self.cur_tz)
        cur_time = cur_time.astimezone(to_zone)

        device_dict = {}
        dx_result = Results()

        for key, value in points.items():
            point_device = [_name.lower() for _name in key.split("&")]
            if point_device[0] not in device_dict:
                device_dict[point_device[0]] = [(point_device[1], value)]
            else:
                device_dict[point_device[0]].append((point_device[1], value))

        fan_status_data = []
        stc_pr_data = []
        fan_sp_data = []

        for key, value in device_dict.items():
            data_name = key
            if value is None:
                continue
            if data_name == self.fan_status_name:
                fan_status_data = data_builder(value, data_name)
            elif data_name == self.duct_stcpr_name:
                stc_pr_data = data_builder(value, data_name)
            elif data_name == self.fan_sp_name:
                fan_sp_data = data_builder(value, data_name)

        missing_data = []
        if not fan_status_data and not fan_sp_data:
            missing_data.append(self.fan_status_name)
        if not stc_pr_data:
            missing_data.append(self.duct_stcpr_name)

        if missing_data:
            dx_result.log("Missing data from publish: {}".format(missing_data))
            return dx_result

        current_fan_status, fan_sp = self.check_fan_status(
            fan_status_data, fan_sp_data, cur_time)

        dx_result = self.sched_aircx.sched_aircx(cur_time, stc_pr_data,
                                                 current_fan_status, dx_result)

        return dx_result
    def run(self, cur_time, points):
        """
        Check application pre-quisites and assemble analysis data set.
        Receives mapped data from the DrivenBaseClass.  Filters non-relevent
        data and assembles analysis data set for diagnostics.
        """
        # topics = self.inp.get_topics()
        # diagnostic_topic = topics[self.fan_status_name][0]
        # cur_time = self.inp.localize_sensor_time(diagnostic_topic, current_time)
        to_zone = dateutil.tz.gettz(self.cur_tz)
        cur_time = cur_time.astimezone(to_zone)

        device_dict = {}
        dx_result = Results()

        for key, value in points.items():
            point_device = [_name.lower() for _name in key.split("&")]
            if point_device[0] not in device_dict:
                device_dict[point_device[0]] = [(point_device[1], value)]
            else:
                device_dict[point_device[0]].append((point_device[1], value))

        fan_status_data = []
        stc_pr_data = []
        fan_sp_data = []

        for key, value in device_dict.items():
            data_name = key
            if value is None:
                continue
            if data_name == self.fan_status_name:
                fan_status_data = data_builder(value, data_name)
            elif data_name == self.duct_stcpr_name:
                stc_pr_data = data_builder(value, data_name)
            elif data_name == self.fan_sp_name:
                fan_sp_data = data_builder(value, data_name)

        missing_data = []
        if not fan_status_data and not fan_sp_data:
            missing_data.append(self.fan_status_name)
        if not stc_pr_data:
            missing_data.append(self.duct_stcpr_name)


        if missing_data:
            dx_result.log("Missing data from publish: {}".format(missing_data))
            return dx_result

        current_fan_status, fan_sp = self.check_fan_status(fan_status_data, fan_sp_data, cur_time)

        dx_result = self.sched_aircx.sched_aircx(cur_time, stc_pr_data, current_fan_status, dx_result)

        return dx_result
示例#3
0
    def run(self, time, inputs):
        results = Results()

        if self.first:
            results.log("First Post!!!!11111ELEVENTY", logging.INFO)
            self.first = False

        inputs["time"] = time

        results.insert_table_row("output", inputs)

        self.counter += 1
        results.command("/awesome/counter", self.counter)

        return results
示例#4
0
    def run(self, time, inputs):
        results = Results()

        if self.first:
            results.log('First Post!!!!11111ELEVENTY', logging.INFO)
            self.first = False

        inputs['time'] = time

        results.insert_table_row('output', inputs)

        self.counter += 1
        results.command('/awesome/counter', self.counter)

        return results
    def run(self, current_time, points):
        """
        Check application pre-quisites and assemble analysis data set.
        Receives mapped data from the DrivenBaseClass.  Filters non-relevent
        data and assembles analysis data set for diagnostics.
        """
        # topics = self.inp.get_topics()
        # diagnostic_topic = topics[self.fan_status_name][0]
        # cur_time = self.inp.localize_sensor_time(diagnostic_topic, current_time)
        to_zone = dateutil.tz.gettz(self.cur_tz)
        cur_time = current_time.astimezone(to_zone)
        device_dict = {}
        dx_result = Results()

        for key, value in points.items():
            point_device = [_name.lower() for _name in key.split("&&&")]
            if point_device[0] not in device_dict:
                device_dict[point_device[0]] = [(point_device[1], value)]
            else:
                device_dict[point_device[0]].append((point_device[1], value))

        fan_status_data = []
        fan_sp_data = []
        stc_pr_data = []
        stcpr_stpt_data = []
        zn_dmpr_data = []

        for key, value in device_dict.items():
            data_name = key
            if value is None:
                continue
            if data_name == self.fan_status_name:
                fan_status_data = data_builder(value, data_name)
            elif data_name == self.fan_sp_name:
                fan_sp_data = data_builder(value, data_name)
            elif data_name == self.duct_stcpr_stpt_name:
                stcpr_stpt_data = data_builder(value, data_name)
            elif data_name == self.duct_stcpr_name:
                stc_pr_data = data_builder(value, data_name)
            elif data_name == self.zn_damper_name:
                zn_dmpr_data = data_builder(value, data_name)

        missing_data = []
        if not stc_pr_data:
            missing_data.append(self.duct_stcpr_name)
        if not stcpr_stpt_data:
            dx_result.log('Duct static pressure set point data is '
                          'missing. This will limit the effectiveness of '
                          'the duct static pressure diagnostics.')
        missing_data = []
        if not fan_status_data and not fan_sp_data:
            missing_data.append(self.fan_status_name)
        if not stc_pr_data:
            missing_data.append(self.duct_stcpr_name)
        if not stcpr_stpt_data:
            dx_result.log("Duct static pressure set point data is missing.")
        if not zn_dmpr_data:
            missing_data.append(self.zn_damper_name)

        if missing_data:
            dx_result.log("Missing data from publish: {}".format(missing_data))
            return dx_result

        current_fan_status, fan_sp = self.check_fan_status(
            fan_status_data, fan_sp_data, cur_time)
        dx_result = self.check_elapsed_time(dx_result, cur_time,
                                            self.unit_status, FAN_OFF)

        if not current_fan_status:
            dx_result.log("Supply fan is off: {}".format(cur_time))
            self.warm_up_flag = True
            return dx_result

        dx_result.log("Supply fan is on: {}".format(cur_time))

        low_sf_cond = True if fan_sp is not None and fan_sp > self.high_sf_thr else False
        high_sf_cond = True if fan_sp is not None and fan_sp < self.low_sf_thr else False

        if self.warm_up_flag:
            self.warm_up_flag = False
            self.warm_up_start = cur_time
            return dx_result

        if self.warm_up_start is not None and (
                cur_time - self.warm_up_start) < self.warm_up_time:
            dx_result.log("Unit is in warm-up. Data will not be analyzed.")
            return dx_result

        dx_result = self.stcpr_aircx.stcpr_aircx(cur_time, stcpr_stpt_data,
                                                 stc_pr_data, zn_dmpr_data,
                                                 low_sf_cond, high_sf_cond,
                                                 dx_result)
        dx_result = self.stcpr_reset_aircx.stcpr_reset_aircx(
            cur_time, stcpr_stpt_data, dx_result)

        return dx_result
    def run(self, cur_time, points):

        to_zone = dateutil.tz.gettz(self.cur_tz)
        cur_time = cur_time.astimezone(to_zone)
        device_dict = {}
        dx_result = Results()

        for key, value in points.items():
            point_device = [_name.lower() for _name in key.split("&&&")]
            if point_device[0] not in device_dict:
                device_dict[point_device[0]] = [(point_device[1], value)]
            else:
                device_dict[point_device[0]].append((point_device[1], value))

        fan_status_data = []
        fan_sp_data = []
        zn_dmpr_data = []
        sat_data = []
        zn_rht_data = []
        sat_stpt_data = []

        def data_builder(value_tuple, point_name):
            value_list = []
            for item in value_tuple:
                value_list.append(item[1])
            return value_list

        for key, value in device_dict.items():
            data_name = key
            if value is None:
                continue
            if data_name == self.fan_status_name:
                fan_status_data = data_builder(value, data_name)
            elif data_name == self.fan_sp_name:
                fan_sp_data = data_builder(value, data_name)
            elif data_name == self.sat_stpt_name:
                sat_stpt_data = data_builder(value, data_name)
            elif data_name == self.sat_name:
                sat_data = data_builder(value, data_name)
            elif data_name == self.zn_reheat_name:
                zn_rht_data = data_builder(value, data_name)
            elif data_name == self.zn_damper_name:
                zn_dmpr_data = data_builder(value, data_name)

        missing_data = []
        if not sat_data:
            missing_data.append(self.sat_name)
        if not zn_rht_data:
            missing_data.append(self.zn_reheat_name)
        if not sat_stpt_data:
            dx_result.log('Supply-air temperature set point data is '
                          'missing. This will limit the effectiveness of '
                          'the supply-air temperature diagnostics.')
        if not fan_status_data and not fan_sp_data:
            missing_data.append(self.fan_status_name)
        if not zn_dmpr_data:
            missing_data.append(self.zn_damper_name)

        if missing_data:
            dx_result.log('Missing required data: {}'.format(missing_data))
            return dx_result

        current_fan_status, fan_sp = self.check_fan_status(
            fan_status_data, fan_sp_data, cur_time)
        dx_result = self.check_elapsed_time(dx_result, cur_time,
                                            self.unit_status, FAN_OFF)

        if not current_fan_status:
            dx_result.log("Supply fan is off: {}".format(cur_time))
            self.warm_up_flag = True
            return dx_result

        dx_result.log("Supply fan is on: {}".format(cur_time))

        if self.warm_up_flag:
            self.warm_up_flag = False
            self.warm_up_start = cur_time
            return dx_result

        if self.warm_up_start is not None and (
                cur_time - self.warm_up_start) < self.warm_up_time:
            dx_result.log("Unit is in warm-up. Data will not be analyzed.")
            return dx_result

        dx_result = self.satr_reset_aircx.sat_reset_aircx(
            cur_time, sat_stpt_data, dx_result)
        dx_result = self.sat_aircx.sat_aircx(cur_time, sat_data, sat_stpt_data,
                                             zn_rht_data, zn_dmpr_data,
                                             dx_result)
        return dx_result
示例#7
0
 def shutdown(self):
     results = Results()
     results.log("ARG!! I DIED!!", logging.INFO)
     return results
示例#8
0
    def run(self,current_time,points):
        '''
        Check application pre-quisites and assemble data set for analysis.
        '''
        device_dict = {}
        diagnostic_result = Results()

        for key, value in points.items():
            device_dict[key.lower()] = value

        Application.pre_msg_time.append(current_time)
        message_check =  datetime.timedelta(minutes=(self.data_window))
 
        if (Application.pre_msg_time[-1]-Application.pre_msg_time[0]) >= message_check:
            msg_lst = [self.pre_msg0, self.pre_msg1, self.pre_msg2, self.pre_msg3, self.pre_msg4, 
                       self.pre_msg5,self.pre_msg6, self.pre_msg7, self.pre_msg8, self.pre_msg9, self.pre_msg10,
                       self.pre_msg11, self.pre_msg12]
            for item in msg_lst:
                if Application.pre_requiste_messages.count(item) > (0.25)*len(Application.pre_msg_time):
                    diagnostic_result.log(item, logging.INFO)
            Application.pre_requiste_messages = []
            Application.pre_msg_time = []

        fan_stat_check = False
        for key, value in device_dict.items():
            if key.startswith(self.fan_status_name): 
                fan_stat_check = True
                if int(value) == 0:
                    self.pre_requiste_messages.append(self.pre_msg1)
                    return diagnostic_result
        if not fan_stat_check:
            Application.pre_requiste_messages.append(self.pre_msg2)
            return diagnostic_result

        damper_data, oatemp_data, matemp_data = [], [], []
        ratemp_data, cooling_data = [], [] 

        for key, value in device_dict.items():
            if key.startswith(self.damper_signal_name) and value != None: 
                damper_data.append(value)

            elif key.startswith(self.oa_temp_name) and value != None:
                oatemp_data.append(value)
                
            elif key.startswith(self.ma_temp_name) and value != None: 
                matemp_data.append(value)

            elif key.startswith(self.ra_temp_name) and value != None:
                ratemp_data.append(value)
            
            elif key.startswith(self.cool_call_name) and value != None:
                cooling_data.append(value)
        
        if not oatemp_data:
            Application.pre_requiste_messages.append(self.pre_msg3)
 
        if not ratemp_data:
            Application.pre_requiste_messages.append(self.pre_msg4)
           
        if not matemp_data:
            Application.pre_requiste_messages.append(self.pre_msg5)
 
        if not damper_data:
            Application.pre_requiste_messages.append(self.pre_msg6)
           
        if not cooling_data:
            Application.pre_requiste_messages.append(self.pre_msg7)

        if not (oatemp_data and ratemp_data and matemp_data and
            damper_data and cooling_data):
            return diagnostic_result
        
        oatemp = (sum(oatemp_data)/len(oatemp_data))
        ratemp = (sum(ratemp_data)/len(ratemp_data))
        matemp = (sum(matemp_data)/len(matemp_data))
        damper_signal = (sum(damper_data)/len(damper_data))

        limit_check = False
        if oatemp < self.oat_low_threshold or oatemp > self.oat_high_threshold:
            Application.pre_requiste_messages.append(self.pre_msg8)
            limit_check = True
        if ratemp < self.rat_low_threshold or ratemp > self.rat_high_threshold:
            Application.pre_requiste_messages.append(self.pre_msg9)
            limit_check = True
        if matemp < self.mat_low_threshold or matemp > self.mat_high_threshold:
            Application.pre_requiste_messages.append(self.pre_msg10)
            limit_check = True

        if limit_check:
            return diagnostic_result

        if abs(oatemp - ratemp) < self.oa_ra_tempdiff_threshold:
            diagnostic_result.log('Conditions are not favorable for diagnostics ' 
                                  'data corresponding to {timestamp} will not be used.'.format(timestamp=str(current_time)), logging.INFO)
            return diagnostic_result

        device_type_error = False
        if self.device_type == 'ahu':
            cooling_valve = sum(cooling_data)/len(cooling_data)
            if cooling_valve > self.cooling_enabled_threshold: 
                cooling_call = True
            else:
                cooling_call = False
        elif self.device_type == 'rtu':
            cooling_call = int(max(cooling_data))
        else:
            device_type_error = True
            diagnostic_result.log('device_type must be specified as "AHU" or "RTU" check Configuration input.', logging.INFO)
            
        if device_type_error:
            return diagnostic_result
        
        if self.economizer_type[0] == 'ddb':
            economizer_conditon = (oatemp < (ratemp - self.temp_deadband))
        else:
            economizer_conditon = (oatemp < (self.economizer_type[1] - self.temp_deadband))

        diagnostic_result = self.econ1.econ_alg1(diagnostic_result,cooling_call, oatemp, ratemp, 
                                                                    matemp, damper_signal,current_time)

        try:
            if temperature_sensor_dx.temp_sensor_problem == None:
                Application.pre_requiste_messages.append(self.pre_msg12)
                return diagnostic_result
            elif temperature_sensor_dx.temp_sensor_problem != None and self.pre_msg12 in Application.pre_requiste_messages:
                Application.pre_requiste_messages = [x for x in Application.pre_requiste_messages if x != self.pre_msg12]
            if temperature_sensor_dx.temp_sensor_problem == True:
                Application.pre_requiste_messages.append(self.pre_msg11)
                return diagnostic_result
        except:
            pass

        diagnostic_result = self.econ2.econ_alg2(diagnostic_result,cooling_call, oatemp, ratemp, 
                                                                    matemp, damper_signal,economizer_conditon,current_time)
        diagnostic_result = self.econ3.econ_alg3(diagnostic_result,cooling_call, oatemp, ratemp, 
                                                                    matemp, damper_signal,economizer_conditon,current_time)
        diagnostic_result = self.econ4.econ_alg4(diagnostic_result,cooling_call, oatemp, ratemp, 
                                                                    matemp, damper_signal,economizer_conditon,current_time)
        diagnostic_result = self.econ5.econ_alg5(diagnostic_result,cooling_call, oatemp, ratemp, 
                                                                    matemp, damper_signal,economizer_conditon,current_time)
        return diagnostic_result
示例#9
0
 def shutdown(self):
     results = Results()
     results.log('ARG!! I DIED!!', logging.INFO)
     return results
    def run(self, current_time, points):
        """
        Check application pre-quisites and assemble analysis data set.
        Receives mapped data from the DrivenBaseClass.  Filters non-relevent
        data and assembles analysis data set for diagnostics.
        """
        # topics = self.inp.get_topics()
        # diagnostic_topic = topics[self.fan_status_name][0]
        # cur_time = self.inp.localize_sensor_time(diagnostic_topic, current_time)
        to_zone = dateutil.tz.gettz(self.cur_tz)
        cur_time = current_time.astimezone(to_zone)
        device_dict = {}
        dx_result = Results()

        for key, value in points.items():
            point_device = [_name.lower() for _name in key.split("&&&")]
            if point_device[0] not in device_dict:
                device_dict[point_device[0]] = [(point_device[1], value)]
            else:
                device_dict[point_device[0]].append((point_device[1], value))

        fan_status_data = []
        fan_sp_data = []
        stc_pr_data = []
        stcpr_stpt_data = []
        zn_dmpr_data = []

        for key, value in device_dict.items():
            data_name = key
            if value is None:
                continue
            if data_name == self.fan_status_name:
                fan_status_data = data_builder(value, data_name)
            elif data_name == self.fan_sp_name:
                fan_sp_data = data_builder(value, data_name)
            elif data_name == self.duct_stcpr_stpt_name:
                stcpr_stpt_data = data_builder(value, data_name)
            elif data_name == self.duct_stcpr_name:
                stc_pr_data = data_builder(value, data_name)
            elif data_name == self.zn_damper_name:
                zn_dmpr_data = data_builder(value, data_name)

        missing_data = []
        if not stc_pr_data:
            missing_data.append(self.duct_stcpr_name)
        if not stcpr_stpt_data:
            dx_result.log('Duct static pressure set point data is '
                          'missing. This will limit the effectiveness of '
                          'the duct static pressure diagnostics.')
        missing_data = []
        if not fan_status_data and not fan_sp_data:
            missing_data.append(self.fan_status_name)
        if not stc_pr_data:
            missing_data.append(self.duct_stcpr_name)
        if not stcpr_stpt_data:
            dx_result.log("Duct static pressure set point data is missing.")
        if not zn_dmpr_data:
            missing_data.append(self.zn_damper_name)

        if missing_data:
            dx_result.log("Missing data from publish: {}".format(missing_data))
            return dx_result

        current_fan_status, fan_sp = self.check_fan_status(fan_status_data, fan_sp_data, cur_time)
        dx_result = self.check_elapsed_time(dx_result, cur_time, self.unit_status, FAN_OFF)

        if not current_fan_status:
            dx_result.log("Supply fan is off: {}".format(cur_time))
            self.warm_up_flag = True
            return dx_result

        dx_result.log("Supply fan is on: {}".format(cur_time))

        low_sf_cond = True if fan_sp is not None and fan_sp > self.high_sf_thr else False
        high_sf_cond = True if fan_sp is not None and fan_sp < self.low_sf_thr else False

        if self.warm_up_flag:
            self.warm_up_flag = False
            self.warm_up_start = cur_time
            return dx_result

        if self.warm_up_start is not None and (cur_time - self.warm_up_start) < self.warm_up_time:
            dx_result.log("Unit is in warm-up. Data will not be analyzed.")
            return dx_result

        dx_result = self.stcpr_aircx.stcpr_aircx(cur_time, stcpr_stpt_data, stc_pr_data,
                                                 zn_dmpr_data, low_sf_cond, high_sf_cond,
                                                 dx_result)
        dx_result = self.stcpr_reset_aircx.stcpr_reset_aircx(cur_time, stcpr_stpt_data, dx_result)

        return dx_result
示例#11
0
    def run(self,current_time, points):
        '''
        Check algorithm pre-quisites and assemble data set for analysis.
        '''
        device_dict = {}
        diagnostic_result = Results()

        for key, value in points.items():
            device_dict[key.lower()] = value

        self.pre_msg_time.append(current_time)
        message_check =  datetime.timedelta(minutes=(self.data_window))

        if (self.pre_msg_time[-1]-self.pre_msg_time[0]) >= message_check:
            msg_lst = [self.pre_msg1, self.pre_msg2, self.pre_msg3, self.pre_msg4, self.pre_msg5, 
                       self.pre_msg6, self.pre_msg7, self.pre_msg8, self.pre_msg9, self.pre_msg10,
                       self.pre_msg11, Application.pre_msg12, Application.pre_msg13]
            for item in msg_lst:
                if self.pre_requiste_messages.count(item) > (0.25)*len(self.pre_msg_time):
                    diagnostic_result.log(item, logging.INFO)
            self.pre_requiste_messages = []
            self.pre_msg_time = []
        
        
        flow_check, dp_data = self.data_check(device_dict,self.loop_dp_name,self.loop_dp_stpt_name)

        for value in dp_data:
            if value < self.min_dp_threshold:
                Application.pre_requiste_messages.append(self.pre_msg1)
                return diagnostic_result
            elif value > self.max_dp_threshold:
                Application.pre_requiste_messages.append(self.pre_msg2)
                return diagnostic_result

        if not flow_check or not dp_data:
            pump_id = fnmatch.filter(device_dict,''.join(['*', self.pump_status_name, '*']))

            if not pump_id:
                Application.pre_requiste_messages.append(self.pre_msg3)
                return diagnostic_result

            pump_stat = (list(device_dict[val] for val in pump_id if val in 
                              device_dict and int(device_dict[val]) > 0))

            if not pump_stat:
                Application.pre_requiste_messages.append(self.pre_msg4)
                return diagnostic_result

        boiler_id = fnmatch.filter(device_dict,''.join(['*', self.boiler_status_name,'*']))
        boiler_stat= (list(device_dict[val] for val in boiler_id if val in device_dict 
                           and int(device_dict[val]) > 0))  
        if not boiler_stat:
            Application.pre_requiste_messages.append(self.pre_msg5)
            return diagnostic_result
    
        loop_dp_values = []
        rht_vlv_values = []
        oa_temp_values = []
        loop_dp_stpt_values = []
        hw_pump_vfd_values = []
        hw_stsp_values = []
        hws_temp_values = []
        hwr_temp_values = []

        for key, value in device_dict.items():
            if key.startswith(self.loop_dp_stpt_name) and value != None:
                loop_dp_stpt_values.append(value)
            elif key.startswith(self.loop_dp_name) and value != None: 
                loop_dp_values.append(value)
            elif key.startswith(self.zone_reheat_name) and value != None: 
                rht_vlv_values.append(value)
            elif key.startswith(self.oa_temp_name) and value != None:
                oa_temp_values.append(value)
            elif key.startswith(self.hw_pump_vfd_name) and value != None:
                hw_pump_vfd_values.append(value)
            elif key.startswith(self.hw_stsp_name) and value != None: 
                hw_stsp_values.append(value)
            elif key.startswith(self.hws_temp_name) and value != None:
                hws_temp_values.append(value)
            elif key.startswith(self.hwr_temp_name) and value != None: 
                hwr_temp_values.append(value)

        if not oa_temp_values:
            Application.pre_requiste_messages.append(self.pre_msg6)
        if not rht_vlv_values:
            Application.pre_requiste_messages.append(self.pre_msg7)
        if not loop_dp_values:
            Application.pre_requiste_messages.append(self.pre_msg8)
        if not hw_pump_vfd_values:
            Application.pre_requiste_messages.append(self.pre_msg9)
        if not hws_temp_values:
            Application.pre_requiste_messages.append(self.pre_msg10)
        if not hwr_temp_values:
            Application.pre_requiste_messages.append(self.pre_msg11)

        if (not (oa_temp_values and rht_vlv_values and loop_dp_values) and
            not (hws_temp_values and hwr_temp_values)):
            return diagnostic_result
        
        diagnostic_result = self.hw_dx1.hw_dp_dx(diagnostic_result, current_time, oa_temp_values, loop_dp_stpt_values,
                                                   loop_dp_values,rht_vlv_values, hw_pump_vfd_values)
        diagnostic_result = self.hw_dx2.hw_temp_dx(diagnostic_result, current_time, hws_temp_values, hwr_temp_values,
                                                   hw_pump_vfd_values, rht_vlv_values, oa_temp_values)
        return diagnostic_result
    def run(self, current_time, points):
        """
        Check application pre-quisites and assemble analysis data set.
        Receives mapped data from the DrivenBaseClass.  Filters non-relevent
        data and assembles analysis data set for diagnostics.
        """
        # topics = self.inp.get_topics()
        # diagnostic_topic = topics[self.fan_status_name][0])
        # cur_time = self.inp.localize_sensor_time(diagnostic_topic, current_time)
        to_zone = dateutil.tz.gettz(self.cur_tz)
        cur_time = current_time.astimezone(to_zone)
        device_dict = {}
        diagnostic_result = Results()
        fan_status_data = []
        supply_fan_off = False

        for key, value in points.items():
            point_device = [_name.lower() for _name in key.split('&&&')]
            print(point_device)
            if point_device[0] not in device_dict:
                device_dict[point_device[0]] = [(point_device[1], value)]
            else:
                device_dict[point_device[0]].append((point_device[1], value))

        if self.fan_status_name in device_dict:
            fan_status = device_dict[self.fan_status_name]
            fan_status = [point[1] for point in fan_status]
            fan_status = [status for status in fan_status if status is not None]
            if fan_status:
                fan_status_data.append(min(fan_status))
                if not int(fan_status_data[0]):
                    supply_fan_off = True
                    self.warm_up_flag = True

        if self.fan_speedcmd_name in device_dict:
            fan_speed = device_dict[self.fan_speedcmd_name]
            fan_speed = mean([point[1] for point in fan_speed])
            if self.fan_status_name is None:
                if not int(fan_speed):
                    supply_fan_off = True
                    self.warm_up_flag = True
                fan_status_data.append(bool(int(fan_speed)))


        zn_dmpr_data = []
        satemp_data = []
        rht_data = []
        sat_stpt_data = []

        def data_builder(value_tuple, point_name):
            value_list = []
            for item in value_tuple:
                value_list.append(item[1])
            return value_list

        for key, value in device_dict.items():
            data_name = key
            if value is None:
                continue
            elif data_name == self.sat_stpt_name:
                sat_stpt_data = data_builder(value, data_name)
            elif data_name == self.sa_temp_name:
                satemp_data = data_builder(value, data_name)
            elif data_name == self.zone_reheat_name:
                rht_data = data_builder(value, data_name)
            elif data_name == self.zone_damper_name:
                zn_dmpr_data = data_builder(value, data_name)

        missing_data = []
        if not satemp_data:
            missing_data.append(self.sa_temp_name)
        if not rht_data:
            missing_data.append(self.zone_reheat_name)
        if not sat_stpt_data:
            diagnostic_result.log('Supply-air temperature set point data is '
                                  'missing. This will limit the effectiveness of '
                                  'the supply-air temperature diagnostics.')
        if not zn_dmpr_data:
            missing_data.append(self.zone_damper_name)
        if not fan_status:
            missing_data.append(self.fan_status_name)
        if missing_data:
            diagnostic_result.log('Missing required data: {}'.format(missing_data))
            return diagnostic_result

        if supply_fan_off:
            diagnostic_result.log('Supply fan is off. Data will not be used for '
                                  'retuning diagnostics.')
            return diagnostic_result
        if self.warm_up_flag:
            self.warm_up_flag = False
            self.warm_up_start = cur_time
            return diagnostic_result
        time_check = td(minutes=self.warm_up_time)
        if self.warm_up_start is not None and (cur_time - self.warm_up_start) < time_check:
            diagnostic_result.log('Unit may be in warm-up. Data will not be analyzed.')
            return diagnostic_result
        dx_status, diagnostic_result = self.sat_dx.sat_rcx(cur_time, satemp_data, sat_stpt_data,
                                                           rht_data, zn_dmpr_data, diagnostic_result)
        return diagnostic_result