NOAA Weather Plus discussions

Plug-ins, scripts, and other software to improve your home automation experience.
nsheldon
Posts: 2469
Joined: Mon Aug 09, 2010 2:12 pm
Location: CA
Contact:

Re: NOAA Weather Plus discussions

Post by nsheldon »

Hi again.

That's odd. Have you tried restarting the Indigo server altogether? What is the current value of the high temperature forecast for today?

Though the error may have been precipitated by the plugin upgrade and associated change in state names, that error is clearly an Indigo client error that I don't think I can fix through plugin code change (AFAIK anyway). Matt or Jay may need to chime in on this one.

You may try creating an all new trigger that does the same thing as one of the the triggers causing the error to see if you get the same error again.
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: NOAA Weather Plus discussions

Post by jay (support) »

I just updated the plugin to the new version, created a new trigger with that condition and it works/saves fine. My guess is that the state change has left something in a bad state. Things I'd try:
  1. Change the condition to "Always" and save it. Reopen and reselect the rule you want and save it again. See if it opens correctly.
  2. If that doesn't work, then it seems like the device has something wrong with it's device state list so you might want to create a new device and try it with that.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
CraigM
Posts: 677
Joined: Sun Oct 28, 2007 7:01 pm

Re: NOAA Weather Plus discussions

Post by CraigM »

jay (support) wrote:...Change the condition to "Always" and save it. Reopen and reselect the rule you want and save it again.
That seems to have fixed the issue :D Thanks

On a related note, is there a way to copy/paste/duplicate a condition? If not can we add that to the feature list?
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: NOAA Weather Plus discussions

Post by jay (support) »

CraigM wrote:On a related note, is there a way to copy/paste/duplicate a condition? If not can we add that to the feature list?
Not currently - I'll add it to the list. Note that if the condition is that complex it might be faster to just dup the trigger and change the firing part rather than recreating the condition. Just a thought.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
ryanbuckner
Posts: 1409
Joined: Sat Oct 08, 2011 12:33 pm
Location: Northern Virginia
Contact:

Re: NOAA Weather Plus discussions

Post by ryanbuckner »

Awesome plugin. Funny enough I spent about 2 hours designing a Control Page on the 1.05 yesterday and had to rename them all today.

Is there any way to get the device states from the virtual device using Applescript?
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: NOAA Weather Plus discussions

Post by jay (support) »

No - plugin devices aren't supported in AppleScript. If you script a lot (or even moderately), I highly recommend learning Python - it's really not hard and it's vastly superior to AppleScript in just about every way.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
nsheldon
Posts: 2469
Joined: Mon Aug 09, 2010 2:12 pm
Location: CA
Contact:

Re: NOAA Weather Plus discussions

Post by nsheldon »

What I do is use the "Insert Device State Into Variable" action in the Actions Collection plugin to insert the forecast condition into a variable when the condition changes, then use AppleScript to access the variable value.
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: NOAA Weather Plus discussions

Post by jay (support) »

Oh - I thought he wanted the list of states for a device (it is Sunday after all :) ). Definitely using the Insert Device State Into Variable action is a great option for getting a state value into AppleScript.

Still - I highly recommend Python for anyone doing a good amount of scripting... ;)
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
ryanbuckner
Posts: 1409
Joined: Sat Oct 08, 2011 12:33 pm
Location: Northern Virginia
Contact:

Re: NOAA Weather Plus discussions

Post by ryanbuckner »

you were both right. I did use the action collection solution. I'm curious how quickly the following actions will occur and if I'll have to build in a delay:

Trigger on device state change:
- step 1: collect state to variable
- step 2: SMS the value of that variable
nsheldon
Posts: 2469
Joined: Mon Aug 09, 2010 2:12 pm
Location: CA
Contact:

Re: NOAA Weather Plus discussions

Post by nsheldon »

ryanbuckner wrote:you were both right. I did use the action collection solution. I'm curious how quickly the following actions will occur and if I'll have to build in a delay:

Trigger on device state change:
- step 1: collect state to variable
- step 2: SMS the value of that variable
I don't know for sure. Step 1 should happen almost instantly. Step 2 would depend on how fast your computer can send out an email to your carrier's email-to-SMS bridge and how long your carrier processed received messages. Note that NOAA Weather Plus clears most forecast states (blanks them out) before setting them to the new state. This is to ensure that old data in the device states that doesn't exist in the updated NOAA XML feed is cleared. However, since the state technically changes 2 times on the server (from old state, to blank, to new state), your trigger may or may not fire 2 times with the first SMS containing no data. If you encounter this, you might need to put a condition in your trigger to only fire if the state you're monitoring is not blank (i.e. not equal to (leave condition value field blank)).
CraigM
Posts: 677
Joined: Sun Oct 28, 2007 7:01 pm

Re: NOAA Weather Plus discussions

Post by CraigM »

Nathan, found this in my log today:

Code: Select all

Aug 27, 2012 5:15:03 AM
  Weather [NOAA Plus]             Warning: Error while attempting to determine source for alternate NOAA data. local variable 'theCurrentObs' referenced before assignment
  NOAA Weather Plus Error         Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 159, in runConcurrentThread
  File "plugin.py", line 367, in update
<type 'exceptions.UnboundLocalError'>: local variable 'theCurrentObs' referenced before assignment

  NOAA Weather Plus Error         plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
nsheldon
Posts: 2469
Joined: Mon Aug 09, 2010 2:12 pm
Location: CA
Contact:

Re: NOAA Weather Plus discussions

Post by nsheldon »

Thanks for the heads-up.

Yep, that's a bug. Though it's hard for me to test to be absolutely sure, I think I've fixed that bug in this version 1.1.1 update. Try installing the 1.1.1 version and let me know if you still see that error.
ryanbuckner
Posts: 1409
Joined: Sat Oct 08, 2011 12:33 pm
Location: Northern Virginia
Contact:

Re: NOAA Weather Plus discussions

Post by ryanbuckner »

nsheldon wrote:
ryanbuckner wrote:you were both right. I did use the action collection solution. I'm curious how quickly the following actions will occur and if I'll have to build in a delay:

Trigger on device state change:
- step 1: collect state to variable
- step 2: SMS the value of that variable
I don't know for sure. Step 1 should happen almost instantly. Step 2 would depend on how fast your computer can send out an email to your carrier's email-to-SMS bridge and how long your carrier processed received messages. Note that NOAA Weather Plus clears most forecast states (blanks them out) before setting them to the new state. This is to ensure that old data in the device states that doesn't exist in the updated NOAA XML feed is cleared. However, since the state technically changes 2 times on the server (from old state, to blank, to new state), your trigger may or may not fire 2 times with the first SMS containing no data. If you encounter this, you might need to put a condition in your trigger to only fire if the state you're monitoring is not blank (i.e. not equal to (leave condition value field blank)).
Yep. I found that the trigger fires every 15 minutes regardless if the value of the variable changes. I'll look into the blank condition and prob split this into 2 triggers. One to update the variable (if not blank) and one to fire the SMS if the variable changes. That should do.
CraigM
Posts: 677
Joined: Sun Oct 28, 2007 7:01 pm

Re: NOAA Weather Plus discussions

Post by CraigM »

Nathan, I'm getting this error every 15 minutes:

Code: Select all

Aug 30, 2012 1:59:53 PM
  NOAA Weather Plus Error         Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 164, in runConcurrentThread
  File "plugin.py", line 1442, in update
  File "plugin.py", line 1580, in updateDeviceState
<type 'exceptions.KeyError'>: 'key weatherAdvisory4Text not found in dict'

  NOAA Weather Plus Error         plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
nsheldon
Posts: 2469
Joined: Mon Aug 09, 2010 2:12 pm
Location: CA
Contact:

Re: NOAA Weather Plus discussions

Post by nsheldon »

Could you turn on debugging and reload the plugin then copy and paste the log into a post? I need to know what URL the plugin is using to get the data.
Post Reply

Return to “Nathan Sheldon Software”