[UPDATED] - Weather Switch - Turn on a switch in response to weather

If you comment out the following lines does it work ok then?

108
117
216
235
377
381

This will remove the switching and tell us if it just doesn’t like the switch

Andy

That seems to have done it. Version 2.4.1 with those lines commented out:

image

So
Smarttiles doesn’t like the switching in the driver

I understand you are focusing on your Weather Switch, but does it interfere with anything to just have the lowercase attributes available all the time (not switchable)? So If you don't need them, you just ignore them?

Yeah.. I was just thinking to show them all
I was only trying this for asthetics :slight_smile:

I’ll remove the switch tomorrow and just have everything

Andy

Thanks for all your work on this. Really helpful and useful. I appreciate it.

1 Like

I could just rewrite WS to use the lowercase attributes.. probably wouldn’t take that long.
I might look at that in the morning

Andy

2 Likes

I was wondering about that. I am not sure that lowercase is the standard, but it does seem like more often than not items are in lowercase. It might be more universally accepted by other existing apps if it were lowercase and that way you would not have to duplicate some/all attributes.

1 Like

I was hoping you'd be spared that :wink:

1 Like

Me too, but it seems almost inevitable :slight_smile:
I don’t really want to maintain two versions so this is probably the best way to do it.

Guys,

I had previously created a monster!
A mix of uppercase and lowercase attributes which were difficult to decypher at times.
Switching between them (as you all know) did not work properly so...

Here it is.. The fully lowercase driver..
Hopefully you guys can thrash it to within an inch (or mm if metric is your preferred measurement) of it's life and let me know if everything works ok.

I couldn't resist a little 'tweak' at the same time.
I have removed the 'reset counter' button and automated it (better for long term use)
WU reset the daily poll counter on your account at midnight NEW YORK TIME.
Therefore I have had to build in a little offset for automatic poll count resetting.
You MUST enter a time in the box provided as shown below

image

This is relative to NY time.
So.. for me in the UK, as we are 5 hours in front of NY, midnight in NY is 05:00 here
So my 'New Day' starts at 5am

I have also rewritten the app to reflect the new driver lowercase attributes

Hope this all works for you and you find it useful.

Driver Version: 2.5.0
App Version: 1.6.0.250

Now uploaded to GitHub

Enjoy!

Andy

Looks pretty good. One thing .... you have this on line #200:

sendEvent(name: "humidity", value: resp1.data.current_observation.relative_humidity.replaceFirst("%", ""), isStateChange: true)

and then on line # 313 you have this:

sendEvent(name: "humidity", value: resp1.data.current_observation.relative_humidity, unit: "%", isStateChange: true)

The second over-writes the first. The second includes the default '%' in the result and that end up as 'null' in the SmartTiles dashboard because it expects just the number without the '%' symbol.

If I comment out line #313 all is good. Great job, again!

@Matthew
Thanks for finding this.. I should have deleted line #313 along with the rest of the stuff I took out
Ok. Done now so will upload (I'll keep the same version number as I don't think anyone else would have grabbed it yet)

Andy

Excellent. One clarification for me please .... So I am in Colorado, USA. When it is 12:01 AM on May 4, 2018 in New York it is 10:01 PM May 3, 2018 in Colorado. I set the 'New Day Starts' to 10:00 PM. Is that correct?

Thanks again.

I just reread your post.

Yes! :slight_smile:

Whatever the local time is when it's midnight in NY is the time to set here.
So the local counter will be reset at the local time

In my case 5am

Andy

So far the driver looks to be working spot on! My High and Low Forecast switches are changing correctly AND my SmartTiles weather icon is right up to snuff!! I couldn't ask for anymore! Thank you!!

1 Like

You are very welcome!

I think it’s almost time to move WS out of beta :slight_smile:

Andy

Looking good! My only concern is that for the last three days or so the different driver versions have returned a wind speed of 0 and gust speed of 0. Today is calm, so not sure if this is actually what is being reported from the station, or if the driver is not displaying wind. No one else has mentioned it, so I am assuming the station is reporting 0 for the wind speeds.

I am getting wind readings .....
image

1 Like

Looks like the station is actually returning 0 wind right now. The hourly forcast shows light wind, so will keep an eye on it today.