Trying to Pass an attribute from PurpleAir device barometer to a Virtual Temperature Sensor


#1

**1) The Capture attribute from a Purple Air Quality device (got it from a Device Handler) won’t pass it’s attribute to my Simulated Tempearture Sensor
(PUT YOUR INFO HERE)

2) What is the expected behaviour? I want to pass the barometric pressure or pressureDisplay to the Simulated Temperature Sensor device in order that I can use it in Webcore and Actiontiles. Since Actiontiles does not have a barometric pressure device capability, if I could pass the data to it, I would be able to do those tasks
(PUT YOUR INFO HERE)

**3) What is happening/not happening?**Nothing happens
(PUT YOUR INFO HERE)

**4)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

It’s possible the two dataPoints are not compatible.

I would use an Expression box with the following (cAseSenSItiVe) code:
[Device:attribute] … or in this case:
[AirQuality:pressureDisplay]
to show you exactly what your device reports.

It may be a decimal, integer, or even a string.

Your next phase afterwards will be ensuring it is in the right format for your SimSensor to understand. (memory suggests integer or decimal, but not sure which without testing)

So, for example, IF your AQ device is reporting “858.78 mb” (a string), and IF the SimSensor is expecting a whole number or decimal, then you will have to write code to convert that pressureDisplay string into an integer/decimal, before passing it along to the SimSensor.


#3

Ok thanks, the pressure must be a text as it reads 29.16 in Hg.
so, any suggestion how to convert the the simulated temperature device to accept text instead of expecting a integer? Or is there some other simulated device that accepts text?


#4

Try this in an Expression box:

decimal(mid("[AirQuality:pressureDisplay]",0,indexOf("[AirQuality:pressureDisplay]"," ")))


#5

You cannot without re-writing the Device Handler. An easier way would be to convert the string “29.16 in Hg” into a decimal “29.16”… and then passing that decimal to the SimSensor.

Although keep in mind that you still have to hope that your SimDevice can handle decimals. (since integers will not be helpful when talking about pressure)


The important part of [AirQuality:pressureDisplay] should always be the first 5 characters, so you could crop off the ending with this Expression:

decimal(left("[AirQuality:pressureDisplay]",5))


#6

Well I have spent a week trying different “simulated” devices anything that is in the Smartthings IDE that looks like a device possibility for barometer and have come up empty. I also found out that Purple Air device no longer is updating barometric pressure. I have found that my "MyNextManager Tstat can reference twc weather conditions pressureAltimeter that reads in webcore pistons as weatherPressure. I can set a variable to the twc weather pressure data when I create variables as dynamic and the result comes out as decimals like 30.02. I still can’t figure out how to and what simulated sensor/device that would allow smartthings to see it as a device, and Actiontiles to see it as a device. If I could get two separate virtual barometer devices as temperature based on simulated virtual temperature devices based on the barometer variable I set up, I have a device handler that takes two temperatures and averages them into decimal format in a third simulated temperature device. I just can’t seem to get the WeatherPressure to populate itself into simulated temperature sensors consistently. When I have been able, it just shows up as an integer, and not as decimal, and most of the time it does not refresh to any changes in the real barometer data from twc. Any help would be deeply appreciated. I’m kind of a newbie here, so explicit info./directions would be very helpful.


#7

Unfortunately, I have not encountered any “built-in” programming that displays a number without also including extra stuff in ActionTiles… (degrees, lux, on/off etc)

There are a few gems over in this thread that basically draw an image, and ActionTiles simply displays the image (with your data written on it).


Note:

imgplaceholder.com used to be my preferred method, but the site is down at the moment.
(working example can be seen here)


Also, if you don’t mind getting your hands dirty, @Robin has a great thread over here for the SmartThings side.


#8

I found an example on the forum where you use the My Next manager for the Nest thermostat and a virtual temperature sensor. The piston sets up a variable that is a string. A command is done to set a variable to be twcweather.conditions.pressureAltimeter Then with the simulated temperature sensor it sets the device temperature using the setTemperature command. The result is the barometric pressure in decimal format. The only problem I am having is as the pressure changes, the piston does not change the value as often as the data changes.