What Is Wrong With This Piston?


#1

1) Give a description of the problem
(PUT YOUR INFO HERE)
I doesn’t refresh temperature values
2) What is the expected behavior?
(PUT YOUR INFO HERE)

3) What is happening/not happening?
(PUT YOUR INFO HERE)
I can see the AccuWeather app receives refresh and getForecast commands but the 3hr forecast and reel feel never update. Also, the piston trace progress is strange - only one blue line from top to bottom. Log is full - no errors. NOTE: the 1 minute interval is for testing purposes. It acts same way with 10 minutes.
4) Post a Green Snapshot of the pistonimage
(UPLOAD YOUR IMAGE HERE)


5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS THEN HIGHLIGHT ALL OF THE LOGS SND CLICK ON THE </> ICON TO FORMAT THEM)

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


#2

Your coding actually looks very nice…

1
returns:
2

and then:
3
strips the extra text and returns:
4


I have never monitored AccuWeather’s 3hr forecast, but I notice on many of their other data points they only update a couple times an hour… Might be worth watching this one for a bit to see if the 64 & 66 change…


#3

I just tested that code twice in 20 minutes, and it changed a couple of degrees for me…


#4

I am still scratching my head why the trace line goes straight one blue line (first to the left). It doesn’t even show it goes into the do action although I see the refresh and getForecast commands sent in th AccuWeather recents. But the variables never refresh. Those 66 and 64 are from last night…


#5

You have it locked into only running between 7am and 8:59am…
The variables will only change during those times… (line 20 in your pic)
The other 22 hours in the day, your piston will do nothing.


#6

:slight_smile: That is not the issue but thanks anyway.


#7

I am running couple of months old WebCORE (manual update). Could that be causing it?


#8

The piston you attached to your original post will NOT update the variables for 22 hours each day… Adjust that line and watch the magic happen :sunglasses:


#9

I know. That is the intend. Only to update between 7 and 9am. If you look at the screenshot, it was executed in that time frame.


#10

Here is a screeshot with time of day removed. There is something in the log abou t"= recovery with a delay of 5072ms". Not sure if this is an error. The values as still stuck on last nights’.


#11

Well, I just rewrote your code out by hand, and it seems your first block is causing issues.
I would delete/disable all of the highlighted lines below, and it should work as intended.

By the way, AccuWeather acts like a device, so there is no real need to poll for fresh data. When there is new data, AccuWeather automatically pushes it to the ST hub.


#12

Well, I found a problem with AccuWeather - the next 3 hours forecast sometimes is stuck on the previous hour. So it could be 8:30 but the 3 hour forecast would still be 8,9, and 10 am, instead of 9,10,11. I think the manual refresh and/or makes that update.

On a side note, anyone knows a better service with forecast (I am aware of the smart weather tiles but don’t see forecast there)


#13

Well, you could try using the built in WUnderground to get the forecast temp:
$weather.hourly.hourly_forecast.temp.english
That code above pulls in MANY hours…

If you only want THIS hour, the code is:
$weather.hourly.hourly_forecast.temp.english[0]

If you only want the NEXT hour, the code is:
$weather.hourly.hourly_forecast.temp.english[1]

and so on…

I suspect you will have a similar issue with not knowing exactly WHEN the hour clicks over. If you really wanted to play it safe, you could pull in 4 hours (instead of 3).


An advanced method (that requires a bunch more code) could actually pull in all 4 temps for the next 4 hours, and then spit out the highest number from that list…

Personally, I use WUnderground for 95% of my weather queries… and only use AccuWeather when WUnderground cannot do what I need. (such as cloud coverage)


You can find a lot more code samples for weather forecasts here: https://wiki.webcore.co/Weather#Forecast


#14

Great info. Thanks.
I assume that would pull data based on the hub location as configured, right?


#15

Yes, you are correct.


#16

By the way, I left that test piston running for a bit, and it works well…
Updating itself shortly after each hour. (Notice the logs at the bottom)


#17

Yeah, mine is working again. Something with the AccuWeather refresh I think was throwing it off. Thanks,


#18

No problem. Glad to help