Beispiel #1
0
    def output_format(cls, input_object):
        output_needs = super().output_format(input_object)
        #Called when app is staged
        topic_map = input_object.get_topics()
        # Work with topics["OAT"][0] to get building topic
#         descriptor_column = 'site/building/analysis/description'
        output_needs['output'] = {'time': OutputDescriptor('timestamp', 'time')}

        out_col_fmt = '{g}_{n}'

        #Table per topic, regardless of group
        for group, topic_list in topic_map.items():
            for i, topic in enumerate(topic_list,start=1):
                out_topic = topic+'/output'
                out_col = out_col_fmt.format(g=group, n=i)
                output_needs['output'][out_col] = OutputDescriptor('string', out_topic)

#tables for groups

#         for group in topic_map:
#             table = table_name.format(input_group= group)
#             output_needs[table] = {}
#             for topic in topic_map[group]:
#                 outputle_needs[output_needs[table]][topic] = OutputDescriptor('String', output_topic.format(input_topic=topic))
#
        return output_needs
Beispiel #2
0
    def output_format(cls, input_object):
        # Called when app is staged
        """
        Output:
            Energy Signature: outside air temperature and loads.
                Data will be used to scatter plot.
            Weather Sensitivity: dependent on OAT and loads.
        """
        topics = input_object.get_topics()
        load_topic = topics['load'][0]
        load_topic_parts = load_topic.split('/')
        output_topic_base = load_topic_parts[:-1]
        weather_topic = '/'.join(output_topic_base +
                                 ['energysignature', 'weather sensitivity'])
        oat_topic = '/'.join(output_topic_base + ['energysignature', 'oat'])
        load_topic = '/'.join(output_topic_base + ['energysignature', 'load'])

        output_needs = {
            WEATHER_SENSITIVITY_TABLE_NAME: {
                'value': OutputDescriptor('string', weather_topic)
            },
            LOAD_VS_OAT_TABLE_NAME: {
                'oat': OutputDescriptor('float', oat_topic),
                'load': OutputDescriptor('float', load_topic)
            }
        }
        return output_needs
Beispiel #3
0
    def output_format(cls, input_object):
        # Called when app is staged
        """
        Output is the year with its respective load and natural gas amounts
        aggregated over the year.
        """
        topics = input_object.get_topics()
        base_topic = topics['load'][0]
        load_topic_parts = base_topic.split('/')
        output_topic_base = load_topic_parts[:-1]

        year_topic = '/'.join(output_topic_base + ['longitudinalbm', 'time'])
        load_topic = '/'.join(output_topic_base + ['longitudinalbm', 'load'])
        gas_topic = '/'.join(output_topic_base + ['longitudinalbm', 'natgas'])

        #stuff needed to put inside output, will output by row, each new item
        #is a new file, title must match title in execute when writing to out
        output_needs = {
            'Longitudinal_BM': {
                'year': OutputDescriptor('integer', year_topic),
                'load': OutputDescriptor('float', load_topic),
                'natgas': OutputDescriptor('float', gas_topic)
            }
        }
        return output_needs
    def output_format(cls, input_object):
        # Called when app is staged
        """
        Output:
            datetimeValues: datetime objectes for each energy value.
            predictedValues: values returned after applying the day_time model
            measuredValues: values directly measured from the building
        """
        topics = input_object.get_topics()
        load_topic = topics['load'][0]
        load_topic_parts = load_topic.split('/')
        output_topic_base = load_topic_parts[:-1]

        # TODO: Should names derived from "day time temperature model" be replaced, to
        # reflect the new branding of this application as "whole building energy savings"?
        time_values = '/'.join(output_topic_base +
                               ['daytimetemperature', 'datetime'])
        predicted_values = '/'.join(output_topic_base +
                                    ['daytimetemperature', 'predicted'])
        measured_values = '/'.join(output_topic_base +
                                   ['daytimetemperature', 'measured'])
        cusum_values = '/'.join(output_topic_base +
                                ['daytimetemperature', 'cusum'])

        output_needs = {
            'DayTimeTemperatureModel': {
                'datetimeValues': OutputDescriptor('datetime', time_values),
                'measured': OutputDescriptor('float', measured_values),
                'predicted': OutputDescriptor('float', predicted_values),
                'cumulativeSum': OutputDescriptor('float', cusum_values)
            }
        }
        return output_needs
 def output_format(cls, input_object):
     '''Called when application is staged.
     Output will have the date-time and  error-message.
     '''
     result = super().output_format(input_object)
     topics = input_object.get_topics()
     diagnostic_topic = topics[cls.loop_dp_name][0]
     diagnostic_topic_parts = diagnostic_topic.split('/')
     output_topic_base = diagnostic_topic_parts[:-1]
     datetime_topic = '/'.join(output_topic_base+['Hot_water_RCx', 'date'])
     message_topic = '/'.join(output_topic_base+['Hot_water_RCx',
                                                 'message'])
     diagnostic_name = '/'.join(output_topic_base+['Hot_water_RCx',
                                                   'Hot_water_RCx'])
     energy_impact = '/'.join(output_topic_base+['Hot_water_RCx',
                                                 'energy_impact'])
     color_code = '/'.join(output_topic_base+['Hot_water_RCx',
                                              'color_code'])
     output_needs = {
         'Hot_water_RCx': {
             'datetime': OutputDescriptor('string', datetime_topic),
             'diagnostic_name': OutputDescriptor('string', diagnostic_name),
             'diagnostic_message': OutputDescriptor('string',
                                                    message_topic),
             'energy_impact': OutputDescriptor('float', energy_impact),
             'color_code': OutputDescriptor('string', color_code)
             }
         }
     result.update(output_needs)
     return result
    def output_format(cls, input_object):
        """
        Describes how the output or results will be formatted
        Output will have the date-time, error-message, color-code,
        and energy impact.
        """
        result = super().output_format(input_object)
        topics = input_object.get_topics()
        diagnostic_topic = topics[cls.fan_status_name][0]
        diagnostic_topic_parts = diagnostic_topic.split('/')
        output_topic_base = diagnostic_topic_parts[:-1]
        datetime_topic = '/'.join(output_topic_base + ['Airside_RCx', 'date'])
        message_topic = '/'.join(output_topic_base +
                                 ['Airside_RCx', 'message'])
        diagnostic_name = '/'.join(output_topic_base +
                                   ['Airside_RCx', ' diagnostic_name'])
        energy_impact = '/'.join(output_topic_base +
                                 ['Airside_RCx', 'energy_impact'])
        color_code = '/'.join(output_topic_base +
                              ['Airside_RCx', 'color_code'])

        output_needs = {
            'Airside_RCx': {
                'datetime': OutputDescriptor('string', datetime_topic),
                'diagnostic_name': OutputDescriptor('string', diagnostic_name),
                'diagnostic_message': OutputDescriptor('string',
                                                       message_topic),
                'energy_impact': OutputDescriptor('float', energy_impact),
                'color_code': OutputDescriptor('string', color_code)
            }
        }
        result.update(output_needs)
        return result
Beispiel #7
0
    def output_format(cls, input_object):
        '''Called when application is staged.
        Output will have the date-time and  error-message.
        '''
        result = super().output_format(input_object)
        topics = input_object.get_topics()
        diagnostic_topic = topics[cls.hws_temp_name][0]
        diagnostic_topic_parts = diagnostic_topic.split('/')
        output_topic_base = diagnostic_topic_parts[:-1]
        datetime_topic = '/'.join(output_topic_base + [cls.table_name, 'date'])

        loop_dp_topic = '/'.join(output_topic_base +
                                 [cls.table_name, cls.loop_dp_name])
        loop_dp_stpt_topic = '/'.join(output_topic_base +
                                      [cls.table_name, cls.loop_dp_stpt_name])
        pump_status_topic = '/'.join(output_topic_base +
                                     [cls.table_name, cls.pump_status_name])
        boiler_status_topic = '/'.join(
            output_topic_base + [cls.table_name, cls.boiler_status_name])
        hw_pump_vfd_topic = '/'.join(output_topic_base +
                                     [cls.table_name, cls.hw_pump_vfd_name])
        hws_temp_topic = '/'.join(output_topic_base +
                                  [cls.table_name, cls.hws_temp_name])
        hw_stsp_topic = '/'.join(output_topic_base +
                                 [cls.table_name, cls.hw_stsp_name])
        hwr_temp_topic = '/'.join(output_topic_base +
                                  [cls.table_name, cls.hwr_temp_name])
        oat_topic = '/'.join(output_topic_base +
                             [cls.table_name, cls.oa_temp_name])

        output_needs = {
            cls.table_name: {
                'datetime':
                OutputDescriptor('string', datetime_topic),
                'OutdoorAirTemperature':
                OutputDescriptor('float', oat_topic),
                'LoopDifferentialPressure':
                OutputDescriptor('float', loop_dp_topic),
                'LoopDifferentialPressureSetPoint':
                OutputDescriptor('float', loop_dp_stpt_topic),
                'PumpStatus':
                OutputDescriptor('float', pump_status_topic),
                'BoilerStatus':
                OutputDescriptor('float', boiler_status_topic),
                'HotWaterPumpVfd':
                OutputDescriptor('float', hw_pump_vfd_topic),
                'HotWaterSupplyTemperature':
                OutputDescriptor('float', hws_temp_topic),
                'HotWaterTemperatureSetPoint':
                OutputDescriptor('float', hw_stsp_topic),
                'HotWaterReturnTemperature':
                OutputDescriptor('float', hwr_temp_topic),
            }
        }
        result.update(output_needs)
        return result
Beispiel #8
0
    def output_format(cls, input_object):
        '''Called when application is staged.

        Output will have the date-time and  error-message.
        '''
        result = super().output_format(input_object)
        topics = input_object.get_topics()

        output_needs = {
            cls.table_name: {
                'datetime': OutputDescriptor('string', '')
            }
        }

        for zone_topic in cls.zone_topics:
            if zone_topic in topics.keys():
                for i, topic in enumerate(topics[zone_topic], start=1):
                    topic_parts = topic.split('/')
                    zone = topic_parts[-2]
                    output_needs[cls.table_name][zone_topic + cls.sep +
                                                 zone] = OutputDescriptor(
                                                     'float', '')

        # for topic in topics[cls.zone_temp_name]:
        #     topic_parts = topic.split('/')
        #     zone = topic_parts[2]
        #     output_needs[cls.table_name][cls.zone_temp_name + cls.sep +zone] = OutputDescriptor('float', '')
        #
        # for topic in topics[cls.zone_setpoint_name]:
        #     topic_parts = topic.split('/')
        #     zone = topic_parts[2]
        #     output_needs[cls.table_name][cls.zone_setpoint_name + cls.sep + zone] = OutputDescriptor('float', "")
        #
        # for topic in topics[cls.zone_reheatvlv_name]:
        #     topic_parts = topic.split('/')
        #     zone = topic_parts[2]
        #     output_needs[cls.table_name][cls.zone_reheatvlv_name + cls.sep + zone] = OutputDescriptor('float', '')
        #
        # for topic in topics[cls.zone_occ_name]:
        #     topic_parts = topic.split('/')
        #     zone = topic_parts[2]
        #     output_needs[cls.table_name][cls.zone_occ_name + cls.sep + zone] = OutputDescriptor('float', '')
        #
        # for topic in topics[cls.zone_damperpos_name]:
        #     topic_parts = topic.split('/')
        #     zone = topic_parts[2]
        #     output_needs[cls.table_name][cls.zone_damperpos_name + cls.sep + zone] = OutputDescriptor('float', '')
        #
        # for topic in topics[cls.zone_airflow_name]:
        #     topic_parts = topic.split('/')
        #     zone = topic_parts[2]
        #     output_needs[cls.table_name][cls.zone_airflow_name + cls.sep + zone] = OutputDescriptor('float', '')

        result.update(output_needs)
        return result
    def output_format(cls, input_object):
        #Called when app is staged
        topics = input_object.get_topics()
        oats = topics['oat']

        output_needs =  {'Time_Table':
                            {'time':OutputDescriptor('string', 'site/building/analysis/date'),
                             'load':OutputDescriptor('float', 'site/building/analysis/load')}}
        for count, oat in enumerate(oats):
            name = "oat" + str(count)
            output_needs['Time_Table'][name] = OutputDescriptor('float', 'site/building/analysis/{}'.format(name))

        return output_needs
Beispiel #10
0
    def output_format(cls, input_object):
        # Called when app is staged
        """
        Output is the sorted load to be graphed later.
        """
        #TODO: find an easier way of formatting the topics
        topics = input_object.get_topics()
        load_topic = topics['load'][0]
        load_topic_parts = load_topic.split('/')
        output_topic_base = load_topic_parts[:-1]
        load_topic = '/'.join(output_topic_base + ['loadduration', 'load'])

        output_needs = {
            'Load_Duration': {
                'sorted load': OutputDescriptor('float', load_topic),
                'percent time': OutputDescriptor('float', load_topic)
            }
        }
        return output_needs
    def output_format(cls, input_object):
        # Called when app is staged
        """
        Output is hour with respective load, to be put in a line graph later.
        """
        topics = input_object.get_topics()
        load_topic = topics['load'][0]
        load_topic_parts = load_topic.split('/')
        output_topic_base = load_topic_parts[:-1]
        time_topic = '/'.join(output_topic_base + ['timeseries', 'time'])
        load_topic = '/'.join(output_topic_base + ['timeseries', 'load'])

        # Work with topics["OAT"][0] to get building topic
        output_needs = {
            'Load_Profiling': {
                'timestamp': OutputDescriptor('string', time_topic),
                'load': OutputDescriptor('float', load_topic)
            }
        }
        return output_needs
    def output_format(cls, input_object):
        """
        Called when application is staged.
        Output will have the date-time and  error-message.
        """
        result = super().output_format(input_object)
        topics = input_object.get_topics()
        topic = topics[cls.zonetemperature_name][0]
        topic_parts = topic.split('/')
        output_topic_base = topic_parts[:-1]

        type_topic = '/'.join(output_topic_base +
                              ['CyclingDetector', cls.type])
        ts_topic = '/'.join(output_topic_base +
                            ['CyclingDetector', cls.timestamp])
        fanstatus_topic = '/'.join(output_topic_base +
                                   ['CyclingDetector', cls.fanstatus_name])
        zonetemp_topic = '/'.join(
            output_topic_base + ['CyclingDetector', cls.zonetemperature_name])
        zonetempsetpoint_topic = '/'.join(
            output_topic_base +
            ['CyclingDetector', cls.zonetemperature_stpt_name])
        cycling_topic = '/'.join(output_topic_base +
                                 ['CyclingDetector', 'cycling'])
        penalty_topic = '/'.join(output_topic_base +
                                 ['CyclingDetector', 'penalty'])

        output_needs = {
            'CyclingDetector': {
                'type':
                OutputDescriptor('string', type_topic),
                'datetime':
                OutputDescriptor('string', ts_topic),
                'FanStatus':
                OutputDescriptor('integer', fanstatus_topic),
                'ComprStatus':
                OutputDescriptor('integer', fanstatus_topic),
                'ZoneTemperature':
                OutputDescriptor('float', zonetemp_topic),
                'ZoneTemperatureSetPoint':
                OutputDescriptor('float', zonetempsetpoint_topic),
                'cycling':
                OutputDescriptor('integer', cycling_topic),
                'penalty':
                OutputDescriptor('integer', penalty_topic)
            }
        }

        # return output_needs
        result.update(output_needs)
        return result
Beispiel #13
0
 def output_format(cls, input_object):
     # Called when app is staged
     """
     Output will have the date, hour, and respective load.
     To be graphed in a heat map later.
     """
     topics = input_object.get_topics()
     load_topic = topics['load'][0]
     load_topic_parts = load_topic.split('/')
     output_topic_base = load_topic_parts[:-1]
     date_topic = '/'.join(output_topic_base + ['heatmap', 'date'])
     hour_topic = '/'.join(output_topic_base + ['heatmap', 'time'])
     load_topic = '/'.join(output_topic_base + ['heatmap', 'load'])
     output_needs = {
         'Heat_Map': {
             'date': OutputDescriptor('string', date_topic),
             'hour': OutputDescriptor('integer', hour_topic),
             'load': OutputDescriptor('float', load_topic)
         }
     }
     return output_needs
Beispiel #14
0
    def output_format(cls, input_object):
        # Called when app is staged
        """
        Output is the year with its respective load and natural gas amounts
        aggregated over the year.
        """
        topics = input_object.get_topics()
        print(topics)
        load_topic = topics['load'][0]
        load_topic_parts = load_topic.split('/')
        output_topic_base = load_topic_parts[:-1]
        metric_name_topic = '/'.join(output_topic_base +
                                     ['crossection', 'metric_name'])
        value_topic = '/'.join(output_topic_base + ['crossection', 'value'])

        output_needs = {
            'CrossSectional_BM': {
                'Metric Name': OutputDescriptor('string', metric_name_topic),
                'Value': OutputDescriptor('string', value_topic)
            }
        }
        return output_needs
    def output_format(cls, input_object):
        # Called when app is staged
        """
        Output:
            measuredValues: values directly measured from the building
        """
        topics = input_object.get_topics()
        base_topic = topics['lightingstatus'][0]
        topic_parts = base_topic.split('/')
        output_topic_base = topic_parts[:-1]

        stat_analysis_topic = '/'.join(output_topic_base +
                                       ['sensorsuitcaseLight', 'analysis'])
        stat_problem_topic = '/'.join(output_topic_base +
                                      ['sensorsuitcaseLight', 'problem'])
        stat_diagnostic_topic = '/'.join(output_topic_base +
                                         ['sensorsuitcaseLight', 'diagnostic'])
        stat_recommendation_topic = '/'.join(
            output_topic_base + ['sensorsuitcaseLight', 'recommendation'])
        stat_savings_topic = '/'.join(output_topic_base +
                                      ['sensorsuitcaseLight', 'savings'])

        output_needs = {
            'SensorSuitcaseLight': {
                'analysis':
                OutputDescriptor('string', stat_analysis_topic),
                'problem':
                OutputDescriptor('string', stat_problem_topic),
                'diagnostic':
                OutputDescriptor('string', stat_diagnostic_topic),
                'recommendation':
                OutputDescriptor('string', stat_recommendation_topic),
                'savings':
                OutputDescriptor('string', stat_savings_topic)
            }
        }
        return output_needs
Beispiel #16
0
    def output_format(cls, input_object):
        # Called when app is staged
        """
        Output:
            stat_message: HVAC recommendation based on the model.
        """
        topics = input_object.get_topics()
        base_topic = topics['zat'][0]
        topic_parts = base_topic.split('/')
        output_topic_base = topic_parts[:-1]

        stat_analysis_topic = '/'.join(output_topic_base +
                                       ['sensorsuitcaseHVAC', 'analysis'])
        stat_problem_topic = '/'.join(output_topic_base +
                                      ['sensorsuitcaseHVAC', 'problem'])
        stat_diagnostic_topic = '/'.join(output_topic_base +
                                         ['sensorsuitcaseHVAC', 'diagnostic'])
        stat_recommendation_topic = '/'.join(
            output_topic_base + ['sensorsuitcaseHVAC', 'recommendation'])
        stat_savings_topic = '/'.join(output_topic_base +
                                      ['sensorsuitcaseHVAC', 'savings'])

        output_needs = {
            'SensorSuitcaseHVAC': {
                'analysis':
                OutputDescriptor('string', stat_analysis_topic),
                'problem':
                OutputDescriptor('string', stat_problem_topic),
                'diagnostic':
                OutputDescriptor('string', stat_diagnostic_topic),
                'recommendation':
                OutputDescriptor('string', stat_recommendation_topic),
                'savings':
                OutputDescriptor('string', stat_savings_topic)
            }
        }
        return output_needs
    def output_format(cls, input_object):
        '''Called when application is staged.

        Output will have the date-time and  error-message.
        '''
        result = super().output_format(input_object)
        topics = input_object.get_topics()
        topic = topics[cls.zone_temp_name][0]
        topic_parts = topic.split('/')
        output_topic_base = topic_parts[:-1]
        ts_topic = '/'.join(output_topic_base + ['ScheduleDetector', cls.timestamp])
        zonetemp_topic = '/'.join(output_topic_base + ['ScheduleDetector', cls.zone_temp_name])
        status_topic = '/'.join(output_topic_base + ['ScheduleDetector', cls.status_name])

        output_needs = {
            'ScheduleDetector': {
                'datetime': OutputDescriptor('string', ts_topic),
                'ZoneTemperature': OutputDescriptor('float', zonetemp_topic),
                'schedule': OutputDescriptor('integer', status_topic)
            }
        }
        # return output_needs
        result.update(output_needs)
        return result
Beispiel #18
0
    def output_format(cls, input_object):
        '''Called when application is staged.

        Output will have the date-time and  error-message.
        '''
        result = super().output_format(input_object)
        topics = input_object.get_topics()
        topic = topics[cls.oa_temp_name][0]
        topic_parts = topic.split('/')
        output_topic_base = topic_parts[:-1]
        ts_topic = '/'.join(output_topic_base + ['ahuEcam', cls.timestamp])
        oat_topic = '/'.join(output_topic_base + ['ahuEcam', cls.oa_temp_name])
        mat_topic = '/'.join(output_topic_base + ['ahuEcam', cls.ma_temp_name])
        rat_topic = '/'.join(output_topic_base + ['ahuEcam', cls.ra_temp_name])
        od_topic = '/'.join(output_topic_base +
                            ['ahuEcam', cls.outdoor_damper_name])
        occ_topic = '/'.join(output_topic_base + ['ahuEcam', cls.occ_name])
        discharge_sp_topic = '/'.join(output_topic_base +
                                      ['ahuEcam', cls.discharge_sp_name])
        sp_setpoint_topic = '/'.join(output_topic_base +
                                     ['ahuEcam', cls.sp_setpoint_name])
        dat_topic = '/'.join(output_topic_base + ['ahuEcam', cls.da_temp_name])
        datstpt_topic = '/'.join(output_topic_base +
                                 ['ahuEcam', cls.da_temp_setpoint_name])
        fsp_topic = '/'.join(output_topic_base +
                             ['ahuEcam', cls.fan_speedcmd_name])
        fst_topic = '/'.join(output_topic_base +
                             ['ahuEcam', cls.fan_status_name])
        return_fanspeed_topic = '/'.join(
            output_topic_base + ['ahuEcam', cls.returnfan_speedcmd_name])
        ccv_topic = '/'.join(output_topic_base +
                             ['ahuEcam', cls.cc_valve_name])
        hcv_topic = '/'.join(output_topic_base +
                             ['ahuEcam', cls.hc_valve_name])
        oaf_topic = '/'.join(output_topic_base + ['ahuEcam', cls.oaf_name])

        output_needs = {
            'AhuEcam': {
                'datetime':
                OutputDescriptor('string', ts_topic),
                'OutdoorAirTemperature':
                OutputDescriptor('float', oat_topic),
                'MixedAirTemperature':
                OutputDescriptor('float', mat_topic),
                'ReturnAirTemperature':
                OutputDescriptor('float', rat_topic),
                'DischargeAirTemperature':
                OutputDescriptor('float', dat_topic),
                'DischargeAirTemperatureSetPoint':
                OutputDescriptor('float', datstpt_topic),
                'SupplyFanStatus':
                OutputDescriptor('float', fst_topic),
                'SupplyFanSpeed':
                OutputDescriptor('float', fsp_topic),
                'OutdoorDamper':
                OutputDescriptor('float', od_topic),
                'CCV':
                OutputDescriptor('float', ccv_topic),
                'HCV':
                OutputDescriptor('float', hcv_topic),
                'OutdoorAirFraction':
                OutputDescriptor('float', oaf_topic),
                'ReturnFanSpeed':
                OutputDescriptor('float', return_fanspeed_topic),
                'OccupancyMode':
                OutputDescriptor('float', occ_topic),
                'DuctStaticPressure':
                OutputDescriptor('float', discharge_sp_topic),
                'DuctStaticPressureSetPoint':
                OutputDescriptor('float', sp_setpoint_topic),
            }
        }

        #return output_needs
        result.update(output_needs)
        return result