Need help identifying what i did wrong in my function node

Yeah probably will not as i did not tick that i do not think - it should just show up under the Debug Node

Sorry just looked at it - i was only testing for > and < not equal to !! So it was exactly 15 and did not know what to do with it - change the inject to 16 and you will get an idea

Craig

ok the light switch turned on !
so i get it the check ambient branch node doesn't make sense to me still.
however , I think I understand it way better now but i have a question about the context msg.
So the slider will show a specific selection.
when i redo the selection will it update and resend stats?
here is sample flow with inject node. and it works great as far as my logic in my head .

[{"id":"ca0e7b4a5b294d74","type":"inject","z":"e37c63f592e2a10e","name":"pretend target","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"45","payloadType":"num","x":365.56597900390625,"y":404.9279648803711,"wires":[["452d891f03cd6d8d"]]},{"id":"452d891f03cd6d8d","type":"change","z":"e37c63f592e2a10e","name":"","rules":[{"t":"set","p":"target","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":543.5590362548828,"y":402.7995300292969,"wires":[[]]},{"id":"2791e8fd11a5bbed","type":"inject","z":"e37c63f592e2a10e","name":"MypretendAmbientlow","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"44","payloadType":"num","x":394.5625,"y":444.9314785003662,"wires":[["b6a32ed795ba9d54"]]},{"id":"b4fa82e87175ca9f","type":"inject","z":"e37c63f592e2a10e","name":"pretend high","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"75","payloadType":"num","x":368.5590629577637,"y":483.92800998687744,"wires":[["b6a32ed795ba9d54"]]},{"id":"b6a32ed795ba9d54","type":"change","z":"e37c63f592e2a10e","name":"","rules":[{"t":"set","p":"ambient","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":616.5624771118164,"y":460.80127143859863,"wires":[["28be93b860aadb04"]]},{"id":"28be93b860aadb04","type":"switch","z":"e37c63f592e2a10e","name":"","property":"target","propertyType":"flow","rules":[{"t":"gte","v":"ambient","vt":"flow"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":763.5624923706055,"y":484.81165409088135,"wires":[["bc2ff7accdc39023","3f673c2fc0145e5e"],["68e860736312735d","4ffeba8d7ff4186e"]]},{"id":"bc2ff7accdc39023","type":"change","z":"e37c63f592e2a10e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"OFF","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1156.559097290039,"y":385.79779624938965,"wires":[["c274ed1eb9efbc59"]]},{"id":"68e860736312735d","type":"change","z":"e37c63f592e2a10e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"ON","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1146.5591011047363,"y":579.7994709014893,"wires":[["3ed7abdc880619b1"]]},{"id":"3f673c2fc0145e5e","type":"debug","z":"e37c63f592e2a10e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":904.5590896606445,"y":385.9193229675293,"wires":[]},{"id":"4ffeba8d7ff4186e","type":"debug","z":"e37c63f592e2a10e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":898.5590934753418,"y":582.9227714538574,"wires":[]},{"id":"c274ed1eb9efbc59","type":"debug","z":"e37c63f592e2a10e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1358.5660552978516,"y":387.9193239212036,"wires":[]},{"id":"3ed7abdc880619b1","type":"debug","z":"e37c63f592e2a10e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1377.5608444213867,"y":579.9262409210205,"wires":[]}]

I was totally making it more difficult before.

This really sank in.
If you only knew how much I searched this last month to find the best options for cooling.
Right now reflecting on this, its ridiculously easy.
I added it to my real data and its working great,
thanks.

I don't want to takeaway from Craig's help, but I think I can help too.

I'm looking at your post you did 1 hour ago and working from it.

So the target is the value to which you want to compare the incoming value - yes?

(If that is true, you may want to look at this effort.)

[{"id":"ca0e7b4a5b294d74","type":"inject","z":"0918ee609bf69fc7","name":"pretend target","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"45","payloadType":"num","x":2080,"y":1270,"wires":[["452d891f03cd6d8d"]]},{"id":"452d891f03cd6d8d","type":"change","z":"0918ee609bf69fc7","name":"","rules":[{"t":"set","p":"target","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2360,"y":1270,"wires":[[]]},{"id":"2791e8fd11a5bbed","type":"inject","z":"0918ee609bf69fc7","name":"MypretendAmbientlow","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"44","payloadType":"num","x":2108.9965209960938,"y":1320.0035136199951,"wires":[["28be93b860aadb04"]]},{"id":"b4fa82e87175ca9f","type":"inject","z":"0918ee609bf69fc7","name":"pretend high","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"75","payloadType":"num","x":2082.9930839538574,"y":1359.0000451065064,"wires":[["28be93b860aadb04"]]},{"id":"28be93b860aadb04","type":"switch","z":"0918ee609bf69fc7","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"ambient","vt":"flow"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":2330,"y":1340,"wires":[["bc2ff7accdc39023","3f673c2fc0145e5e"],["68e860736312735d","4ffeba8d7ff4186e"]]},{"id":"bc2ff7accdc39023","type":"change","z":"0918ee609bf69fc7","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"OFF","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2580,"y":1310,"wires":[["c274ed1eb9efbc59"]]},{"id":"68e860736312735d","type":"change","z":"0918ee609bf69fc7","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"ON","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2580,"y":1370,"wires":[["3ed7abdc880619b1"]]},{"id":"3f673c2fc0145e5e","type":"debug","z":"0918ee609bf69fc7","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2570,"y":1270,"wires":[]},{"id":"4ffeba8d7ff4186e","type":"debug","z":"0918ee609bf69fc7","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2570,"y":1410,"wires":[]},{"id":"c274ed1eb9efbc59","type":"debug","z":"0918ee609bf69fc7","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2790,"y":1310,"wires":[]},{"id":"3ed7abdc880619b1","type":"debug","z":"0918ee609bf69fc7","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2790,"y":1370,"wires":[]}]

@Trying_to_learn
The "target" is the desired temp of my vessel.
When using a sliding bar or a drop down menu to select the desired "target" it wouldn't keep sending the payload for "target"
so setting it up as a context helped keep that message alive or stored.
right above your post is finished working flow in dashboard.
Here is my flow working and cleaned up.
ill be going in and renaming my "target" and some other pieces making more clear as to what I have done and simply copying the flow and quick change for the other fermenters. this one is actually live and keeping beer in a fermenter at 38 degrees F

[{"id":"f6858fe416b029b9","type":"tab","label":"West Fermenter","disabled":false,"info":"","env":[]},{"id":"a1935b0f08af8408","type":"ui_switch","z":"f6858fe416b029b9","name":"Wferm","label":"Wferm","tooltip":"","group":"10c36bea9197e264","order":4,"width":5,"height":1,"passthru":false,"decouple":"true","topic":"cmnd/Wferm/POWER","style":"","onvalue":"ON","onvalueType":"str","onicon":"","oncolor":"","offvalue":"OFF","offvalueType":"str","officon":"","offcolor":"","x":400.6666679382324,"y":322.2500858306885,"wires":[["4349ab2a681252f2","dcb2c21aa32eec71"]]},{"id":"4349ab2a681252f2","type":"mqtt out","z":"f6858fe416b029b9","name":"","topic":"","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"31a99116.50a74e","x":565.2381553649902,"y":374.0000877380371,"wires":[]},{"id":"ce5c66f008f4cbf3","type":"mqtt in","z":"f6858fe416b029b9","name":"","topic":"stat/Wferm/POWER","qos":"1","datatype":"auto","broker":"31a99116.50a74e","nl":false,"rap":false,"inputs":0,"x":211.23807525634766,"y":279.0000858306885,"wires":[["a1935b0f08af8408","5a422122ed052f7d"]]},{"id":"dcb2c21aa32eec71","type":"debug","z":"f6858fe416b029b9","name":"out","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":562.2381935119629,"y":325.00004482269287,"wires":[]},{"id":"5a422122ed052f7d","type":"debug","z":"f6858fe416b029b9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":424.80228424072266,"y":279.9245195388794,"wires":[]},{"id":"987d16ece3fa2e58","type":"ui_digital_display","z":"f6858fe416b029b9","name":"","group":"10c36bea9197e264","order":2,"width":5,"height":1,"digits":5,"decimals":1,"x":682.5644073486328,"y":106.93490600585938,"wires":[]},{"id":"c978949d90d42b1e","type":"mqtt in","z":"f6858fe416b029b9","name":"","topic":"tele/Wferm/SENSOR","qos":"2","datatype":"auto","broker":"31a99116.50a74e","nl":false,"rap":true,"rh":0,"inputs":0,"x":126.56424713134766,"y":27.83073902130127,"wires":[["4c4294bd3b2d8cf3","a1bfb15585d7eb59"]]},{"id":"93a3046bdaeff2c8","type":"debug","z":"f6858fe416b029b9","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":686.5643920898438,"y":219.92105102539062,"wires":[]},{"id":"65f9fd5be1a51434","type":"change","z":"f6858fe416b029b9","name":"set payload to Temperature value","rules":[{"t":"move","p":"payload.Temperature","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":454.00897216796875,"y":195.00180339813232,"wires":[["987d16ece3fa2e58","93a3046bdaeff2c8","b347d6e4a4c09c90","d6958a16fb27f9d2"]]},{"id":"4c4294bd3b2d8cf3","type":"debug","z":"f6858fe416b029b9","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":383.56078720092773,"y":30,"wires":[]},{"id":"a1bfb15585d7eb59","type":"json","z":"f6858fe416b029b9","name":"","property":"payload","action":"","pretty":false,"x":137.00869178771973,"y":134.33507919311523,"wires":[["27d0a195ec58a6a1"]]},{"id":"bb44589f1917700d","type":"switch","z":"f6858fe416b029b9","name":"If =442FBOIL","property":"payload.Id","propertyType":"msg","rules":[{"t":"cont","v":"3C01F096FCA3","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":339.11983489990234,"y":103.00185203552246,"wires":[["65f9fd5be1a51434"],[]]},{"id":"27d0a195ec58a6a1","type":"split","z":"f6858fe416b029b9","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":150.11634826660156,"y":192.97664165496826,"wires":[["bb44589f1917700d"]]},{"id":"9bd6b8480e7b4725","type":"ui_slider","z":"f6858fe416b029b9","name":"Target","label":"Target Temp","tooltip":"","group":"10c36bea9197e264","order":10,"width":0,"height":0,"passthru":true,"outs":"end","topic":"target","min":0,"max":"200","step":1,"x":1150.0086555480957,"y":20,"wires":[["df13c59e58745e77","c4e2cbc7eb73c7e6"]]},{"id":"df13c59e58745e77","type":"debug","z":"f6858fe416b029b9","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1305.335781097412,"y":20,"wires":[]},{"id":"c4e2cbc7eb73c7e6","type":"change","z":"f6858fe416b029b9","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"target","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1267.9103775024414,"y":71.4497184753418,"wires":[["aaafdd9f9a8b598e","8cc9931debd26135"]]},{"id":"aaafdd9f9a8b598e","type":"debug","z":"f6858fe416b029b9","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1455.2969055175781,"y":53.09364318847656,"wires":[]},{"id":"8cc9931debd26135","type":"change","z":"f6858fe416b029b9","name":"","rules":[{"t":"set","p":"target","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1450.9261474609375,"y":92.62238121032715,"wires":[[]]},{"id":"06ea2d4d1d36cae0","type":"switch","z":"f6858fe416b029b9","name":"","property":"target","propertyType":"flow","rules":[{"t":"gte","v":"ambient","vt":"flow"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":974.9296836853027,"y":182.63451766967773,"wires":[["f59a64501d3e4995","b757ad2e9a21172d"],["dca9643d538d9c10","efbd0245b8dd1ad5"]]},{"id":"f59a64501d3e4995","type":"change","z":"f6858fe416b029b9","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1152.926368713379,"y":183.62065601348877,"wires":[["8e8ffc3b58648b48","be56299a7516053c"]]},{"id":"dca9643d538d9c10","type":"change","z":"f6858fe416b029b9","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1153.926368713379,"y":220.6223258972168,"wires":[["e4614f962524aec5","be56299a7516053c"]]},{"id":"b757ad2e9a21172d","type":"debug","z":"f6858fe416b029b9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1130.926254272461,"y":148.74212837219238,"wires":[]},{"id":"efbd0245b8dd1ad5","type":"debug","z":"f6858fe416b029b9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1121.92626953125,"y":252.74561882019043,"wires":[]},{"id":"8e8ffc3b58648b48","type":"debug","z":"f6858fe416b029b9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1321.9333801269531,"y":152.74212837219238,"wires":[]},{"id":"e4614f962524aec5","type":"debug","z":"f6858fe416b029b9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1323.9279975891113,"y":256.74909019470215,"wires":[]},{"id":"02ce3d1fc02a6740","type":"ui_dropdown","z":"f6858fe416b029b9","name":"","label":"","tooltip":"","place":"Select option","group":"10c36bea9197e264","order":7,"width":0,"height":0,"passthru":true,"multiple":false,"options":[{"label":"Lager","value":"55","type":"str"},{"label":"Ale","value":"68","type":"str"},{"label":"Dyacetal Rest","value":"70","type":"str"},{"label":"Cold crash","value":"38","type":"str"}],"payload":"","topic":"target_temperature","x":1007.0086975097656,"y":20,"wires":[["9bd6b8480e7b4725"]]},{"id":"b347d6e4a4c09c90","type":"change","z":"f6858fe416b029b9","name":"","rules":[{"t":"set","p":"ambient","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":793.4491386413574,"y":181.65693759918213,"wires":[["06ea2d4d1d36cae0"]]},{"id":"be56299a7516053c","type":"change","z":"f6858fe416b029b9","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"cmnd/Wferm/POWER","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1333.0086555480957,"y":199.00171947479248,"wires":[["0cf85aaa0a7b0507"]]},{"id":"0cf85aaa0a7b0507","type":"mqtt out","z":"f6858fe416b029b9","name":"","topic":"","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"31a99116.50a74e","x":1481.0086784362793,"y":199.0017604827881,"wires":[]},{"id":"d6958a16fb27f9d2","type":"ui_template","z":"f6858fe416b029b9","group":"10c36bea9197e264","name":"West Fermenter","order":11,"width":6,"height":6,"format":"<div id=\"{{'gauge_'+$id}}\" class=\"g-container\" style=\"--gauge-value:0; --container-size:6; --gn-distance:14; --ga-tick-count:10; --ga-subtick-count:100; --g-unit:''\">\n    <div id=\"bgr\" class=\"g-body\">\n        <div class=\"g-ring\">\n            <div class=\"g-rivets\">\n                <div class=g-rivet></div>\n                <div class=g-rivet></div>\n                <div class=g-rivet></div>\n                <div class=g-rivet></div>\n            </div>\n            <div class=\"g-plate\">\n                <div class=\"g-ticks\">\n                    <div class=\"g-tick\" style=\"--ga-tick:1;\"></div>\n                    <div class=\"g-tick\" style=\"--ga-tick:3;\"></div>\n                    <div class=\"g-tick\" style=\"--ga-tick:5;\"></div>\n                    <div class=\"g-tick\" style=\"--ga-tick:7;\"></div>\n                    <div class=\"g-tick\" style=\"--ga-tick:9;\"></div>\n                    <div class=\"g-tick\" style=\"--ga-tick:11;\"></div>\n                </div>\n                <div class=\"g-ticks\">\n                    <div class=\"g-subtick\" style=\"--ga-tick:11;\"></div>\n                    <div class=\"g-subtick\" style=\"--ga-tick:31;\"></div>\n                    <div class=\"g-subtick\" style=\"--ga-tick:51;\"></div>\n                    <div class=\"g-subtick\" style=\"--ga-tick:71;\"></div>\n                    <div class=\"g-subtick\" style=\"--ga-tick:91;\"></div>\n                </div>\n               <div class=\"g-nums\">\n                    <div class=\"g-num\" style=\"--ga-tick:1;\" >0</div>\n                    <div class=\"g-num\" style=\"--ga-tick:3;\">20</div>\n                    <div class=\"g-num\" style=\"--ga-tick:5;\">40</div>\n                    <div class=\"g-num\" style=\"--ga-tick:7;\">60</div>\n                    <div class=\"g-num\" style=\"--ga-tick:9;\">80</div>\n                    <div class=\"g-num\" style=\"--ga-tick:11;\">100</div>\n                </div>\n                <div class=\"g-label\">West Fermenter</div>\n                <div class=\"g-needle\"></div>\n                <div class=\"g-needle-ring\"></div>\n                <div id=\"{{'gauge_val_'+$id}}\" class=\"g-val\"></div>\n            </div>\n        </div>\n    </div>\n</div>\n<script>\n(function(scope) {\n    let min = 0;\n    let max = 100;\n  scope.$watch('msg', function(msg) {\n    if (msg) {\n      // Do something when msg arrives\n        const v = Math.floor(((msg.payload - min) / (max - min)) * 100);\n        document.getElementById('gauge_'+scope.$id).style.setProperty('--gauge-value', v);\n        document.getElementById('gauge_val_'+scope.$id).innerText = v+\"Ā°F\";\n    }\n   \n  });\n})(scope);\n</script>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":732.0086898803711,"y":145.00177574157715,"wires":[[]]},{"id":"10c36bea9197e264","type":"ui_group","name":"WestFermenter2new","tab":"a74ffe3d.4eb73","order":12,"disp":true,"width":"12","collapse":false},{"id":"31a99116.50a74e","type":"mqtt-broker","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"a74ffe3d.4eb73","type":"ui_tab","name":"Brewery","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

No worries. Glad you got it sorted out.

"Context" can be a bit tricky to get your head around.
But it is also handy to know about.

The only trick with what I did was optimise how it compares the values.
In the switch node you don't have to do what you were doing.
Sorry, it would be easier if you looked at the flow.

But again: Glad you worked it out.

My control box has inside.

  1. one outlet receptacle
  2. an Esp8266 with Tasmota flashed on it.
  3. a coil relay
  4. 110v going in for receptacle
    5 a line going out from relay to a solenoid valve that opens or closes allowing the glycol to flow through the fermenter jacket.
    if you all want to see the insides I can take a picture.
    after implementing this to all 3 fermenters. and possibly my glycol tank.
    I'll be adding heating control to brewing kettles, My next task is to get pressure transducers going again so I can control the psi in fermenters while carbonating. and also in brewhouse to calculate volume in tanks there. (i had volume working once before but need to pan out the temp sensors)

I actually did look at flow. you had the logic reversed in the switch node.
and you didnt set the "ambient " temp as a context just the "target".
I actually understood the settings (shocking)
I also looked MQTT viewer to verify everything is doing what it needs to do.
all I need to do now is add a visual light in my control box for fermenter so i can clearly see that the valve is open or closed. I can see on phone but that doesn't mean that something didn't go wrong at the shop.

I just took what you pasted.

Maybe the comparison in the switch was back to front.

But the important thing to notice is that rather than setting flow.value and comparing the flow.value and flow.target is complicating it.

You can compare the msg.payload to a flow.(something) in the node.
That saves you the change nodes you had before that node also.

lol let me stand corrected the logic was correct. however


the out 1 (>= to flow.target ) is how that should have been worded in your case.
then the on and off was correct.
your way eliminated one change node saving space in the way bigger picture.
I actually understood it very well.
Initially when I started this whole project, I would get discouraged. search forums. reading other threads, seeing how people would step up and say you didnt post the code correctly and be harsh and then they would correct it and people would help. but not the person that corrected them on how to post the code.
so far with my request for help its been great and I keep learning and getting more excited of the bigger picture.
heck today a couple of guys had a little hummer with my laziness, I appreciate that a lot. haha.
and instead of giving me a nudge in the right direction , they pushed me away from overkill!

Craig is a pretty smart cookie.

I guess you also have to accept that there are a lot of ways to do things.

The best way you do it is to do it the way you understand. If you don't you can get confused in the future when things stop working. (Been there many times myself)

I usually go for making things too complicated for my own good too. But that is who I am.
But after a lot of iterations I get things down to a good working level.

I guess that once you get the basic structure working correctly, you may need to then introduce redundancy measures to deal with any errors that may occur throughout your flow.

For example if a temperature sensor throws out a 'out of range reading' or an error message instead of a number, or stops working, etc, etc.
Or if the heating falls out of acceptable parameters...

I try to build these into my flows, to either resolve the issue itself, or to send a high priority 'push message' to my phone.

I definitely agree.
I guess the other thought is the context.
the Ambient temp change node can be removed as in your example. It actually might be smart to do so, because the esp8266 is sending that info every 15 or 30 seconds ( cant remember what I set it up as)
that's a lot of changes happening in a short period of time. where the target temp is usually set and left alone for a week or so.
the fact that I was trying to use a function node and trying to learn the coding, and I just needed to use a switch node is actually humorous.

You aren't the first and won't be the last.

The thing is you have to accept this and to not beat yourself up about making the mistakes.
They are annoying - I know that - but sometimes they are the only way to learn.

I lost a lot of time the other day with something like what you were doing and I forgot to store a value in context and so for about 3 days I was getting NaN out of the node.

Then suddenly - even after asking for help here - it just crystalised and I knew what it was I was doing wrong.

been pretty good so far not beating myself up.
I have gotten really good at walking away, Hmm I wonder if having 3 daughters oldest being 30 and youngest being 20 had anything to do with that lol.
on the contrary though. each new thing I learn for this project just keeps creating new doors of options.
The hardest part is staying focused on one piece of the puzzle at a time. One thing that I have done is keep a weekly log. but when like today , I ran the taproom, cleaned a fermenter. troubleshooted my coding. and saw 3 doctors in the am. I still managed to solve a piece of the puzzle , with the help of people that take the time to help others. Pretty awesome place this is!
And yes when your asking for help in a forum and you help yourself. I call that Thinking Out Forum, (kind of like thinking out loud) really just putting things on paper is about as powerful as a slap in the face.

Oh hey, I THREW my self at Node-Red feet first knowing SFA about javascript.
(Or basically any language)

And all this because I once found a discarded flatscreen tv.

Who would have guessed that? :wink:

Yes , and I started it because a keg washing machine is like 12k to 20 k, and I wanted to see if I could make one. lol 1500 bucks later and I'm stuck in a good looking rabbit hole.
3 am ish here im off to bed.

@9toejack I think what you have failed to give any information on is what kind of beer you are brewing!

Near me there's a brewery with wooden casks that the wort froths up out of into a metal trough and mingles with other casks. (Marston's Pedigree). I expect there's some instrumentation somewhere out of sight.

Then over the road is a giant stainless steel reactor vessel where they produce strange foreign liquids (Coors).

I'll drink either sort but I rather like the steampunk aspect of the traditional ale.

well sounds like your in golden co, @jbudd
I will be at the GABF , and you must be referencing Cannonball brewery or Mt. Toad which is right across the street from the Coors brewery.
I am Rail hop'n Brewing co (look me up)
My number one selling beer is Rusty Dick's IPA, I make light to dark hoppy to mild, and spicy beers,
If you go to Mt. toad they have the beeriodic table on the wall, place is cool, and I think cannonball had a beer called trump hands. lol.
cheers.

The other thing you need to do - read up some more on Context - you will probably want to make it persistent - so you will need to change your settings.js file so things you put into context are written to disk

You might also want a routine that runs at startup that resets various parameters - or sets some form of baseline

Nothing worse than an unexpected restart (or even an expected restart) and finding you have ruined a batch because your context temperature was not set etc

You might also want to look at getting one of the instant messaging setups going before you go much further - something like telegram is probably the most flexible (but not the easiest) so you can give yourself instant alerts for critical/problem situations.

Craig

1 Like