Introductory post as this is my first day with SharpTools. I’m a legacy SmartThings/WebCore user and have started making the migration. Things are moving along good so far, but I’ve run into something I’m not sure how to replicate.
I have a weather tile that has a “wind” value. What I want to do is turn off a device if the wind speed gets above 15 MPH. The weather tile’s wind value is a string in the format “15MPH”. I don’t think I can really do a “> 15” comparison as it is a string. How would I go about doing this in SharpTools?
Hi @Michael_Beatty - welcome to the community. You could use an Expression to parse the number part.
For example, you could use the replace() method to replace the "MPH" with "". You could then output that to a number variable and it would automatically coerce the string "15" to a number.
Thank you for the reply. What would the trigger condition be? For the “wind” attribute, I’d think I would want to use a simple “changes”, but ShartTools doesn’t appear to have that. Would I just set it as changes and is not = “”?