NOAA Weather Plus discussions

Plug-ins, scripts, and other software to improve your home automation experience.
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: NOAA Weather Plus discussions

Post by FlyingDiver »

Please don't use screen captures for code. Put the code into "Code" blocks. It's in the middle of the green "Selection style" bar above the edit window.

that should be:

Code: Select all


theTemperatureV = indigo.variables[1708239780] #MinTemperatureVariable
dev = indigo.devices[23142400] #Weather Plus Station
if dev.states['minTemp2ndNight'].floatValue() < theTemperatureV.floatValue():
    return True
else: 
    return False
The "[]" syntax is for elements of a dict, which is what "dev.states" is. Parenthesis are for calling functions. You also need to make sure what you're comparing are real numbers (floats).
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: NOAA Weather Plus discussions

Post by FlyingDiver »

Heh, I edited my answer at the same time you were posting that. ;)
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
DaveL17
Posts: 7321
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: NOAA Weather Plus discussions

Post by DaveL17 »

Heh - nobody is going to know what you're talking about because I deleted my post! 8)
I came here to drink milk and kick ass....and I've just finished my milk.

My Plugins and Scripts
Ericbo
Posts: 148
Joined: Tue Sep 18, 2012 2:56 pm

Re: NOAA Weather Plus discussions

Post by Ericbo »

Thank you, thank you FlyingDiver and will know about capturing the code
Much appreciated! Eric
Ericbo
Posts: 148
Joined: Tue Sep 18, 2012 2:56 pm

Re: NOAA Weather Plus discussions

Post by Ericbo »

Just tried it FlyingDiver and getting the error "embedded script:'unicode' object has no attribute 'floatValue'.
Is it because the variables are unicode (I am pretty sure theTemperatureV would be, not sure what the state minTem2ndNight extraction format would be) or ... ?
(I tried to google this error but did not get much relevant :(
Thank you for your help and teaching!
ps: just copied and pasted your code without any change ....

Code: Select all

theTemperatureV = indigo.variables[1708239780] #MinTemperatureVariable
dev = indigo.devices[23142400] #Weather Plus Station
if dev.states['minTemp2ndNight'].floatValue() < theTemperatureV.floatValue():
    return True
else: 
    return False
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: NOAA Weather Plus discussions

Post by FlyingDiver »

I may have gotten that syntax wrong. Dave's way would probably have worked;

Code: Select all

theTemperatureV = indigo.variables[1708239780] #MinTemperatureVariable
dev = indigo.devices[23142400] #Weather Plus Station
if float(dev.states['minTemp2ndNight'].value) < float(theTemperatureV.value):
    return True
else: 
    return False
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
Ericbo
Posts: 148
Joined: Tue Sep 18, 2012 2:56 pm

Re: NOAA Weather Plus discussions

Post by Ericbo »

Thanks a lot FlyDiver, tried, got the same error, adjusted a bit after some reading and got the following without syntax error. Will now confirm if it works as expected :)
Thank you for the help!

Code: Select all

theTemperatureV = indigo.variables[1708239780] #MinTemperatureVariable
dev = indigo.devices[23142400] #Weather Plus Station
if float(dev.states['minTemp2ndNight']) <  theTemperatureV.value:
    return True
else: 
    return False
Ericbo
Posts: 148
Joined: Tue Sep 18, 2012 2:56 pm

Re: NOAA Weather Plus discussions

Post by Ericbo »

Wondering if you have experience with Weather Plus not returning the expected forecast temperature...
I am getting an embedded script error when converting the temperature string to float. So i assume it is just not returning the usual temperature.
I will have to test for that in the script (error post, script post). Thank you for your inputs :)
Note: I am testing all the forecasted temperature to see if the temperature is dropping ...

May 10, 2020 at 4:05:52 AM
Trigger Weather MinTemperature Change Update (Tonight)
Trigger Weather MinTemperature Change Update (TomorrowNight)
Trigger Weather MinTemperature Change Update (2ndNight)
Trigger Weather MinTemperature Change Update (3rdNight)
Trigger Weather MinTemperature Change Update (4thNight)
Trigger Weather MinTemperature Change Update (5thNight)
Script Error embedded script: could not convert string to float:
Script Error Exception Traceback (most recent call shown last):

embedded script, line 3, at top level
ValueError: could not convert string to float:

Error failed to evaluate embedded script conditonal
Error embedded script: could not convert string to float:
theTemperatureV = indigo.variables[1708239780] #MinTemperatureVariable
dev = indigo.devices[23142400] #Weather Plus Station
if float(dev.states['minTemp6thNight']) < theTemperatureV.value:
return True
else:
return False
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: NOAA Weather Plus discussions

Post by FlyingDiver »

What are the actual states of the device when you get the error? You can show them in the Indigo UI by dragging the dimple up.
Attachments
Screen Shot 2020-05-10 at 10.17.46 AM.png
Screen Shot 2020-05-10 at 10.17.46 AM.png (80.22 KiB) Viewed 5290 times
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
indigobo
Posts: 22
Joined: Fri Jan 04, 2019 11:45 am
Location: Raleigh, NC

Re: NOAA Weather Plus discussions

Post by indigobo »

I'm now getting these error messages too :(
Unknown error getting weather for coordinates 36.149, -78.198: <urlopen error [SSL: TLSV1_ALERT_PROTOCOL_VERSION]
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: NOAA Weather Plus discussions

Post by FlyingDiver »

indigobo wrote:I'm now getting these error messages too :(
Unknown error getting weather for coordinates 36.149, -78.198: <urlopen error [SSL: TLSV1_ALERT_PROTOCOL_VERSION]
Are you on an older OS (pre-High Sierra) as well? If so, that's expected. Now.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
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) »

Jay (Indigo Support)
Twitter | Facebook | LinkedIn
dherren
Posts: 36
Joined: Wed Nov 26, 2003 9:51 am
Location: Shoreham, VT USA

Re: NOAA Weather Plus discussions

Post by dherren »

I started getting these error messages late in the day on Jan. 21st. While I am running on Sierra and not High Sierra, I find it curious that the same version of the plug-in on the same Mac mini had been running just fine until Jan 21, and no changes were made to any of my configuration.

Update: I just read the thread regarding OS level support for TSL and NOW. I get it. I had dreaded an OS upgrade on my late 2012 mini, but the writing is on the wall.
Last edited by dherren on Wed Jan 27, 2021 7:43 pm, edited 1 time in total.
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: NOAA Weather Plus discussions

Post by FlyingDiver »

dherren wrote:I started getting these error messages late in the day on Jan. 21st. While I am running on Sierra and not High Sierra, I find it curious that the same version of the plug-in on the same Mac mini had been running just fine until Jan 21, and no changes were made to any of my configuration.
The change was made server-side (at NOAA) to require the newer version of SSL/TLS. This is totally the expected behavior.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
Post Reply

Return to “Nathan Sheldon Software”