I would use a Change node in place of the Function node. In the Change node, you can set msg.topic as a simple string. Then for msg.payload, you can use the "J: expression" type, and set it to:
"Temperature: " & msg.payload.value
One other note: When your inject node triggers a Device node, that doesn't actually trigger the device in question to update/refresh. It is simply asking NR for the latest value stored in its cache. If you want to trigger an actual update of the temperature probe, you'd need to trigger a Command node, assuming that your device supports a command such as "Refresh" or "Update."
You could also use 2 Template Nodes; one to set the msg.topic and one to set msg.payload. I do that for some notifications. I know it's 2 nodes but I try to avoid Function Nodes when ever I can.
Guys, I recently had a couple of crashes of my Pi set up. So damned annoying. Thankfully I had my flows backed up. But after I reinstalled them, I found that the nodes I'd previously installed also had to be reinstalled. No big deal, it didn't take long. But is there a quick way to backup the nodes I've installed too? Sorry if the answer is already above. Too lazy to read through everything again for this specific subject.
You can use the projects feature and add the used nodes as dependencies for the project on the backup. Now when restoring I am unsure if it auto downloads as I have never needed to restore but I would guess it does.
I use the project feature for this, too. Starting w/node-reed 1.2 you can have it auto update github too after every change (before github update was a manual process).
I'm trying to add a Hue light to my dashboard to have the switch show the state of the input.
I have done this with other lights by adding a change node before the switch changing from msg.payload to msg.payload.value,
However i'm stuck on how to do this with Hue. As 'on' is either true or false.
Ive tried a whole bunch of values but cant get it right. It just wont update the switch
This is the output from hue light node into debug