Local timestamps for sensor values?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
pm_cz
Normal user
Posts: 10
Joined: 16 Mar 2016, 10:56

Local timestamps for sensor values?

#1 Post by pm_cz » 21 Jul 2016, 19:48

Hello,
I run into an issue where I would like to provide local timestamps of the measurement time (just the POSIX timestamp - 32 bit long value) together with measured values (mainly for generic MQTT) and I wonder which way would be the best? I can implement it and create a push request if neccessary. I know of mqtt restamping tools, e.g. mqtt-timestamper, but they would provide server-side timestamps.

The possibilities I have thought of for now:
  1. Provide a plugin with timestamp value (actually just calling now()) if time feature is enabled. Otherwise we could have either -1 like for VCC?
    1. This can be done by modifying the system info (026) plugin, which is the way I have originally done it. But to provide correct values, the plugin must return long values instead of floats, which may either break the formula calculations (division by float number) or the formulas would have to be disabled for this plugin and somebody may be using them. All other values returned from this plugin (RSSI, uptime, VCC, RAM) are integers anyway right now).
    2. Write a separate plugin (really small code, but would take 1 plugin ID)
  2. Add a timestamp to the MQTT message (but we may not set a template for value part if I am right)? Possibly as a checkbox in Advanced configuration. But there are several implementations of MQTT protocol right now and none is really the "generic one".
Any idea which way would be the best?

Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests