我們的品牌

Impact-Company-Logo-English Black-01-177x54

歡迎造訪施耐德電機全球網站

歡迎訪問我們的網站
		
我们今天能为您提供什么帮助?
Video: How to define metadata for custom measurements to be exposed in Web Applications especially in energy-related dashboard gadgets and reports?
Issue
The user's application may require additional custom measurements to represent non-standard data.

Product Line
Power Monitoring Expert 8.x

Environment
Web Application Reports
Web Application Gadgets
SQL Server Management Studio

Cause
Metadata summarizes basic information about data, making finding and working with instances of data easier. Power Monitoring Expert (PME), is installed with a default set of measurements called Standard Measurements.
To expose the custom measurement to energy-related dashboard gadgets, you need to change the
measurement's metadata for the following three measurement characteristics:
  1. Set ACCUMULATION_TYPE to CUMULATIVE (If the custom measurement represents cumulative data).
  2. Set APPLICATION to CONSUMPTION and
  3. Set UTILITY to a value that is not N/A. For example ELECTRICITY, GAS, etc.
To change the custom measurement's metadata, three IDs for each characteristic are needed.
  1. The measurement's MetadataItemId;
  2. The MetadataValueId for the measurement's current metadata; and
  3. The MetadataValueId for the target metadata.
*Warning: Take backups of any files prior to modifying them. Ensure the backups are in a location that will not be overwritten (i.e. the Desktop).​


Resolution
The queries below can be found in the attached zipped file.
Step 1:
Using Query1, identify the Metadata currently assigned to your custom measurement. Replace with the custom measurement's name.

Query1
-- Show assigned metadata
SELECT *
FROM [ApplicationModules].[CommonDataModel].[TopicMetadataView]
WHERE [Description] LIKE '%%'

From the result pane record TopicId and MetadataItemId. (note: A negative TopicId indicates a custom measurement. Measurements supplied by the factory have a positive TopicId number. Measurement TopicId)


Step 2:
Using Query2, identify the current MetadataValueIds. Replace the with the number recorded in Step 1.

Query2
-- Show the Measurement's Metadata in a legible format
SELECT
B.[MetadataItemId]
, C.[DataSourceRepresentation] as MeasurementName
, A.[MetadataValueId]
, E.[Name] as MetadataName
, D.[Value] as MetadataValue
FROM [ApplicationModules].[Metadata].[MetadataItemValue] A
INNER JOIN [ApplicationModules].[Metadata].[MetadataItem] B
ON B.MetadataItemId = A.MetadataItemId
INNER JOIN [ApplicationModules].[DataSourceBus].[DataSourceTopic] C
ON C.TopicId = B.TargetId
INNER JOIN [ApplicationModules].[Metadata].[MetadataValue] D
ON D.MetadataValueId = A.MetadataValueId
INNER JOIN [ApplicationModules].[Metadata].[MetadataName] E
ON E.[MetadataNameId] = D.MetadataNameId
WHERE C.[TopicId] =
ORDER BY D.[MetadataNameId],A.[MetadataValueId]

From the result pane record three MetadataValueIds for CDM.MdName.ACCUMULATION_TYPE, CDM.MdName.APPLICATION, and CDM.MdName.UTILITY.


Step 3:
Using Query3, identify the Target MetadataValueId for ACCUMULATION_TYPE characteristic and find the MetadataValueId for the CUMULATIVE metadata.

Query3
-- Find the MetadataValueId for CUMULATIVE
SELECT a.[MetadataValueId], a.[Value]
FROM [ApplicationModules].[Metadata].[MetadataValue] a
INNER JOIN [ApplicationModules].[Metadata].[MetadataName] b
ON b.MetadataNameId = a.MetadataNameId
WHERE b.[Name] = 'CDM.MdName.ACCUMULATION_TYPE'
AND a.[Value] = 'CDM.MdValue.CUMULATIVE'

From the result pane record the target MetadataValueId for CUMULATIVE.


Step 4:
Using Query4, identify the Target MetadataValueId for APPLICATION characteristic and find the MetadataValueId for the CONSUMPTION metadata.

Query4
-- Find the MetadataValueId for CONSUMPTION
SELECT a.[MetadataValueId], a.[Value]
FROM [ApplicationModules].[Metadata].[MetadataValue] a
INNER JOIN [ApplicationModules].[Metadata].[MetadataName] b
ON b.[MetadataNameId] = a.[MetadataNameId]
WHERE b.[Name] = 'CDM.MdName.APPLICATION'
AND a.[Value] = 'CDM.MdValue.CONSUMPTION'

From the result pane record the target MetadataValueId for CONSUMPTION.


Step 5:
Using Query5, identify the Target MetadataValueId for UTILITY characteristic and find the MetadataValueId for the desired utility that best represents your custom measurement.

Query5
-- Find the MetadataValueId for desired UTILITY
SELECT a.[MetadataValueId], a.[Value]
FROM [ApplicationModules].[Metadata].[MetadataValue] a
INNER JOIN [ApplicationModules].[Metadata].[MetadataName] b
ON b.MetadataNameId = a.MetadataNameId
WHERE b.[Name] = 'CDM.MdName.UTILITY'
AND a.[Value] <> 'CDM.MdValue.N/A'
ORDER BY a.[Value]​

From the result pane record the target MetadataValueId for the desired UTILITY.


Step 6:
With the Measurement, MetadataItemId recorded in step 1, and target MetadataValueIds recorded in Steps 3,4, and 5, run Query6 to update the necessary metadata assignments for each measurement characteristic that will change (ACCUMULATION_TYPE, APPLICATION, and UTILITY).

Query6
-- Update Measurement metadata
UPDATE [ApplicationModules].[Metadata].[MetadataItemValue]
SET MetadataValueId =
WHERE MetadataItemId =
AND MetadataValueId =


Step 7:
Review a summary of the assigned metadata by re-running Query2 in Step 2.
Ensure:
1. CDM.MdName.ACCUMULATION_TYPE is set to CDM.MdValue.CUMULATIVE.
2. CDM.MdName.APPLICATION is set to CDM.MdValue.CONSUMPTION.
3. CDM.MdName.UTILITY is set to a value that is not CDM.MdValue.N/A.


Note: For PME9.0 please refer to PME 9.0 How to Expose Custom Measurements for Use in Web Applications  Application note, as procedure has changed compared to PME8.x version
Link:

https://ecobuilding.schneider-electric.com/search?documentUUID=881bba0d-bcd6-403a-a41d-c38a5fd2ed8d&title=PME 9.0 How to Expose Custom Measurements for Use in Web Applications#tab/documents

The following video shows how metadata is defined for an energy-related custom measurement called CustomLabel1.

施耐德電機Taiwan

附件
SQL Query.zip [2.11 KB]
探索更多
系列:
探索更多
系列:

需要協助?

  • 產品選型工具

    快速輕鬆地為您的應用找到合適的產品和附件。

  • 取得報價

    立即線上提交您的銷售需求,專業團隊將主動聯繫您。

  • 購買地點

    輕鬆在您所在地區找到最近的施耐德電機經銷商。

  • 支援中心

    在同一位置找到滿足您所有需求的支援資源。

  • 產品文檔
  • 軟體下載
  • 產品選型工具
  • 產品替代和替換
  • 幫助和聯絡中心
  • 尋找我們的辦公室
  • 取得報價
  • 人才招募
  • 公司簡介
  • 舉報不當行為
  • 無障礙
  • 新聞中心
  • 投資者
  • 專業洞察
  • 台灣施耐德電機學院
  • 綠色影響力落差調查
  • Schneider Go Green 2025
  • 隱私政策
  • Cookie通告
  • 使用條款
  • Change your cookie settings