I have a radio thermostat CT80. Its curl commands work in Fahrenheit but I want to input Celsius via a chat bot to set the temp.
Anyone know the process for doing this?
I think the input will need a template node to convert C to F....
Then the converted F result will be sent to the curl command.
Hi, have you actually tried it yet? Conversions from c to f, and f to c for that matter, follow simple formulas. You can use just about any node you like for that, from a function node to a change node (payload.temp_celsius * 1.8 + 32 as JSONata expression for example). You said you use curl for communication, so that means you can use the exec node with a curl command, or the http request node if you use an http protocol within curl.
I've used a node flow from someone else for the ct80.
All I need to do is inject the F in numerical value into a node.
So whatever does the conversion needs to output a number ie: 72
Will have a play later!
Thank you
I may have (wrongly) assumed Working with Messages was known information. What you are inserting as payload appears to be a numeric 19 value. In that case the contents of msg.payload in the function node becomes simply 19 and the description changes to msg.payload = msg.payload * 1.8 + 32;
The modern way to convert C to F or F to C is to use a range node.
C to F
-40 100
-40 212
F to C
-40 212
-40 100
[{"id":"b39e3a0a.9b8048","type":"range","z":"205d0e6a.aaefc2","minin":"-40","maxin":"100","minout":"-40","maxout":"212","action":"scale","round":false,"property":"payload","name":"C to F","x":730,"y":1100,"wires":[["6ea851ef.91e08"]]}]