If I wanted to route the values of two Sparrow sensors on the same gateway (i.e. common device id) to different fields in ThingSpeak, could I do something like this?:
(
$result := {
“api_key”: $TSkey,
“field1”: file = “20373358323650030028001b#air.qo” ? body.temperature,
“field2”: file = “20373358323650030028001b#air.qo” ? body.humidity,
“field3”: file = “20373358323650030028001b#air.qo” ? body.pressure,
“field4”: file = “20373358323650030028001b#air.qo” ? body.voltage
“field5”: file = “2037335832365003003f0048#air.qo” ? body.temperature,
“field6”: file = “2037335832365003003f0048#air.qo” ? body.humidity,
“field7”: file = “2037335832365003003f0048#air.qo” ? body.pressure,
“field8”: file = “2037335832365003003f0048#air.qo” ? body.voltage
};
)
This doesn’t actually work, but can it be tweaked to make it work? “TSkey” in this route is set as an environmental variable at the device level.