particle-iot / node-red-contrib-particle-official

Official Node-RED Particle nodes
MIT License
12 stars 7 forks source link

Unable to pass a msg.payload as a parameter to a Particle Function #2

Closed Toby-Mills closed 3 years ago

Toby-Mills commented 3 years ago

I might be misunderstanding the Particle Function node, but it appears that the Argument property only supports a configured text string, rather than a value passed in as part of the message. Is it possible to rather use something like 'msg.payload'?

image

maxst001 commented 3 years ago

Have you yet figured it out how that works? I'm also not able to send e.g. a string value to a particle device via msg.payload.

Toby-Mills commented 3 years ago

Have you yet figured it out how that works? I'm also not able to send e.g. a string value to a particle device via msg.payload.

Nope unfortunately not. I'm going to try just using a straight http request to the particle API, instead of using this library, which is a pity, because it seems to work pretty well otherwise.

maxst001 commented 3 years ago

Hi Toby, actually I figured it out yesterday: you just need to set a msg.argument property to the value you want to pass to the function :-) Regards, Max

Toby-Mills commented 3 years ago

That works like a charm! Thanks for your help Max!

maxst001 commented 3 years ago

Great! You're welcome!