Cynical Weather

Posted on
Thu Apr 10, 2014 4:53 pm
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Cynical Weather

Perry The Cynic wrote:
No tides from forecast.io; sorry. That would have to be an entirely different data source. So no, not in this plugin.


I might have a crack at that myself someday... Been slowly learning this new fangled python ya'll talks about

Computer says no.

Posted on
Fri Apr 25, 2014 8:46 am
Shutter offline
Posts: 345
Joined: Mar 07, 2014
Location: London, UK

Re: Cynical Weather

Hi Perry,

Firstly, thank you for this and your SecuritySpy plugin. Really appreciate it.

Posted to the forum yesterday about and issue in the SecuritySpy plugin and today I saw this in Cynical Weather.

Screen Shot 2014-04-25 at 02.57.38 pm.png
Screen Shot 2014-04-25 at 02.57.38 pm.png (34.76 KiB) Viewed 6518 times


Looks like the two plugins are getting themselves confused. :?

Posted on
Mon Sep 01, 2014 6:06 pm
Dewster35 offline
Posts: 1030
Joined: Jul 06, 2010
Location: Petoskey, MI

Re: Cynical Weather

Curious if after noodling on this for awhile that you've thought of a solution without having to poll repeatedly?

Dewster35 wrote:
Very cool. I wouldn't think you would need anything fancy for Indigo.... just a precip state that would be yes or no? I believe there aren't any other options... there either is precipitation starting in the next 15 minutes or not.

Posted on
Mon Sep 08, 2014 11:32 am
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Cynical Weather

Just a wee feature request… on the hourly (and daily i suppose as well) forecast devices it’d be great if there was a line that said what hour/day it’s for.. at the moment i need to have various variables and schedules with scripts to update them manually. I’m currently in the middle of a refresh of my DB, trying to get rid of things that don’t need to be there or simplifying scripts that are overly complex.. this would help a great deal :D

Edit: Also it'd be totally awesome if there was a line of info with the temperature rounded to a whole digit for use with image heuristics on control pages

Computer says no.

Posted on
Wed Dec 24, 2014 2:55 am
McJohn offline
User avatar
Posts: 631
Joined: Dec 18, 2012
Location: The Netherlands

Re: Cynical Weather

Good day,

This morning at 6.30 hour, spontaneously Cynical Weather gives these continuous errors below.
Even after a reload of the plugin.
What could this be?
Thanks for the help.
John

Cynical Weather Error in runConcurrentThread: Traceback (most recent call last):
File ".../Server Plugin/cyin/debugging.py", line 46, in diagnostic_log
yield
File ".../Server Plugin/cyin/debugging.py", line 56, in diagnose_call
return method(*args, **kwargs)
File ".../Server Plugin/cyin/asynplugin.py", line 52, in runConcurrentThread
self.run()
File ".../Server Plugin/asyn/inject.py", line 49, in run
asyn.Controller.run(self)
File ".../Server Plugin/asyn/controller.py", line 91, in run
item._can_read()
File ".../Server Plugin/asyn/selectable.py", line 219, in _can_read
self._scan(input)
File ".../Server Plugin/asyn/scan.py", line 50, in _scan
self.callout(RAW, self._rbuf)
File ".../Server Plugin/asyn/core.py", line 140, in callout
results = [cb(ctx, *args) for cb in list(self._callbacks)] # latch callback list
File ".../Server Plugin/asyn/ssl.py", line 121, in incoming
self._service()
File ".../Server Plugin/asyn/ssl.py", line 97, in _service
self._scan(rdata)
File ".../Server Plugin/asyn/scan.py", line 50, in _scan
self.callout(RAW, self._rbuf)
File ".../Server Plugin/asyn/core.py", line 140, in callout
results = [cb(ctx, *args) for cb in list(self._callbacks)] # latch callback list
File ".../Server Plugin/asyn/http_chunk.py", line 30, in incoming
self._pass_downstream(data)
File ".../Server Plugin/asyn/http_chunk.py", line 57, in _pass_downstream
self.callout('END', data)
File ".../Server Plugin/asyn/core.py", line 140, in callout
results = [cb(ctx, *args) for cb in list(self._callbacks)] # latch callback list
File ".../Server Plugin/asyn/zfilter.py", line 32, in incoming
self.callout(ctx)
File ".../Server Plugin/asyn/core.py", line 140, in callout
results = [cb(ctx, *args) for cb in list(self._callbacks)] # latch callback list
File ".../Server Plugin/asyn/http.py", line 280, in incoming
return self.callout('body', self.body)
File ".../Server Plugin/asyn/core.py", line 140, in callout
results = [cb(ctx, *args) for cb in list(self._callbacks)] # latch callback list
File ".../Server Plugin/forecast/core.py", line 179, in cb
callout(asyn.Context('reading'), Reading(args[0]))
File ".../Server Plugin/forecast/core.py", line 124, in __init__
self.days = self._collect(s.get("daily"))
File ".../Server Plugin/forecast/core.py", line 142, in _collect
return List(data, self.units)
File ".../Server Plugin/forecast/core.py", line 91, in __init__
list.__init__(self, [Point(dp, units) for dp in points])
File ".../Server Plugin/forecast/core.py", line 40, in __init__
convert("summary", str, "")
File ".../Server Plugin/forecast/core.py", line 38, in convert
setattr(self, name, None if value is None else type(value))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 13: ordinal not in range(128)

Cynical Weather Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)

Posted on
Fri Dec 26, 2014 9:39 am
freshwuzhere offline
Posts: 105
Joined: Apr 05, 2012

Re: Cynical Weather

Looks a little like you have a dash character somewhere when only an ascii 1-128 will be accepted? Any likelihood your lat long is bad format?

Posted on
Fri Dec 26, 2014 2:37 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical Weather

McJohn wrote:
Good day,

This morning at 6.30 hour, spontaneously Cynical Weather gives these continuous errors below.
Even after a reload of the plugin.
What could this be?


Your local daily weather summary string, as delivered by the forecast.io servers, contains an "en dash" (a kind of hyphen but not a plain hyphen). Python throws an error because it doesn't like that for some reason (that I can't offhand understand), and so the plugin fails. So this is a problem triggered by the actual summary string delivered from forecast.io, and probably doesn't happen to most other people. (It doesn't to me - what kind of weather do they have where you live? :-))

I've asked you by email to send me your geographic location so I can try to reproduce this. If I can, I can "armor" the string conversion to drop Unicode characters and solve the problem that way.

Meanwhile, your only solution (short of hacking the plugin source) is to pray for weather without en-dashes in it. :-)

Cheers
-- perry

Posted on
Mon Dec 29, 2014 2:09 am
McJohn offline
User avatar
Posts: 631
Joined: Dec 18, 2012
Location: The Netherlands

Re: Cynical Weather

Hello Perry,

Thanks for the fast response and the test.
Everything is working fine now, no more snow yet :)
Warm regards,
John

Posted on
Mon Dec 29, 2014 10:52 am
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical Weather

The change John tested is now available as version 0.9.3 of Cynical Weather. For those of you with European snow conditions. :-)

Cheers
-- perry

Posted on
Wed Jul 08, 2015 2:22 am
McJohn offline
User avatar
Posts: 631
Joined: Dec 18, 2012
Location: The Netherlands

Re: Cynical Weather

Hi Perry,

Every day we use your great Weather Plugin. Thanks again!
A year ago we spoke about the moon phase. You said this option was maybe for the future.
Suddenly I saw in my Indigo Variables a "MoonPhase".
(sorry, I don't inspect every day my +200 Variables :D
So, I checked all my Plugins where this Variable MoonPhase came from. It makes me crazy.
I couldn't find the source,
(Maybe it's an option for the makers of Indigo to give every Variable a source ID)
But I found it! It was your Weather plugin! What a nice surprise! Thanks!

The question is ;
At this moment the moon phase in the Netherlands is 56% visibility. For sure.
But your plugin says 0.73
Why is this difference?

Thanks for your help and kind regards,

John
Attachments
MoonPhase.png
MoonPhase.png (27.35 KiB) Viewed 5967 times

Posted on
Wed Jul 08, 2015 12:23 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical Weather

McJohn wrote:
The question is ;
At this moment the moon phase in the Netherlands is 56% visibility. For sure.
But your plugin says 0.73
Why is this difference?

The moon phase delivered by forecast.io is based on the lunation number - essentially a time line from one new moon to the next. In particular, 0.5 is the full moon - half way between two new moons. This is not a "how full is the moon" measure, though of course you can convert as 1 - abs(phase-0.5), which gets you 54% - close enough.

(Also note that there's several measures of "fullness" for the moon - some time-based, some based on what fraction of the surface is lit, etc. Each will come up with a somewhat different percentage.)

Here's what forecast.io says about this:
moonPhase (only defined on daily data points): A number representing the fractional part of the lunation number of the given day. This can be thought of as the “percentage complete” of the current lunar month: a value of 0 represents a new moon, a value of 0.25 represents a first quarter moon, a value of 0.5 represents a full moon, and a value of 0.75 represents a last quarter moon. (The ranges in between these represent waxing crescent, waxing gibbous, waning gibbous, and waning crescent moons, respectively.)


Cheers
-- perry

Posted on
Thu Jul 09, 2015 3:15 am
McJohn offline
User avatar
Posts: 631
Joined: Dec 18, 2012
Location: The Netherlands

Re: Cynical Weather

Hello Perry,

Thank you very much for the fast reply and clear explanation, I now know what I can do with this data.
You knows a lot of totally different things :D

Kind regards,

John

Posted on
Sun Oct 04, 2015 6:22 am
ac4lt offline
Posts: 74
Joined: Sep 20, 2015

Re: Cynical Weather

This is a great plugin! Thanks for making it available.

I was wondering if it would be possible to get precipitation probability from the forecast data? I don't see it in the daily forecasts and it would be a useful thing to have. Does the forecast.io api not provide it?

Posted on
Sun Oct 04, 2015 11:23 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical Weather

ac4lt wrote:
This is a great plugin! Thanks for making it available.

I was wondering if it would be possible to get precipitation probability from the forecast data? I don't see it in the daily forecasts and it would be a useful thing to have. Does the forecast.io api not provide it?

An hourly precipitation probability is part of the data set, but it's not currently broken out as a separate state variable. The raw data is an hourly probability of precipitation (how likely will it rain in the next hour?), and the hour after that, and so on. I've never gotten a good explanation (from the forecast.io crew) on how one would combine these hourly probabilities, since obviously they're not independent. :-)

What exactly are you hoping to get out of this?

If you check the Report Raw JSON Data checkbox in the Location device, you'll get a JSON string object (in the "data" state of the device) that contains everything forecast.io has sent on its last update. That's enough for experimentation, though obviously it isn't very convenient.

Cheers
-- perry

Posted on
Mon Oct 05, 2015 8:11 am
ac4lt offline
Posts: 74
Joined: Sep 20, 2015

Re: Cynical Weather

I'm hoping to get a precipitation percentage from the daily forecast. The goal is to use that together with the forecast itself to use some hue lights for general is it going to rain/snow/sleet type of indications. I've got the forecast part working but didn't see precip probability in the data. I'll try looking at the raw data to see what comes back there.

Who is online

Users browsing this forum: No registered users and 2 guests