I’ve seen a few topics and posts, looking for a weather app and or ideas. I have a device handler (SmartThings) that includes: Current Conditions, 7 Day Forecast, Icons, Custom City (3) Forecast and Severe Weather Alert. In addition to adding the information to a dashboard… you can also use it in a ‘Rule’ (e.g. If temperature is greater than X - do this), there’s even an attribute called ‘Rain’ (currently raining) which returns a true/false (e.g. If Rain is True and Window is open - do this) or ‘ForecastForRain’ (e.g. If ForecastForRain is True and QPF >=.25 - don’t run the sprinkler).
The device handler comes with a few settings/options
Current Version: 3.2
Location: (Zip Code / Latitude,Longitude) Defaults to location
NOTE: Enter Latitude separated by a comma,Longitude (e.g. 51.529,-0.234)
Update frequency: (optional) 15 minute default
Display measure units (i.e. C/F, MPH/KPH, etc.): Default is Off
Display measure symbols (°, ↑↓, %): Default is Off
Display weather forecast as (Icon, Phrase, Both) Default is Phrase
Default alert message (Message to display when there are no alerts): Default is 'none’
Check for precipitation on this day (Today, Tomorrow, Following Day): Default is Today
Show precipitation day (Added to precipitation data): Default is Off
Additional Locations (Zip Code / Latitude,Longitude): Default is New York City, Los Angeles, Denver
Weather Device Handler
Open link and right click Save as… to your computer.
How to create the DTH:
Login to the SmartThings IDE, click My Device Handlers, click Create New Device Handler, click the From Code tab and paste in the code. Click Create, Save, Publish (For Me).
Then goto/click My Devices, New Device and fill in the fields (leave the Zigbee Id blank) - select the WeatherForecast from the Type drop down and click Create.
Note: Device Network Id can be anything… just make it unique.
Then… Open the SmartThings app, find the newly created device, click on it and change the settings if you want (hamburger menu - settings). Last step would be to add it in the SharpTools App (under temperature sensors).
Special Note: If you already have a previous version (WeatherForecast) installed - You can update to this version by…
Login to the IDE, open the previously create device and paste in/over the old code - Save - Publish. Then goto/click My Devices and click on the device/name you previously installed - scroll to the bottom and click Edit - Update. You can then update the device settings in the smartthings app (i.e. measures, forecast display…) and you will need to update it in the SharpTools App - Simply click through (next/done).
Attributes are available after adding it (Thing) to your dashboard and changing the Layout to ‘Hero Attributes’ and selecting the primary and secondary (optional).
Precip Type, QPF and Type+QPF values are based on the reported precipitation type (i.e. rain, snow) and app settings (e.g. Tomorrow) - Snow Range and Forecast for Rain are also based on the app settings (3 Day option).
QPF Attribute: Check the ‘Show Decimals’ box
If NO Precip Type is being reported… The value for this attribute will be shown as: ‘N/A’
Change the Main Content Overflow option to reflect the desired tile appearance - Collated content is formatted.
Depending on your device/os, Icons may render differently than in the examples.
Besides the device handler, I’ve included some examples and the CSS to create these.
Note: These examples use background images (url required). You can find additional examples here, that do not require an image.
Spacing: No Gap (required for examples 1 & 2)
Weather Example - CSS
After creating your Theme and adding in the Custom CSS - You will need to add the following style reference to your Theme.
ex1, e2, ex3, ex4, ex5, ex6, ex7, ex7left, ex7right, ex8, ex9, ex10
Assets: (right click the image to save)
weather_image_1.png, weather_image_2.png, weather_image_3.png
Edit Mode - Tile Dimensions