Simple device incoming data transformations

#1

I have temp in C coming in from an OEM device that I sell services for. We’re US-based and need to graph temp in F on our dashboards.

How do we do this?

Thanks!

Payload result path after math
#2

The easiest way to do this is by adding another attribute to your device for Fahrenheit and then using a workflow to convert the incoming data and store it in this new attribute. This way you always have both Celsius and Fahrenheit available.

The high-level workflow would be the following:

  1. A Device: State trigger that triggers whenever your device reports state data.
  2. A Conditional Node that is checking that Celsius is what was reported. Since this workflow results in new state being reported, it will cause this workflow to trigger again. This check is used to skip the triggers for your already converted Fahrenheit state. The expression would be something like {{ data.celsius }} !== undefined, which is checking that celsius was part of the state that was reported.
  3. A Math Node to do the conversion. The expression would look something like {{ data.celsius }} * (9/5) + 32. You can then store the result back on the payload at data.fahrenheit.
  4. Lastly, add a Device State Node to store the new Fahrenheit attribute on your device.
#3

Thanks Brandon,

Roger that.

Best,

George Wayne | President and Chairman | Qualia Networks, Inc.

Phone: (805) 455-8036

Email: George.Wayne@QualiaNetworks.com | http://www.QualiaNetworks.com

CONFIDENTIAL & PRIVILEGED: Both this e-mail and any attachments included with this transmission are intended solely for the use and handling of the individual or entity named above. They may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering this message to the intended recipient, any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by telephone or e-mail and return the original message to us at the above e-mail address or via U.S. Mail, and delete and destroy any other copies of the message and attachments. Thank You.