So, I am getting a temperature data from the MQTT broker and I want to publish a message which will overwrite a data that is on an OPC server, which looks like this;
"[{"id":"Visu+ UA Server.Visu+ SCADA.Tags.Start_Button","v":false}]"
When I use the inject node that is connected to the MQTT out node, it works and changes the data. But I only want it to work automatically when the other (temperature) data coming from the MQTT broker is less than "50". I used the switch node for this and I am able to get output when the comparison happens. My problem is, how do I use this "switch" node to inject a message into MQTT out node. I'm also copying the flow code here. Thanks in advance.
[{"id":"97527151.57977","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"c8c0178d.388638","type":"mqtt in","z":"97527151.57977","name":"","topic":"iotgateway","qos":"1","datatype":"json","broker":"42bbbb0d.1b4ff4","nl":false,"rap":true,"rh":0,"x":460,"y":480,"wires":[["ca4e64d.53f1198"]]},{"id":"bcdd863a.a8cb18","type":"mqtt out","z":"97527151.57977","name":"","topic":"iotgateway/write","qos":"1","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"42bbbb0d.1b4ff4","x":940,"y":200,"wires":[]},{"id":"b7ac1935.42ee18","type":"inject","z":"97527151.57977","name":"Start_Value=False","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Message","payload":"[{\"id\":\"Visu+ UA Server.Visu+ SCADA.Tags.Start_Button\",\"v\":false}]","payloadType":"str","x":490,"y":200,"wires":[["bcdd863a.a8cb18"]]},{"id":"ca4e64d.53f1198","type":"switch","z":"97527151.57977","name":"","property":"payload.values[0].v","propertyType":"msg","rules":[{"t":"lt","v":"50","vt":"str"},{"t":"gte","v":"50","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":480,"wires":[["d7bba128.d4f7a"],["7db978c6.f2df18"]]},{"id":"7db978c6.f2df18","type":"debug","z":"97527151.57977","name":">=50","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.values[0].v","targetType":"msg","statusVal":"","statusType":"auto","x":870,"y":560,"wires":[]},{"id":"d7bba128.d4f7a","type":"debug","z":"97527151.57977","name":">50","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.values[0].v","targetType":"msg","statusVal":"","statusType":"auto","x":870,"y":400,"wires":[]},{"id":"42bbbb0d.1b4ff4","type":"mqtt-broker","name":"","broker":"tcp://localhost","port":"1883","clientid":"","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]