Improve UI when WU pws is offline

Posted on
Sat Mar 10, 2018 8:29 pm
Monstergerm offline
Posts: 274
Joined: Sep 01, 2009

Improve UI when WU pws is offline

Hi Dave,
thanks for all your efforts making this plugin better and better. I just upgraded from v1.x to 7 and it looks like everything updated just fine.

There is a long-standing issue that bugs me. Quite often WU personal weather stations go offline. Your offline trigger works great for notifications. But, the Indigo UI still shows a colored thermometer icon and the wrong and outdated temperature for those offline stations.

Is it possible to make the thermometer icon gray and replace the wrong temperature in the uiValue with the words "offline"? Not sure whether you want to make the onOffState FALSE too.

I also like to find a solution to indicate offline status on custom control pages. My control page prominently displays a Current Condition - Temperature that is outdated.

Last, there are a bunch of minor errors in the log when a station is offline:
WUnderground 7 Debug Processing device: Wunderground Sentinels at DelSur
WUnderground 7 Debug URL for pws:KCASANDI170: WUnderground 7 Debug [ Wunderground Sentinels at DelSur download: 00.594817 seconds ]
WUnderground 7 Debug Adding weather data for pws:KCASANDI170 to Master Weather Dictionary.
WUnderground 7 Debug API calls left: 495
WUnderground 7 Debug Imputing historyPop (I) data. Got: Returning: (-99.0, --)
WUnderground 7 Debug Imputing historyHigh (S) data. Got: Returning: (-99.0, --)
WUnderground 7 Debug Can not format historyHigh (S) [could not convert string to float: --]
WUnderground 7 Debug Imputing historyLow (S) data. Got: Returning: (-99.0, --)
WUnderground 7 Debug Can not format historyLow (S) [could not convert string to float: --]
WUnderground 7 Debug Formatted dewpointF (S) data. Got: -9999.0 Returning: (-99.0, --)
WUnderground 7 Debug Can not format dewpointF (S) [could not convert string to float: --]
WUnderground 7 Debug Imputing heatIndexF (S) data. Got: NA Returning: (-99.0, --)
WUnderground 7 Debug Can not format heatIndexF (S) [could not convert string to float: --]
WUnderground 7 Debug Imputing windChillF (S) data. Got: NA Returning: (-99.0, --)
WUnderground 7 Debug Can not format windChillF (S) [could not convert string to float: --]
WUnderground 7 Debug Imputing foreHigh1 data. Got: Returning: (-99.0, --)
WUnderground 7 Debug Can not format foreHigh1 [could not convert string to float: --]

Posted on
Sat Mar 10, 2018 8:55 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Improve UI when WU pws is offline

Hi - thanks for the kind words!

I'll take a look at the treatment of the UI icon for sure, that sounds like it may be a bug. The temperature value thing is purposeful; I'm having the plugin go back to the last known rational value. I'm doing this because returning a value that's not a number could break folks' logic (I think it's always a float, but I'd have to look). I'm always hesitant to have the device state be one value and the UI value be something entirely different (like 'temp' = 12.3 and 'temp.ui' = 'offline' or something). But there may be a better way to handle it. onOffState could very definitely be set to False in that situation. I think onOffState might be the way to go with the control page thing you mentioned, too.

The logging stuff you showed is definitely purposeful. They're not errors per se, but rather signals of where WU is sending data that's not what we expect. At some point, I plan to reduce the verboseness (is that even a word?) of the logging, but it has proved helpful at times--especially when WU's API went crazy recently.

These things are all a matter of balance and I want to do what works best for the most people, so if you have any other thoughts, please pass them along!

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sat Mar 10, 2018 9:21 pm
Monstergerm offline
Posts: 274
Joined: Sep 01, 2009

Re: Improve UI when WU pws is offline

I don't have a perfect solution either, but I find it confusing when one looks at the control page or Indigo UI and sees a temp or current condition reading that is potentially days or weeks old. Only after digging for the timestamp would one know that this is outdated info.
On the WU webpage, they blank out the whole current conditions section with a big red exclamation mark and state that the pws is offline.

Posted on
Sat Mar 10, 2018 9:37 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Improve UI when WU pws is offline

Yeah, I don't disagree and that's what I was trying to address with the trigger. I bet there's a more refined way to handle this situation and I'll give it some thought.

The solution might be to present the user with options of how they would like offline PWS conditions to display. It would keep me from having to choose one way that doesn't work well for anyone! :D

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sun Mar 11, 2018 6:50 am
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: Improve UI when WU pws is offline

DaveL17 wrote:
verboseness (is that even a word?
Just in case it ever comes up in a UI dialog box design: the word you're looking for is "verbosity." :lol:

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Sun Mar 11, 2018 11:34 am
Monstergerm offline
Posts: 274
Joined: Sep 01, 2009

Re: Improve UI when WU pws is offline

I tried to tinker with it along those lines;
If user-defined timeframe (e.g. 60 min) triggers the Offline Trigger, it also turns the thermometer icon gray and replaces onOffState with "offline". So it would be a conscious decision by the end user to accept an offline reading.

I then keep the trigger off for one day, so it does not trigger every 60 min. This of course causes the icon and onOffState to revert back to a reading at the next time WU server is getting called (e.g. 15 min later). To avoid this we would need something that calls the offline trigger method every time the server is being called regardless of the user having the trigger disabled.

Therefore, I think it might be better to put the timeframe for when the Offline status is getting activated as part of the device setup. So then the daily server calls could check whether the onOffStatus status should be kept as False with uiValue "offline" or be reverted back to True with a temp reading.

Anyway after spending a few hours on this I got nowhere.

Posted on
Sun Mar 11, 2018 1:07 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Improve UI when WU pws is offline

Thanks for giving it some thought--I appreciate you taking the time to try to come up with a solution.

Hopefully, I'll be able to come up with something.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sun Mar 11, 2018 1:12 pm
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Improve UI when WU pws is offline

This is a really tricky one to deal with - because you may not want actual values to change type. So, for instance, say you have a script that looks at the temperature - you always want that value to be a number (not a string for instance that represents unavailable) because the script (or a condition, or a trigger, etc) will break unless it knows that the value can change from a number to a string.

You could insert a bogus value, but what's the right one that will work logically?

I had to deal with this stuff in the WeatherSnoop plugin. The 'errorState' property on WS devices will show if there is an issue communicating with it and that can be used as an element on a control page to indicate a problem.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Mar 11, 2018 1:24 pm
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Improve UI when WU pws is offline

Different Computers wrote:
DaveL17 wrote:
verboseness (is that even a word?
Just in case it ever comes up in a UI dialog box design: the word you're looking for is "verbosity." :lol:


Grammar police activate!

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Mar 11, 2018 1:32 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Improve UI when WU pws is offline

Jay wrote:
This is a really tricky one to deal with - because you may not want actual values to change type.

Yeah, I definitely don't want to change the value type.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest