This flow is for the IoT Device
[{"id":"a644dc6c.6e28e8","type":"tab","label":"Deployed IoT Device-CW2","disabled":false,"info":""},{"id":"a0661c70.92bfb","type":"inject","z":"a644dc6c.6e28e8","name":"Send Data","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"2","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":180,"wires":[["47bbeeb6.eedb2"]]},{"id":"47bbeeb6.eedb2","type":"function","z":"a644dc6c.6e28e8","name":"Device Payload","func":"// Array of simulated temperatures\nvar temp1 = [15, 17, 18.5, 20, 21.5, 23, 24, 22.2, 19, 1];\n\n// Array of simulated relative humidities\nvar humidity1 = [50, 55, 61, 68, 65, 60, 80, 70, 62, 53];\n\nvar counter1 = context.get('counter1') || 0;\ncounter1 = counter1 + 1;\nif (counter1 > 9)\n counter1 = 0;\ncontext.set('counter1', counter1);\n\nmsg = {\n payload:\n {\n d: {\n \"temperature\": temp1[counter1],\n \"humidity\": humidity1[counter1]\n }\n }\n};\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":340,"y":200,"wires":[["2a91433b.5baad4","faefdbdb.6f702","bda63538.44b718"]]},{"id":"faefdbdb.6f702","type":"wiotp out","z":"a644dc6c.6e28e8","authType":"d","qs":"false","qsDeviceId":"","deviceKey":"f7785387.86a37","deviceType":"","deviceId":"","event":"event","format":"json","qos":"","name":"","x":570,"y":240,"wires":[]},{"id":"2a91433b.5baad4","type":"debug","z":"a644dc6c.6e28e8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":550,"y":160,"wires":[]},{"id":"bda63538.44b718","type":"mqtt out","z":"a644dc6c.6e28e8","name":"","topic":"temp/hum","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"b885666a.157e","x":340,"y":300,"wires":[]},{"id":"f7785387.86a37","type":"wiotp-credentials","name":"","org":"8e25qe","serverName":"","devType":"CW2","devId":"CW2Dev1","keepalive":"60","cleansession":true,"tls":"","usetls":false},{"id":"b885666a.157e","type":"mqtt-broker","name":"","broker":"broker.hivemq.com","port":"1883","clientid":"","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"Topic/temperature","birthQos":"1","birthPayload":"msg.payload","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]
This flow is for the IBM Cloud Application
[{"id":"31eedb0e.d43ad4","type":"tab","label":"IBM Cloud Application-CW2","disabled":false,"info":""},{"id":"59122774.65345","type":"ibmiot in","z":"31eedb0e.d43ad4","authentication":"apiKey","apiKey":"29c89d9a.a85ada","inputType":"evt","logicalInterface":"","ruleId":"","deviceId":"","applicationId":"","deviceType":"+","eventType":"+","commandType":"","format":"json","name":"IBM IoT","service":"registered","allDevices":"","allApplications":"","allDeviceTypes":true,"allLogicalInterfaces":"","allEvents":true,"allCommands":"","allFormats":"","qos":0,"x":110,"y":100,"wires":[["f58d5388.a416e8","b18be1d4.7cf7b8","c23ac597.0c4f6"]]},{"id":"f58d5388.a416e8","type":"change","z":"31eedb0e.d43ad4","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.d.humidity","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"humidity","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":260,"wires":[["e83cb213.5bd988"]]},{"id":"b18be1d4.7cf7b8","type":"change","z":"31eedb0e.d43ad4","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.d.temperature","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"temperature","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":160,"wires":[["e83cb213.5bd988"]]},{"id":"e83cb213.5bd988","type":"ui_chart","z":"31eedb0e.d43ad4","name":"","group":"a6977aad.77827","order":0,"width":0,"height":0,"label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#ff0000","#ff7f0e","#2ca02c","#98df8a","#ff0000","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":630,"y":200,"wires":[[]]},{"id":"c23ac597.0c4f6","type":"debug","z":"31eedb0e.d43ad4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":350,"y":60,"wires":[]},{"id":"29c89d9a.a85ada","type":"ibmiot","name":"API-1","keepalive":"60","serverName":"","cleansession":true,"appId":"","shared":false},{"id":"a6977aad.77827","type":"ui_group","name":"Temp-Humidity Readings","tab":"c9544103.6cb6c8","order":5,"disp":true,"width":"6","collapse":false},{"id":"c9544103.6cb6c8","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]
Which of the flows should i add the switch node and the change node to answer the questions so as to enable me configure the message when the temperature is above 23 degrees and where do i add the message, is it on the change node or switch node. If you can possibly add the node and the message and then post the code so i can copy back and implement it. Thanks