Hi all,
I am trying to figure out where the eventTime timestamp is added in a subscription to a devices capabilities.
In my API Access project the capabilities for voltageMeasurement, powerMeter and energyMeter are subscribed to for an electricity meter.
There is some delay on average 5 seconds between the eventTime between readings of voltageMeasurement and powerMeter for the same meter.
I wouldn’t expect the delay from the meter to the hub to be 5 seconds so is the eventTime added at:
- In the Z-Wave message sent to the hub. (There is a time sent with Z-Wave messages but it is a time elapsed between readings not a timestamp see Delta time under section 4.56.6 Meter Report Command in Z-Wave spec)
- The hub adds the
eventTimewhen the Z-Wave message reaches the hub. - The SmartThings cloud adds the
eventTimewhen the HTTP message reaches the SmartThings cloud from the Hub. - The
eventTimeis only added when the HTTP POST message with meter data is sent to my third part application.
Below shows an example body of a HTTP POST message sent to my API that is integrated with SmartThings through a API Access Project. The eventTime I am talking about is also shown, in this case it is the time a power reading was recorded associated with a subscription called PowerMeter2.
{
"messageType":"EVENT",
"eventData":{
"installedApp":{
"installedAppId":"****************",
"locationId":"********************"
},
"events":[
{
"eventTime":"2021-04-16T11:10:25Z",
"eventType":"DEVICE_EVENT",
"deviceEvent":{
"eventId":"581ea2e3-9ea4-11eb-99f2-f70f649cc567",
"locationId":"*****************",
"ownerId":"********************",
"ownerType":"LOCATION",
"deviceId":"221eca3e-8d7b-4de5-a6fa-c3063bdae33b",
"componentId":"main",
"capability":"powerMeter",
"attribute":"power",
"value":333.6,
"valueType":"string",
"stateChange":true,
"data":{
},
"subscriptionName":"PowerMeter2"
}
}
]
}
}