After reviewing this Node-red flow:
https://i.stack.imgur.com/y4aDM.png
I am struggling with the implementation in my function.
There are 3 options in each dropdown, one for meat type and the other for doneness. Once I select a combination from the dropdowns, I need the correct temperature to be displayed in the text output.
Despite attempting to use an If
statement, I am encountering difficulties making it work properly.
My understanding of JavaScript is quite basic, so any guidance or assistance would be greatly appreciated.
Thank you
EDIT:
Upon further inspection of the code within the If
statement in my function node, there was a mistake in the conditional expression. I managed to resolve this issue by changing the If
from:
if(msg.payload = "")
to
if(msg.payload == "")
This adjustment corrected the error and produced the desired outcome.
var payload = msg.payload
if(msg.payload == "KalvRoed"){
msg.temperature = "53-57 degrees"}