MeasureInstrument - ptidejteam/tools4cities-metamenth GitHub Wiki

MeasureInstrument models different meters and weather stations with various sensors that measure distinct phenomena. MetamEnTh establishes relationships between meters and diverse entities, encompassing buildings, floors, rooms, open spaces, and HVAC components. This relationship between meters and other entities enables the measurement of phenomena such as power and energy consumption associated with these entities. Weather stations are essential to measure the outdoor environment conditions surrounding buildings.

Classes and Their Relationships

All classes (entities) have auto-generated IDs (UID) to uniquely identify objects created from them.

WeatherStation

This class defines weather stations that measure the outdoor environment condition of buildings.

Parent Class

None

Relationships

  • Building has a one-to-many relationship with WeatherStation.
  • WeatherStation also has a one-to-many relationship with WeatherData.

Attributes

  • name: string, the unique name of the weather station
  • location: string, what3word location of the weather station
  • weather_data: List[WeatherData], a list of weather data recorded for the weather station.

Behaviours (Methods)

  • add_weather_data(List[WeatherData]): adds weather data recordings to the weather station
  • get_weather_data(search_terms: Dict) -> [WeatherData]: search for weather data based on attributes and their values
  • get_weather_data_by_date(from_timestamp: str, to_timestamp: str = None) -> [WeatherData]: fetches weather data between (inclusive) from_timestamp to to_timestamp. If to_timestamp is not provided, it searches weather data from from_timestamp to the last data point available.

Meter

Meter defines the various meters in different locations and entities of a Building.

Parent Class

AbstractReader

Relationships

  • Spaces of a floor (AbstractFloorSpace) have a one-to-one relationship with Meter.
  • A Building can have multiple Meter.
  • A Meter also has a one-to-many relationship with MeterMeasure.

Attributes

  • meter_location: string, the what3word location of the meter
  • manufacturer: string, the manufacturer of the meter.
  • measurement_frequency: float, the measurement frequency of the meter.
  • measurement_unit: MeasurementUnit, the measurement unit of the meter data.
  • meter_type: MeterType, the type of the meter.
  • measure_mode: MeterMeasureMode, how data is measured by the meter e.g., manual or automatic
  • data_accumulated: bool (default is False), indicates if meter data is aggregated over a period
  • accumulation_frequency: MeterAccumulationFreqency, indicates the period over which meter data is accumulated. This field is optional if data_accumulated is set to False.
  • meter_measures: List[MeterMeasure], a list of measurements recorded by the meter.

Behaviours (Methods)

  • add_meter_measure(meter_measure: MeterMeasure): adds a measurement for this meter.
  • get_meter_measures(self, search_terms: Dict = None) -> [MeterMeasure]: searches meter data based on attributes and their values.
  • get_meter_measure_by_date(from_timestamp: str, to_timestamp: str = None) ->[MeterMeasure]: fetches meter data between (inclusive) from_timestamp to to_timestamp. If to_timestamp is not provided, it searches meter data from from_timestamp to the last data point available.

MeterMeasure

MeterMeasure defines data recorded by meters in a building.

Parent Class

AbstractDataMeasure

Relationships

  • Meter has a one-to-many relationship with MeterMeasure.

Attributes

Same as AbstractDataMeasure.

Behaviours (Methods)

None

AbstractDataMeasure

This class defines data that various Meter and Sensor record. MeterMeasure and SensorData are AbstractDataMeasure.

Parent Class

None

Relationships

None

Attributes

  • value: float, the numerical value measured by the meter.
  • timestamp: datetime, the timestamp when the measurement was taken.
  • measurement_type: the type of the measurement, e.g., electricity consumption

Behaviours (Methods)

None

WeatherData

WeatherData defines data recorded by WeatherStation.

Parent Class

None

Relationships

  • WeatherStation has a one-to-many relationship with WeatherData.

Attributes

  • data: AbstractMeasure, the binary measure (value and unit) of the weather data.
  • timestamp: datetime, the timestamp when the weather data was recorded.

Behaviours (Methods)

None

TriggerHistory

TriggerHistory defines data recorded when Actuator is triggered.

Parent Class

AbstractDataMeasure

Relationships

  • Actuator has a one-to-many relationship with TriggerHistory.

Attributes

  • trigger_type: TriggerType, the type of trigger.
  • value: float (optional), the value associated with the trigger.
  • timestamp: datetime, the timestamp when the trigger occurred.

Behaviours (Methods)

None

SensorData

SensorData defines data recorded for a Sensor in a built environment.

Parent Class

AbstractDataMeasure

Relationships

  • Sensor has a one-to-many relationship with SensorData.

Attributes

Same as AbstractDataMeasure.

Behaviours (Methods)

None

DamperPosition

DamperPosition defines data recorded for the position of Damper.

Parent Class

AbstractDataMeasure

Relationships

  • Damper has a one-to-many relationship with DamperPosition.

Attributes

Same as AbstractDataMeasure.

Behaviours (Methods)

None