Virtual Temp Sensor

I would like to add a virtual temp sensor to read temp from my weatherlink live device. I have the weatherlink app installed and can see all the attributes. How do I take one attribute (inside temp) and make it a device so I can then use it conjunction with my other temp sensors (motion devices)?

Should be able to reference the attribute directly from RM or webCoRE for calculations... or even an attribute tile if you just want to display it.

First, I should note that I'm not familiar with this driver, so if there's a "native" way to do this (does it have the option to create a "child device" just for this or some other way to do it?), I don't know about that.

But in general, what you want is possible with Rule Machine. I assume you want a device with a standard temperaure attribute when you're all done; if not, you probably don't really need this. If so ... you'll need to first create a virtual temperature sensor device (or really whatever you want to use to hold this value). Then:

  1. Create a new rule
  2. Create a local variable of type Decimal in this rule; call it whatever you want (you could also use a global variable if you want, though there's no need), for example, indoorTemp.
  3. Add a trigger event for this rule. Use a "Custom Attribute" type for this trigger, choose your device, and choose the inside temperature attribute. For the trigger comparison, choose "*changed*". Hit "Done with Trigger Events" when finished.
  4. Click/tap into "Actions to run" for this rule, and add two actions as described below.
  5. First, set the indoorTemp (or whatever you called it) variable to the value of the indoor temperature attribute on your Weatherlink device. This is under Set Mode or Variables, Run Custom Action > Set Variable. One of the things you can set the variable to is "Device Attribute," which is what you'll need to use here.
  6. Create a second action, this one calling the custom setTemperature() command on your virtual sensor (or however you need to get the value into your device). This is under Set Mode or Variables, Run Custom Action > Run Custom Action. It will ask you to choose a capability for your device; "Temperature" or "Sensor" would be good choices here, but as long as whatever you choose lets you pick the device in the next step, it won't matter (it's basically just to filter this list). Then choose your device, choose the setTemperature command, and create one parameter of type "decimal" with %indoorTemp% (or whatever you called this variable, surrounded by % signs) as the value.

The variable is necessary because you cannot directly reference the attribute value of a device in most actions, so it is just a temporary way to hold this value in a way that can be used in this manner. Some custom apps may be able to work with this attribute directly, but again I assume you want the above to work with "standard" apps that look for the standard temperature attribute. (But, as mentioned, if you just want to display it somewhere, an "Attribute" dashboard tile will get you there with a lot less work!)

@bertabcd1234 Thank you!! This was a bit difficult to wrap my head around, but I was able to get it into RM on the first try.