thomassorensen2650 / node-red-contrib-mqtt-sparkplug-plus

A node that makes it simple to implement MQTT Sparkplug in Node-Red
21 stars 6 forks source link

timestamp with DDATA message #1

Closed BasSwildens closed 2 years ago

BasSwildens commented 2 years ago

Hi Thomas,

Really nice job on this Sparkplug node with node-red! Maybe it would be possible to edit the example message with this structure to add a timestamp to the individual metric.

{
    "metrics": [
        {
            "timestamp": 1630575884246,
            "name": "groep1/snelheid",
            "value": 11
        },
        {
            "timestamp": 1630575884256,
            "name": "groep1/positie",
            "value": 12
        }
    ]
}
thomassorensen2650 commented 2 years ago

Hi

Thank you for the kind words.

Good point, I'll update the documentation with information about all the optional parameters. I can also see that I need to do some epoch time conversion when timestamp are provided in a Date Object format - I'll include that in the next release.

I have already made a bunch of other small fixes, and there are still a few more things I want to fix before I release a new version, but hopefully I'll have time doing the weekend.

Thanks for the feedback!

thomassorensen2650 commented 2 years ago

If you still need support for custom timestamp on message level, then let me know. I'll close this ticket for now.