Datasource Functions
Changelog
| Version | Author | Update date | Comment |
|---|---|---|---|
| 1.0.1 | Hao.Ning | 2023/08/10 | First Version |
| 1.0.2 | Hao.Ning /ITsung.Shen | 2024/07/31 | Add ReportGroupInfoDisable InspectionAreaStatsDisable InspectionStationStatsDisable InspectionHistory |
Alarmlog_record
Function name translation
en: ['alarmlog_record'],
zh_cn: ['报警记录'],
zh_tw: ['報警記錄'],
ja: ['レコード']
Description:
Return Realtime / Historical Alarm of specific group and its sub-groups within the selected time range. Notice that this function needs to collaborate with Ene Alarm Panel.
Input:
- GroupPath
- DataType:RT/HIS
- FunctionType:alarmlog_record

Return:
Table format:
- Alarm ID:Alarm ID
- Level:Alarm Level (1-8)
- Category:Alarm Category
- Occurred Time:Alarm start time
- Completed Time:Alarm completed time
- Total Time:Alarm total duration (in second)
- Source:Alarm source Group/Object name
- Tag Name:Alarm parameter name
- Alarm Message
- Additional Message URL:URL specified on Object setting
- Current State:Current alarm state (Closed,Open,Ack'ed,In Process,Locked,Processed)
- Commenter
- Operator
- Action:Change the alarm state on this field
- Current Value:The parameter value that trigger the alarm
- Alarm Occurrence:Parameter's alarm occurrence of this month.


Additional options:
When query for RT alarms, select the 'MarkTimeRange' checkbox

to enable the feature of limiting the alarm time range by using the "Dashboard.TimeRange".

AlarmOccurrence
Function name translation:
en: ['alarmOccurrence'],
zh_cn: ['报警次数'],
zh_tw: ['報警次數'],
ja: ['ア ラーム回数']
Description:
Return the real-time alarm occurrences (regardless of time) or the number of historical alarms (alarms occurred within the Dashboard.TimeRange range) for the selected group or object.
Input:

- GroupPath
- Object
- DataType:RT/HIS
- FunctionType:alarmOccurrence
- TimeRange:(Optional) required for HIS alarm
Return:
Support two format: Table,Timeseries
Timeserie format
- target: “GroupName or ObjectName”
- datapoints:
- alarm occurrence
- datapoints:

Table format:
- Datatime
- Target:Group name or Object name
- Occurrence:alarm occurrence
AlarmOccurrenceMonth
Function name translation:
en: ['alarmOccurrenceMonth'],
zh_cn: ['本月报警次数'],
zh_tw: ['本月報警次數'],
ja: ['今月のアラーム回数']
Description:
Return the number of HIS alarms triggered this month under the selected Group or object (The month is according to the month of selected Dashboard.TimeRange.endtime), with one record returned per day.
Input:

- GroupPath
- Object
- FunctionType:alarmOccurrenceMonth
- TimeRange
Return:
Support two format: Table,Timeseries
TimeSeries:
- Datapoints
- daily alarm occurrence
Table:
- Datatime:
- Target:Group name or Object name
- Occurrence:daily alarm occurrence
AlarmStatusNum
Function name translation:
en: ['alarmStatusNum'],
zh_cn: ['报警状态数量'],
zh_tw: ['報警狀態數量'],
ja: ['アラーム状態数']
Description:
Return the number of real-time alarms in each processing state under the selected group.
Input:

- GroupPath
- FunctionType:alarmStatusNum
Return:
TimeSeries:
- target: “Total”:Total number of RT alarm
- datapoints:
- status:-1
- target: “Open”:Number of alarm in "Open" state
- datapoints:
- status:5
- target: “Ack'ed”:Number of alarm in "Ack'ed" state
- datapoints:
- status:10
- target: “In Process”:Number of alarm in "In Process" state
- datapoints:
- status:15
- target: “Locked”:Number of alarm in "Locked" state
- datapoints:
- status:20
- target: “Processed”:Number of alarm in "Processed" state
- datapoints:
- status:25
GroupAvail
Function name translation:
en: ['groupAvail'],
zh_cn: ['组时间稼动率'],
zh_tw: ['組時間稼動率'],
ja: ['グループ有効性']
Description:
Calculate the "Group Availability" of all the objects under the Group and its sub-group within the specified time range.
Input:

- GroupPath
- Object:any objects that you want to calculate
- ObjectParam:Select a discrete parameter with state defined as
- 0: OFF
- 1: RUN
- 2: Idle
- 3: Down/Alarm
- 4: Schedule Off
- FunctionType:groupAvail
Return:
Table Format,Time duration of five states + Availability
- Off (second)
- Run (second)
- Idle (second)
- Down (second)
- Schedule (second)
- Availability:Group Availability (%), Run/(Run+Idle+Down)*100%
GroupStatusDuration/GroupStatusOccurrence
Function name translation:
en: ['groupStatusDuration'],
zh_cn: ['组状态持续时间'],
zh_tw: ['組狀態持續時間'],
ja: ['グループステータス']
en: ['groupStatusOccurrence'],
zh_cn: ['组状态发生次数'],
zh_tw: ['組狀態發生次數'],
ja: ['グループ状態発生']
Description:
For objects in selected group and its sub-group, calculate the sum of selected discrete parameter’s state duration / occurrence
Input:

- GroupPath
- Object
- ObjectParam:A discrete parameter being calculated
- FunctionType:groupStatusDuration/ groupStatusOccurrence
- TimeInterval:Time interval of historical data
- Datatype:RT(return total within selected time range) /HIS (return result per time Interval)
- StateType:Parameter’s state that you want to calculate
Return:
Timeserie format, return the sum of selected discrete parameter’s state duration / occurrence


ObjectAvail
Function name translation:
en: [objectAvail],
zh_cn: ['对象时间稼动率'],
zh_tw: ['對象時間稼動率'],
ja: ['オブジェクトの可用性']
Description:
Return the Availability of selected objects (with specified parameter)
Input:

- GroupPath
- Object:object to be calculated
- ObjectParam:Select a discrete parameter with state defined as
- 0: OFF
- 1: RUN
- 2: Idle
- 3: Down/Alarm
- 4: Schedule Off
- FunctionType:objAvail
Return:
Table Format,Time duration of five states + Availability
- Off (second)
- Run (second)
- Idle (second)
- Down (second)
- Schedule (second)
- Availability: Object Availability (%), Run/(Run+Idle+Down)*100%
ObjStatusDuration/ObjStatusOccurrence
Function name translation:
en: ['objStatusDuration'],
zh_cn: ['对象状态持续时间'],
zh_tw: ['對象狀態持續時間'],
ja: ['オブジェクトの状態']
en: ['objStatusOccurrence'],
zh_cn: ['对象状态发生次数'],
zh_tw: ['對象狀態發生次數'],
ja: ['オブジェクトの状態']
Description:
Calculate the sum of selected discrete parameter’s state duration / occurrence
Input:

- GroupPath
- Object
- ObjectParam:A discrete parameter being calculated
- FunctionType:objStatusDuration/ objStatusOccurrence
- TimeInterval:Time interval of historical data
- Datatype:RT(return total within selected time range) /HIS (return result per time Interval)
- StateType:Parameter’s state that you want to calculate
Return:
Timeserie format, return the sum of selected discrete parameter’s state duration / occurrence


ObjectsMonitor
Function name translation:
en: ['objectsMonitor'],
zh_cn: ['对象监视器'],
zh_tw: ['對象監視器'],
ja: ['オブジェクトモニタ']
Description:
In org and its sub-orgs, monitor the status of objects that contain these 2 parameters:
- Status (discrete)
- A discrete parameter that indicates the object status, which need to contain the following state:
- 0: OFF
- 1: RUN
- 2: Idle
- 3: Down/Alarm
- 4: Schedule Off
- The data should come from your device or a calculation parameter.
- A discrete parameter that indicates the object status, which need to contain the following state:
- Runtime (analog)
- A counter of running time (in minute), the data should come from your device or a calculation parameter.
Input:

- GroupPath
- ObjectParam
- FunctionType:objectsmonitor
Return:
Table format
- Objectname
- Paramname
- Objruntime:Device Status (Array)
- 0:tagvalue
- 1:SpanHi
- 2:H
- 3:HH
- Almstat:alarm status
- Status:value of the “Status” parameter


Ringratio
Function name translation:
en: ['ringRatio'],
zh_cn: ['环比'],
zh_tw: ['環比'],
ja: ['ループひ']
Description:
Compare the selected parameter value with the previous time interval (currently support day / month)
Use this function with water-statistic-panel
Input:

- GroupPath
- Object
- ObjectParam
- FunctionType:ringratio
Return (use water-statistic-panel):
Timeserie format:
- Datapoints:(Array)
- 0:Today
- 1:Yesterday
- 2:This month
- 3:Last month
- 4:Same day last month
- 5:Same hour yesterday
- Daypercent:(Today-Yesterday) / Yesterday (in %)
- Mongthpercent:(This month-Last month) / Last month (in %)
- Samedaypercent:(This month - Same day last month )/ Same day last month (in %)
- Samehourpercent:(Today- Same hour yesterday) / Same hour yesterday (in %)

Use this function with other panel
When using this function with other panel, you can change “query type” for table or timeseries return format.
Input:
- GroupPath
- Object
- ObjectParam
- TimeInterval:Compare the parameter by day / month (Currently only support these 2 options)
- FunctionType:ringratio
Return:
Timeserie format:
- Target:This (This month or Today)
- Datapoint:[[value,timestamp]]
- Target:Last (Last month or Yesterday)
- Datapoint:[[value,timestamp]]
- Target:Diff (Difference in %)
- Datapoint:[[|this.value – last.value| / this.value ,timestamp]]

Table format:
- Parameter:Parameter Name
- This:This month or Today
- Last:Last month or Yesterday
- Diff:Difference ratio in %
Worldmap
Function name translation:
en: ['worldmap'],
zh_cn: ['世界地图'],
zh_tw: ['世界地圖'],
ja: ['世界地図']
Description:
Display Group Map Card Information of selected org and its sub-orgs which contain the following parameter:
- status (Discrete):
- Group status, which need to contain the following state:
- 0:Normal
- 1:Warning
- 2:Critical
- The data should come from your device or a calculation parameter. Please noted that this function needs to collaborate with EnE WorldMap Card Panel
- Group status, which need to contain the following state:
Input:
- GroupPath
- FunctionType:worldmap

Return:
Table format:
- Hostname:Card title
- Latitude
- Longitude
- Status
- TittleColor:Card title background color
- Width:Card width
- Height:Card height
- GlobalFont:Global Font Css(Object)
- Content:Card Content(Array)
- Subtitle
- SubtitleStyle
- subcontentStyle
- Type:Subcontent type(img,link,string,table)
- Content:
- Desc:description
- Label
- Paramname:Parameter Name
- Unit
- Value

Efficiency Ratio
Function name translation:
en: ['efficiencyRatio'],
zh_cn: ['效率比'],
zh_tw: ['效率比'],
ja: ['効率比']
Description:
Calculate the ratio of A Parameter / B Parameter (Parameter A & B must within same object). You can change DataType for different return result:
- RT (realtime data ratio)
- RTData A / RTData B
- HIS (historical data ratio trend)
- One HIS data ratio per TimeInterval
Input:
- GroupPath
- Object
- ObjectParam * 2, Input manually by this format: {P1,P2} for the result P1/P2
- Datatype:RT /HIS
- FunctionType:efficiencyRatio
- TimeInterval:
- Hour: Calculate A Parameter Hourly data/ B Parameter Hourly data
- Day: Calculate A Parameter Daily data/ B Parameter Daily data
- Month: Calculate A Parameter Monthly data/ B Parameter Monthly data
- Year: Calculate A Parameter Yearly data/ B Parameter Yearly data
Return
Timeserie format,
- RT (realtime data ratio)
- RTData A / RTData B
- HIS (historical data ratio trend)
- One HIS data ratio per TimeInterval
---
YoY
Function name translation:
en: ['YoY'],
zh_cn: ['同比'],
zh_tw: ['同比'],
ja: ['前年同期比']
Description:
Calculate “Year on Year” data of selected parameter. (Currently support day, month, year data)
Input:
- GroupPath
- Object
- ObjectParam: target parameter
- FunctionType:YoY

Return:
Timeserie format:
- Datapoints:(Array)
- 0:Today
- 1:Same day last year
- 2:This Month
- 3:Same month last year
- 4:This Year
- 5:Last Year
- Daypercent:(Today- Same day last year) / Same day last year
- Mongthpercent:(This month - Same month last year) / Same month last year
- Yearpercent:(This year - Last year) / Last year
Diagram:

YoY Trend
Function name translation:
en: ['YoYTrend'],
zh_cn: ['同比趋势'],
zh_tw: ['同比趨勢'],
ja: ['前年同期比の傾向']
Description:
Calculate the “Year on Year” trend of specific parameter (Currently support day, month, year data) with in specific time range.
Input:
- GroupPath
- Object
- ObjectParam
- FunctionType: YoYTrend
- TimeInterval:
- Min: no support, return same data as Day.
- Hour: (This hour - Same hour yesterday) / Same hour yesterday, One data per hour.
- Day: (Today- Same day last year) / Same day last year, One data per day.
- Month: (This month - Same month last year) / Same month last year, One data per month.
- Year: (This year - Last year) / Last year, One data per year.
Return:
Timeserie format
- target: “Current”
- datapoints:
- Trend of current data, one data per TimeInterval (hour/day/month/year)
- datapoints:
- target: “Past”
- datapoints:
- Trend of past data (same hour yester or same TimeInterval last year for Day/Month/Year), one data per TimeInterval (day/month/year).
- datapoints:
- target: “ratio”
- datapoints:
- YoY ratio per TimeInterval (hour/day/month/year)
- datapoints: