Weather script

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
sundodger
Member
Posts: 80
Joined: Thu Sep 11, 2008 11:17 am

Weather script

Post by sundodger »

Hi all, i am trying to use the yahoo weather script. have changed the CWZipCode to EIXX0006 and CWUnits to c on the device property page.
when the script is run i get the Error unable to find device with the description [] and no properties update.
What have i missed?
Thanks Mark....
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Re: Weather script

Post by Osler »

Hmm...let me take a look at this.

Osler
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Re: Weather script

Post by Osler »

For some reason it isn't happy with the name you've given the device. It shouldn't matter based upon how I coded it...but apparently it does. For now, change the device name back to CurrentWeather and then restart HouseBot and it will work. I will have to look at the code a bit more closely to see if I can't tease out the detail I appear to have missed.

Osler
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Re: Weather script

Post by Osler »

Found the issue. Use the attached script and the device name will not matter. There was still a reference to the device name in the script (from when HB required this) for pulling the zip code and unit format. Put this in C:\Program Files\HouseBot\Config\Scripts.

Sorry for the inconvenience.

Osler
Attachments
YahooWeather.zip
(1.86 KiB) Downloaded 189 times
sundodger
Member
Posts: 80
Joined: Thu Sep 11, 2008 11:17 am

Re: Weather script

Post by sundodger »

the device is named CurrentWeather and i have tried the new script same error.
p.s no need for apologies. i am the one making use of your hard work :D
Mark...
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Re: Weather script

Post by Osler »

So you:

1) Imported the .hbx file
2) verified that you have a CurrentWeather Script Device populated with the appropriate properties
3) point the device to the correct script
4) change the device state to run

Despite all of this you are getting the error?

After the changes I made to the script I can't reproduce the error here anymore, no matter if I change the device name, zip code, or unit type in between script runs.

Can you do me a favor and delete the script device that was imported and build one from scratch. All of the correct properties should have been populated in HB already? It is just a matter of creating a script device and adding all of the CW properties to it.

Osler
sundodger
Member
Posts: 80
Joined: Thu Sep 11, 2008 11:17 am

Re: Weather script

Post by sundodger »

Its official housebot hates me.
Created from scratch and added all the elements. pointed to the script. filled in the zip code (yahoo code for Castlebar) and the units (c)
ran the script same error.
on the off chance is it the fact that the zip code is in fact not a zip code (we dont have them in ireland) and it is flipping yahoo out.
i use the code from http://uk.weather.yahoo.com/EIXX/EIXX0006/index_c.html
wish i knew how to write script.....
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Re: Weather script

Post by Osler »

No, it's not your zip. I was able to pull your weather data just fine from my machine.

Let's try this version. In this version, all calls to HB explicitly state the device and the property (the other script left it up to HB to figure out that the device was the one running the script).

Make sure the device is called CurrentWeather and point it to this script.

What version of HB are you running?

Osler
Attachments
YahooWeather_Revised.zip
(1.88 KiB) Downloaded 185 times
sundodger
Member
Posts: 80
Joined: Thu Sep 11, 2008 11:17 am

Re: Weather script

Post by sundodger »

Well housebot may still hate me but it loves osler.
That worked no problem.
Many Thanks.
in case it matters i am running 3.2
back to the tweaking... :wink:
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Re: Weather script

Post by Osler »

I would call this to Scott's attention. With your version of HB you shouldn't have to explicitly state the device when getting and setting property values from within the script if it is only referencing properties contained within that script device.

Osler
Post Reply