Cynical Weather

Posted on
Mon Sep 18, 2017 10:06 pm
agame offline
Posts: 288
Joined: Jul 13, 2017
Location: Melbourne, Australia

Re: Cynical Weather

A really useful plugin. Helps tremendously with automating window shades and some automated ventilation windows.

Its been a while since the last post...but will throw in another use case for having precipitation accessible more easily:

'if rain is probable, close (or don't open) the ventilation window'. [which will cool the house, but let in water if it rains]

Appreciate the best solution is probably I add a local rain sensor. I assume a rain gauge (thats for measuring total rainfall) isn't going to be quick enough to register the commencement of a shower before I get half a mm of rain in the window [??].... I see sensors like those on car windscreens are around...I'm casting around for something less costly than the Fakro sensor.

Posted on
Thu Sep 21, 2017 8:58 am
Perry The Cynic offline
Posts: 783
Joined: Apr 07, 2008

Re: Cynical Weather

agame wrote:
A really useful plugin. Helps tremendously with automating window shades and some automated ventilation windows.

Its been a while since the last post...but will throw in another use case for having precipitation accessible more easily:

'if rain is probable, close (or don't open) the ventilation window'. [which will cool the house, but let in water if it rains]

Appreciate the best solution is probably I add a local rain sensor. I assume a rain gauge (thats for measuring total rainfall) isn't going to be quick enough to register the commencement of a shower before I get half a mm of rain in the window [??].... I see sensors like those on car windscreens are around...I'm casting around for something less costly than the Fakro sensor.

This has been on my list for years. There are two main reasons why I haven't done it yet:
  • The way rain probabilities are represented in the forecasts makes it tricky to calculate an actual cumulative probability. The rain-probability numbers are by necessity "loose" enough that just alerting on anything >0 would be annoying overkill.
  • I live in an area where rain basically happens about 2-3 weeks per year, and when it does everyone makes a big deal out of it. :-)
I have a weather station, and yes, its rain sensor is sensitive but somewhat laggy - it's designed to be accurate, not fast.

You may want to check whether your window actuator comes with an optional rain sensor. Those are designed to close at the first sniff of water, which is what you want.

Cheers
-- perry

Posted on
Thu Sep 21, 2017 5:52 pm
agame offline
Posts: 288
Joined: Jul 13, 2017
Location: Melbourne, Australia

Re: Cynical Weather

makes sense.

I live in a city renowned for having '4 seasons in one day'. Google tells me 139 rain days a year, so its more of a consideration for me!

I've got a Netatmo weather station, so I think I'll add the rain gauge a try and see just how bad the lag is.

Wind is the other factor, of course, in determining how much water comes inside. I might play with wind direction/strength in my window-opening decision tree.

Posted on
Sun Jul 08, 2018 11:00 am
Berts offline
Posts: 4
Joined: May 20, 2013

Re: Cynical Weather

I have a question on a slightly different topic of Cynical Weather.

Instead of updating the states by using the device to auto-update, I would like to write in my python script a couple of statements that that's care of retrieving the data before processing it.

I can't make that work yet.

Could someone who made this work already tell what python script execute plugin-defined actions he used?

For sure it includes executeAction(actionId, deviceId, props) and the action is I guess “Update Data”, but now the details around it to make it work.

Thanks in advance.

Posted on
Sun Jul 08, 2018 2:10 pm
Perry The Cynic offline
Posts: 783
Joined: Apr 07, 2008

Re: Cynical Weather

First off, my recommendation for this particular case is not to do explicit updates. The default behavior of a Cynical Weather device is to auto-update every 5 minutes. The weather doesn't change that fast. Also, the plugin has a hard limiter that ignores update requests less than 5 minutes after the last update. So unless you're intentionally slowing down or turning off automatic updates, this isn't going to help. (There's also a limit to how many requests Dark Sky honors each day.)

Having said all that, let me walk you through the process. First off, you need to know what action you want to call. Look it up in the plugin's documentation (click on one of those question-mark buttons in the plugin's UI). That'll tell you that there is, indeed, an action called Update Data that does what you want. Now you have the option to do this the Indigo way: create an action group that first invokes the Update Data action and then calls a Python script action containing your code. That requires no fancy Python tap-dancing, and I generally recommend that.

If you really want to call the action from Python code, here's the rough outline of how to go about it. You need to open up the plugin's bundle and rummage through its xml files. You need the internal name of the plugin (found in its Info.plist, in this case org.cynic.indigo.weather), and the internal name of the action (found in the Actions.xml file, in this case poll). Here you will also find a description of the action's arguments, but this one has none.

Now you can put it all together:

Code: Select all
plugin = indigo.server.getPlugin("org.cynic.indigo.weather")
deviceid = (the id for the weather device, from Indigo's device list)
arguments = {}     # arguments to the action -- this one has none
plugin.executeAction("poll", deviceid, arguments)
And there you are. :-)

Cheers
-- perry

Posted on
Mon Jul 09, 2018 1:11 pm
Berts offline
Posts: 4
Joined: May 20, 2013

Re: Cynical Weather

Thx Perry !!

Works perfect and I can fetch it now ad hoc.

Posted on
Sun Feb 23, 2020 6:10 am
Umtauscher offline
User avatar
Posts: 519
Joined: Oct 03, 2014
Location: Cologne, Germany

Re: Cynical Weather

Hi Perry,

I just came to trying out your plugin.. - yes this thread is old.
Would it be possible to change the requested language or would this break compatibility?
I have seen, that the api supports many different languages but I don't see a parameter for changing it.
Perhaps you could explain if it's possible to change it somehow?
Thanks for your great plugin.
Cheers
Wilhelm

Posted on
Tue Mar 10, 2020 5:05 am
haakon offline
User avatar
Posts: 36
Joined: Mar 02, 2017

Re: Cynical Weather

Hi! Thank you for a great plugin. I am experiencing a problem, though. I get an error message saying that my location is unavailable:

Cynical Weather Error My house (location) unavailable: [Errno 54] Connection reset by peer
Cynical Weather Error Forecast (My house) unavailable: host device My house (location) is unavailable


I guess that the second error is a result of the first. But what is error 54?

I just upgraded to Indigo 7.4 and had do go through a bunch of connections in Little Snitch again; I might accidentally have denied a connection. I have not idea if this is relevant, and I can't find the plugin in Little Snitch. So just a thought …

Posted on
Tue Mar 10, 2020 5:20 am
DaveL17 offline
User avatar
Posts: 5451
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Cynical Weather

What version of OS X are you using? This issue has cropped up with the Cynical Weather and Fantastic Weather plugins and is related to changes that Dark Sky are making to their security protocols. It seems that High Sierra is the minimum OS to support the necessary updated protocols. I'm on Mojave and have seen no connection problems whatsoever.

p.s. I don't think Perry has been around for a while. When I look at his last visited date, it's blank. Hopefully, he'll see your post and chime in.

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

[My Plugins] - [My Forums]

Posted on
Tue Mar 10, 2020 6:06 am
haakon offline
User avatar
Posts: 36
Joined: Mar 02, 2017

Re: Cynical Weather

Ah, thanks Dave, I am using Sierra, so that might be it.

Upgrading my finely tuned setup is not tempting. On the other hand, there seems to be little choice when it comes to weather plugins (working in Europe). This will be a difficult decision.

Anyway, thank you for your help. And yep, it would be nice to hear from Perry.

Posted on
Tue Mar 10, 2020 3:09 pm
Perry The Cynic offline
Posts: 783
Joined: Apr 07, 2008

Re: Cynical Weather

I'm still around. I'm just very busy, as you can imagine. And you folks do a great job supporting each other for the most part. :-)

Mojave is the oldest system version I'm actively using myself, so it's hard for me to test older systems. It is true that Everyone On The Internet is blocking older TLS (SSL) protocols because they're basically broken. So anything that relies on MacOS system TLS needs an upgraded system to survive on today's paranoid Internet. It sucks, but (being a security engineer myself) I can understand why they're doing it.

Cynical Weather does indeed use the built-in OpenSSL library in MacOS (via the Python interfaces). The problem with switching to custom SSL code is then I would have to upgrade the plugin twice a year to track the ever-tightening security requirements of the Internet (in this case, of Dark Sky).

Sigh.
-- perry

Posted on
Sun Mar 15, 2020 6:50 pm
haakon offline
User avatar
Posts: 36
Joined: Mar 02, 2017

Re: Cynical Weather

Glad to see that you are still around, Perry. My old OS seems to be the problem; I have to do something about that. (And your solution, using MacOS' OpenSSL library, seems reasonable.)

PS: Thank you for the plugin, I really appreaciate this and your other contributions to the flora of Indigo plugins!

Posted on
Thu Mar 26, 2020 2:05 pm
McJohn offline
User avatar
Posts: 463
Joined: Dec 18, 2012
Location: The Netherlands

Re: Cynical Weather

Mac OS 10.14.6 (MacOS Mojave)
Indigo 7.4.1
Cynical Weather v1.2.1

Since a couple of weeks Cynical Weather is not running anymore.
At every reload of the plugin we got this error:

Cynical Weather Error Weatherdata Home unavailable: [Errno 54] Connection reset by peer


Dark Sky API key is ok.
Does anyone know a solution? How can we solve this?

Thanks

Posted on
Tue Mar 31, 2020 1:56 pm
Shavano offline
User avatar
Posts: 27
Joined: Jul 31, 2017
Location: San Antonio, TX

Re: Cynical Weather

Just to confirm that I have the same problem. My log shows:

Code: Select all
   Starting plugin "Cynical Weather 1.2.1" (pid 48237)
   Cynical Weather                 API version 2.3
   Cynical Weather                 Python version 2.7.16.final.0
   Started plugin "Cynical Weather 1.2.1"
   Trigger                         Weather Update
   Error                           Action has not been completely configured
   Cynical Weather Error           Weather unavailable: [Errno 54] Connection reset by peer
   Trigger                         Weather Update
   Error                           Action has not been completely configured


I tried getting a new secret key from DarkSky, but that didn't work. However, I did find out that DarkSky was purchased by Apple.

Posted on
Tue Mar 31, 2020 2:14 pm
DaveL17 offline
User avatar
Posts: 5451
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Cynical Weather

The connection reset by peer error is due to Dark Sky upping its security protocols. Users will have to at least upgrade to High Sierra in order to continue to use the Dark Sky service. This will be a short term solution as Apple will turn off the API in 2021.

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

[My Plugins] - [My Forums]

Who is online

Users browsing this forum: No registered users and 1 guest