Page 1 of 1
Weather script
Posted: Fri Oct 17, 2008 5:06 pm
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....
Re: Weather script
Posted: Fri Oct 17, 2008 8:59 pm
by Osler
Hmm...let me take a look at this.
Osler
Re: Weather script
Posted: Fri Oct 17, 2008 9:04 pm
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
Re: Weather script
Posted: Fri Oct 17, 2008 9:54 pm
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
Re: Weather script
Posted: Sat Oct 18, 2008 5:24 am
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
Mark...
Re: Weather script
Posted: Sat Oct 18, 2008 11:11 am
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
Re: Weather script
Posted: Sat Oct 18, 2008 1:08 pm
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.....
Re: Weather script
Posted: Sat Oct 18, 2008 4:20 pm
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
Re: Weather script
Posted: Sat Oct 18, 2008 4:41 pm
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...
Re: Weather script
Posted: Sat Oct 18, 2008 6:15 pm
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