Can I use high from today and tomorrow on weather tile in a piston?

weather

#1

Hi guys,

I’ve activated the weather tile in SmartThings. Can I make a piston which makes use of today’s high value and tomorrows high value? I can’t seem to access them in the piston properly (just the current temperature). Any help in accessing these somehow would be great.


#2

Take a look at the weather data available and you should be able to edit to get what you want:

https://wiki.webcore.co/TWC_Weather


#3

mid([WeatherTile:forecastTomorrow],
indexOf([WeatherTile:forecastTomorrow],"High ")+5,
indexOf([WeatherTile:forecastTomorrow],“F.”)-(indexOf([WeatherTile:forecastTomorrow],"High ")+5))

Replace all instances of WeatherTile with your device’s actual name. Also this will come out as a string, so you’ll need to wrap the whole thing in integer() if you’re doing any calculation.

(expression) mid([WeatherTile:forecastTomorrow], indexOf([WeatherTile:forecastTomorrow],"High ")+5, indexOf([WeatherTile:forecastTomorrow],“F.”)-(indexOf([WeatherTile:forecastTomorrow],"High ")+5)) »»» (string) 103


#4

Perfect, thanks a lot!

I assume for todays high, the same thing works but with forecastToday in instead, I realise that after a certain point forecast today disappears (around 3pm it seems) so i’ll program accordingly


#5

It does work the same for forecastToday

(expression) mid([WeatherTile:forecastToday], indexOf([WeatherTile:forecastToday],"High ")+5, indexOf([WeatherTile:forecastToday],“F.”)-(indexOf([WeatherTile:forecastToday],"High ")+5)) »»» (string) 104


#6

Strangely my Forecast Today tile doesn’t appear, anyone know why? Does the feature not exist anymore?


#7

Looking at the twc page I think there was probably an easier way of doing it anyway

$twcweather.forecast.temperatureMax[0]

Appears to give me todays high and

$twcweather.forecast.temperatureMax[1]

Appears to give me tomorrows max - I think that’s correct anyway.


#8

Yes, you might be better off using that. Looks like the weather tile’s forecast text varies… the same expression above gives me »»» (string) near 105


#9

Am I right in thinking temperatureMax[1] is tomorrow? And temperatureMax[2] is the day after that etc? With 0 being today?


#10

You might want to post in the $twcweather thread… I don’t do much weather stuff. Arizona is just hot and very hot ;D


#11

Quick answer:
Yes


Longer answer:
Yes, although I believe that data switches over in the 3 o’clock hours.
(IE: from approximately 3:15pm to 3:15am, [0] will always be null)

For example:

3:05PM: temperatureMax:[79, 73, 72, 73, 73, 65, 59, 62, 64, 68, 69, 68, 69, 70, 71]
3:35PM: temperatureMax:[null, 73, 72, 72, 73, 66, 59, 62, 64, 68, 68, 68, 69, 70, 72]

To see this in action, let’s examine the 24 hours period on a Monday:

Monday from 12am to ≈3am

[0] = null
[1] = Monday’s data

Monday from ≈3am to ≈3pm

[0] = Monday’s data
[1] = Tuesday’s data

Monday from ≈3pm to 11:59pm

[0] = null
[1] = Tuesday’s data

The ≈ represents “approximately” here.


Note: The earliest I have ever seen it change over is 2:58… The latest is 3:36…

pic

(you can see a 33 day graph of these variances here)


#12

Apologies for reviving an old thread, but even 20 months later, important data still drops when using $twcweather.forecast.

To overcome this limitation, I have created a piston to preserve certain data so it is always available… Even during those null times…