How to setup SmartTiles on Hubitat

@ritchierich - great tips!

Here's another tweak... If you want a cloud.hubitat.com url to be able to access your SmartTiles instance when not on your local network, simply change the endpoint URL as follows:

Note: both the Hubitat Cloud and Local endpoints are shown below. I have uncommented the cloud version. I have also used the new helper functions recently added in the Hubitat firmware to generate the endpoints.

	//Original ST Endpoint
	//["https://graph.api.smartthings.com/api/smartapps/installations/${app.id}/$path", "?access_token=${state.accessToken}"]
	
	//Hubitat cloud endpoint
	["${fullApiServerUrl(path)}?access_token=${state.accessToken}"]
	
	//Hubitat local endpoint 
	//["${fullLocalApiServerUrl(path)}?access_token=${state.accessToken}"]

[Update: Looks like @ritchierich already tweaked his post to use the cloud vs local endpoint. This post still demonstrates the new endpoint helper functions. :wink: ]

[Weather Tile Update] I was able to get the Weather Tile to work (at least partially) by making the following change to the SmartTiles App

I commented out the original line below and replaced it with the one you see immediately below it. This allows you to select the built-in Hubitat Weather device which you have to configure manually ahead of time. It uses Weather Undergound to obtain the data so you'll need a personal "Weather Underground API key" to configure it.

//            input "weather", "device.smartweatherStationTile", title: "Weather...", multiple: true, required: false
            input "weather", "capability.temperatureMeasurement", title: "Weather...", multiple: true, required: false

Also, to get Sunrise and Sunset to work, you'll need to tweak the following function as shown below:

def getWeatherData(device) {
    def noParams = getSunriseAndSunset()   
	def data = [tile:"device", active:"inactive", type: "weather", device: device.id, name: device.displayName, localSunrise: "${noParams.sunrise.format("HH:mm")}", localSunset: "${noParams.sunset.format("HH:mm")}"]
    ["city", "weather", "feelsLike", "temperature", "percentPrecip", "humidity", "weatherIcon"].each{data["$it"] = device?.currentValue("$it")}
    data.icon = ["chanceflurries":"wi-snow","chancerain":"wi-rain","chancesleet":"wi-rain-mix","chancesnow":"wi-snow","chancetstorms":"wi-storm-showers","clear":"wi-day-sunny","cloudy":"wi-cloudy","flurries":"wi-snow","fog":"wi-fog","hazy":"wi-dust","mostlycloudy":"wi-cloudy","mostlysunny":"wi-day-sunny","partlycloudy":"wi-day-cloudy","partlysunny":"wi-day-cloudy","rain":"wi-rain","sleet":"wi-rain-mix","snow":"wi-snow","sunny":"wi-day-sunny","tstorms":"wi-storm-showers","nt_chanceflurries":"wi-snow","nt_chancerain":"wi-rain","nt_chancesleet":"wi-rain-mix","nt_chancesnow":"wi-snow","nt_chancetstorms":"wi-storm-showers","nt_clear":"wi-stars","nt_cloudy":"wi-cloudy","nt_flurries":"wi-snow","nt_fog":"wi-fog","nt_hazy":"wi-dust","nt_mostlycloudy":"wi-night-cloudy","nt_mostlysunny":"wi-night-cloudy","nt_partlycloudy":"wi-night-cloudy","nt_partlysunny":"wi-night-cloudy","nt_sleet":"wi-rain-mix","nt_rain":"wi-rain","nt_snow":"wi-snow","nt_sunny":"wi-night-clear","nt_tstorms":"wi-storm-showers","wi-horizon":"wi-horizon"][data.weatherIcon]
	data
}

Here is what it looks like for me

3 Likes