Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timestamp in payload #76

Open
sdalu opened this issue Jun 9, 2022 · 2 comments
Open

Timestamp in payload #76

sdalu opened this issue Jun 9, 2022 · 2 comments

Comments

@sdalu
Copy link

sdalu commented Jun 9, 2022

Returned data in the payload doesn't contains the timestamp of the measurement, which information by looking at the raw data (of the status node) seems to be available.

It would be useful to have it available in standard node, so data can be collected and stored in a database with the timestamp of the measurement instead of the timestamp of the database insertion time.

I guess new payload would looks like:

{
  "topic": "update",
  "payload": {
    "deviceId": "85272aa2-78db-4e80-8585-849469710190",
    "deviceType": "contact",
    "name": "Door watcher",
    "timestamp": "2022-06-08T22:42:02.606Z",
    "value": 0
  },
  "_msgid": "e6809b7c800f5a87"
}
@sdalu
Copy link
Author

sdalu commented Jun 9, 2022

@otaviojr I see that you have started to add some timestamp. But it seems you are generating it using new Date().toISOString().
As a timestamp appear in the status node (as for example: status.components.main.contactSensor.contact.timestamp) I thought it was provided by the smartthing callback. That's the one provided by smartthing that would be useful. If none are provided by smartthings, I'm sorry to have open this issue.

@otaviojr
Copy link
Owner

otaviojr commented Jun 9, 2022

Yep, for now, my problem is that only the status appears to have the timestamp. The event Smartthings send to us via webhook doesn't. I will get a better look into it.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants