Send a variable to device

Hello ,
I need to send a setpoint to the device using MQTT message action. I believe I should first save the setpoint to a variable and then send the variable to the device using a JSON payload.
The explanation on how to include a variable on the payload is not clear . Can someone help me on this ?

Hi Adam,
Bellow the Action Payload you have a helping text with how to write a payload.

If you desire to send a JSON payload, you just want to write it in a JSON format. Example:
{ "variable": "$VARIABLE$, "value": "$VALUE$" }

image

Vitor,

Thanks for the response. Good to know we have such active community on the platform .

I have seen this help example, but still not clear for me. For example, I have the variable door (values 0 or 1) stored on the bucket associated to this device that is updated by a button on dasboard .

I want to send the door value (0 or 1) to the device .

What should I do to send the content of the variable door on the payload ?

I have tested to send VARIABLE on payload and it sends “undefined”

I´m probably missing something . Thanks in advance

Hi Adam,
It would be better if you can send us some screenshots on how you configured your action, that way I can se if you did something wrong or not.

I’m sending you my action setup so you can give a look. It sends a message to the topic test containing variable,value. In this case it showed up on my device as test,71

Hello,

Below the action. Its a SCHEDULE ACTION, not a VARIABLE TRIGGER action .Maybe this is the problem . The response I have is undefined, undefined

sorry below the action screenshot

and this is the bucket

Hey,
Just found the problem: I changed the action to a Variable Trigger action , instead of Schedule trigger, an it does send the variable that is being used as trigger. It seems that VARIABLE VALUE does not work on schedukled actions. But what if I need to send a variable that is not the one that is triggering the action ? Or if I need to send a variable using the scheduled action?

This one works and send the variable name (door) and value (HIGH) ;