How to write a variable from flow

It is possible to write a variable value directly from a flow or dashboard, without entering the value in the "write panel" node. Here is a solution using standard nodes: A slider is used to set the value (but can be done by any node) then the “template” node formats the payload and the change node sets the topic.

Details :

stm32CubeMonitor slider.png

The template node: stm32CubeMonitor write msg.png

stm32CubeMonitor EditTemplateNode.png

The variable address and variable type must be filled here. For the type and address, the easiest way is to try first with a writing panel and a debug node, and see the values. The Payload value from the input will be inserted in the template. (the value to write)


The next node is a “change” node to set the topic to “write” stm32CubeMonitor SetTopic.png


stm32CubeMonitor EditChangeNode.png



The result :

stm32CubeMonitor SliderChart.png

When the slider is moved, the new value is written to g_constDouble