SOLVED:More Dashboard control needed

I have a SONOFF TH10 controlling a bread dough proofing box.

While it works perfectly and keeps the temp +/- 1 F, I lack the skills to incorporate, on the dashboard, the ability to alter the desired set temperature.

Right now, using a laptop, I connect to my RPi server, open Node-Red and manually alter in FLOW 2 the "Eval Temp hi lo" Function node.
if (msg.payload < 78)
msg.payload = "ON" ;

if (msg.payload > 78)
msg.payload = "OFF";
return msg;

Setting the two hi/lo temperature values, in this Function Node, to the same number, works perfectly but I would like to do it through my phone instead of the constant writes to my SD card in my RPi server. I am open to any method IE: Up/Down arrow, scroll, drop down...

Hopefully my simple Flow is attached below. Try not to laugh.

Flow2 with bare bones.txt (4.7 KB)

add a numeric widget to the dashboard.
connect the output to a change node - use it to set global.mytemp (or some other name) to msg.payload

then in your function compare msg.payload to global.get(mytemp).


Thank you dceejay for taking the time and the quick reply.

I'll see if my old limited brain can do this. Seems straight forward.

Thanks again

I need just a little more help.
I now have the Dashboard control on my phone and can move it +/- 1 degree but obviously did not configure the Change Node properly.

My Function node is as follows:
if (msg.payload < global.get(mytemp))
msg.payload = "ON" ;

if (msg.payload > global.get(mytemp))
msg.payload = "OFF";
return msg

This should be Flow 2:
TempControl2.txt (621 Bytes)

Not getting any errors but don't seem to be actually setting global(mytemp) via the Change node. The SONOFF just stays on no matter how high the temp gets.

The debug msg from the change node is as follows when I use the dashboard to set it to 72 degrees<a class="attachment"
mytemp : msg : Object

{ payload: 72, topic: "mytemp", socketid: "pfZGj0-6imOyP-gJAAE-", _msgid: "8fdae2c4.8433e" }

href="//">TempControl3.txt (6.4 KB)

SOLVED: Got the Change Node set correctly. All is good.
Thanks for your help.

1 Like