Devices reporting 1970-01-01T00:00:00Z to my Smart App

Hi there,

From several different devices I have seen that the my SmartApp is ingesting the eventTime as epoch start time 1970-01-01T00:00:00Z. I have examined the raw string event body that is set from the Samsung Cloud to my SmartApp so as to verify my software is not at fault.

Has anyone else observed this?

I’ve experienced this with multiple devices: an Aeotec Aeon HEM Gen5, Aeotec Multisensor 6 and a NorthQ Zwave Gas Monitor. I have been experimenting with my own device handlers, which I thought might be the cause, however when I moved the Aeotec HEM and the NorthQ to other accounts they do not have the same problem. The MultiSensor 6 is using the Samsung Supplied DTH.

Regards
Gary

Hi, there! Can you give more details about this, please? You can share an extract of your SmartApp or the payload you mentioned.

Hi Nayelyz,

I’ve prettyfied the raw string body that is received by my application when an EVENT is posted. I’ve only edited it to remove the authToken, as you see in the event array, the eventTime has come in as epoch time.

{
	"lifecycle": "EVENT",
	"executionId": "78f66103-9a5d-47fd-9e28-e01b1d829268",
	"appId": "0a92b599-c115-4e2f-a054-751cb832eeb5",
	"locale": "en-US",
	"version": "0.1.0",
	"eventData": {
		"authToken": "<omitted>",
		"installedApp": {
			"installedAppId": "049efe7d-957b-462d-ab0b-0c194de72116",
			"locationId": "1c714c4b-78b2-4fa8-b1f3-3e1d51c9e59c",
			"config": {
				"GAS_METER_SENSOR": [
					{
						"valueType": "DEVICE",
						"deviceConfig": {
							"deviceId": "14819e9a-76b9-4fd2-81bc-f4ab6bedf7db",
							"componentId": "main"
						}
					}
				],
				"ELECTRICITY_METER_SENSOR": [
					{
						"valueType": "DEVICE",
						"deviceConfig": {
							"deviceId": "57a8e06e-d727-4bd3-a8b3-9d2b8ae9d101",
							"componentId": "main"
						}
					}
				],
				"homeId": [
					{
						"valueType": "STRING",
						"stringConfig": {
							"value": "9999999"
						}
					}
				]
			},
			"permissions": [
				"x:devices:14819e9a-76b9-4fd2-81bc-f4ab6bedf7db",
				"r:locations:*",
				"x:devices:*",
				"r:devices:14819e9a-76b9-4fd2-81bc-f4ab6bedf7db",
				"x:devices:57a8e06e-d727-4bd3-a8b3-9d2b8ae9d101",
				"r:devices:*",
				"w:devices:*",
				"w:devices:14819e9a-76b9-4fd2-81bc-f4ab6bedf7db",
				"i:deviceprofiles:*",
				"w:devices:57a8e06e-d727-4bd3-a8b3-9d2b8ae9d101",
				"r:devices:57a8e06e-d727-4bd3-a8b3-9d2b8ae9d101"
			]
		},
		"events": [
			{
				"eventTime": "1970-01-01T00:00:00Z",
				"eventType": "DEVICE_EVENT",
				"deviceEvent": {
					"eventId": "60dc7aef-7790-11eb-a0bc-ad962ae6f373",
					"locationId": "1c714c4b-78b2-4fa8-b1f3-3e1d51c9e59c",
					"ownerId": "1c714c4b-78b2-4fa8-b1f3-3e1d51c9e59c",
					"ownerType": "LOCATION",
					"deviceId": "57a8e06e-d727-4bd3-a8b3-9d2b8ae9d101",
					"componentId": "main",
					"capability": "energyMeter",
					"attribute": "energy",
					"value": 0.038,
					"valueType": "string",
					"stateChange": true,
					"data": {},
					"subscriptionName": "a2e4669f-41cf-4df8-9f0a-7fd0fea154bd"
				}
			}
		]
	},
	"settings": {}
}

There was an episode of something similar a while back, but it seemed to be affecting everything.

Given ST seems to be a lot more picky about the correct format of capabilities, I am a little surprised that your energyMeter ‘valuetype’ is set to ‘string’. Not particularly suggesting that is related to your issue but I recall that the event history in particular no longer accepts incorrect entries so I don’t want to dismiss it either.

Yes I can understand that the valueType is a little confusing, as you say though I don’t think this is the issue, when linked to a separate account under the same conditions, the eventTime reports as expected even with this valueType being string.

One other thing I notice though is that, this seems to occur when the Execution Location as per the Classic IDE My Devices screen is local.

In the device handlers I have used, one of them states that executeCommandsLocally: true that I believed is the flag for execution location, and can be found here: SmartThingsPublic/devicetypes/smartthings/aeon-multisensor-6.src at master · SmartThingsCommunity/SmartThingsPublic · GitHub

The other one explicitly states executeCommandsLocally: false yet still displays as Execution Location local in the Classic IDE My Devices screen.

Could that have anything to do with it? It’s the only correllation I can find.

I shall have to defer to anyone who has the faintest idea. There is a runLocally as well as an executeCommandsLocally and the community used to ignore them as if you used them in custom DTHs they couldn’t be saved. And then they could, and from then on they have been a source of mystery and imagination and frankly a complete pain in the backside.

That said, it seems reasonable to assume that the ST bods know what they are for and how to use them properly.

Events are just weird these days. I still want to know where the battery events are hiding.

Hi, thanks for the info. I got the same on a subscription to a multi-sensor. Other devices report the time correctly. Let me verify this with our engineering team and I’ll let you know their feedback.

Hi, @gary-newbolt. It has been verified that this is an issue and our engineering team has started working on it to find the root cause.
I’ll keep track of the progress, thank you for bringing this up.