Author |
|
krommetje Super User
Joined: December 29 2004 Location: Netherlands
Online Status: Offline Posts: 695
|
Posted: December 02 2005 at 06:33 | IP Logged
|
|
|
No problem, I added
Code:
ph_setglobal_s("HUMID STR", mid("{HUMID STR}",1,2)) |
|
|
at the end of your Macro Get Weather A
which removes the %</ and leaves the rest..
Now I can convert a few calculations into formulas for PH and then I can connect the hardware to my Central Heating.
I still keep my thermostat but some X10 hardware will be added as an addition which influences the Central Heating System to a more comforable environment in my house...
Peter
|
Back to Top |
|
|
dougw246 Newbie
Joined: December 14 2005 Location: United States
Online Status: Offline Posts: 2
|
Posted: December 14 2005 at 22:16 | IP Logged
|
|
|
I recently purchased a copy of PowerHome and have all the basics up and running. I was trying to play with the weather macro mentioned, but everytime I paste it into the Direct SQL window and click Do It I get an error. The error is:
Invalid SQL Code -207
SQLSTATE = 21S01
[Sybase][ODBC Driver][Adaptive Server Anywhere]Insert value list does not match column list: Wrong number of values for INSERT
I am running the system on Windows 2000 Server. Any ideas of what I am doing wrong.
Thanks
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: December 15 2005 at 07:14 | IP Logged
|
|
|
Did you first create the global variables used in the macro?
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: December 15 2005 at 18:29 | IP Logged
|
|
|
Doug,
Which version are you running? This thread has numerous statements for the get weather and spans at least a couple of different versions of PowerHome (which most likely has different columns so SQL for one version of PH sometimes wont work for another version of PH).
Based upon the error message above, I would say this is a good guess as to the problem. Most of the SQL is in the form of INSERT INTO MACRODETAIL VALUES (... and then has a comma separated list of values. In this form of SQL syntax, the actual number of inserted values needs to match the number of columns in the table.
Let us know the version you're using and Im sure I can get a version of the getweather macro posted for you that will work.
Dave.
|
Back to Top |
|
|
dougw246 Newbie
Joined: December 14 2005 Location: United States
Online Status: Offline Posts: 2
|
Posted: December 18 2005 at 13:22 | IP Logged
|
|
|
Dave and Tony,
Thanks for the replies.
Tony, I set up in Global Variables LOCAL1 - LOCAL7 and put an intitial value of 1 - 7 in.
Dave, I tried various versions of the macros in the post. They all gave the same error, so I just stuck with the last version posted on page 4. I am using PH version 1.03.4 with database version 1.03.2. Hopefully I set it up correctly when I downloaded it.
Thanks for the help.
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: December 19 2005 at 21:21 | IP Logged
|
|
|
Doug,
You may want to upgrade to the current beta version 1.03.4.4. That should eliminate the errors on importing the macro. I believe the main things that changed is that the macroheader is quite a bit different due to Control Center changes and the macrodetail has an additional field which allows you to selectively cause lines to be skipped during execution.
A lot of people are wary of beta software but let me assure you that the current beta is actually more stable than the release 1.03.4. The main reason Ive labeled the software as beta is that I havent taken the time to update the manual to match the new software features. Generally, the newer features are not so radical that they cant be figured out with the help of the existing documentation. Perhaps someone else can comment on this as well.
There will be at least a couple of more beta's before I sit down and completely rewrite the manual to match and have a release version. In the meantime, there are a lot of new features that you may find useful in the beta.
Let me know if you have any questions and if there is anything I can help you with.
Dave.
|
Back to Top |
|
|
Dean Senior Member
Joined: August 21 2003 Location: United States
Online Status: Offline Posts: 109
|
Posted: October 29 2006 at 10:18 | IP Logged
|
|
|
Tony or Dave:
I just tried to insert the weather macro (excerpt shown below) into PowerHome 1.03.4.9 Beta. I pasted this into the Multi-Editor, selected SQL, and tried to execute it and received the following error:
Invalid Direct SQL Code -193
SQLSTATE = 23000
[Sybase][ODBC Driver][Adaptive Server Anywhere]Integrity constraint violation: Primary key for table 'macroheader' is not unique
I'm not sure if I am doing something wrong (probably am) or if the get weather macro needs to be changed for the latest PowerHome beta.
Could someone lend me some help to get this macro entered into PowerHome?
Thanks,
-Dean
TonyNo wrote:
insert into macroheader values ('GET WEATHER','GET WEATHER',0,1,1);
insert into macrodetail values ('GET WEATHER',1,16,'',NULL,'if( {INTERNET FLAG}=0, 999, 1)',0);
insert into macrodetail values ('GET WEATHER',2,15,'[LOCAL1]',NULL,'mid( ph_geturl( "www.wunderground.com/cgi-bin/findweather/getForecast?query= 90210"), 20000, 30000)',0);
.
.
.
|
|
|
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: October 30 2006 at 07:08 | IP Logged
|
|
|
It looks like you already have a macro named "GET WEATHER". If so, rename or delete the existing one.
|
Back to Top |
|
|
Dean Senior Member
Joined: August 21 2003 Location: United States
Online Status: Offline Posts: 109
|
Posted: October 30 2006 at 22:55 | IP Logged
|
|
|
Tony, I don't recall if I had a GET WEATHER macro already. The GET WEATHER that shows up after I tried to run the import doesn't have anything in it. I deleted it (is it just me, or is deleting a macro difficult-I right click and delete it but then it shows up again if you click on Macros in PH Explorer).
Now I am getting this error:
Invalid Direct SQL Code -207
SQLSTATE = 21S01
[Sybase][ODBC Driver][Adaptive Server Anywhere]Insert value list does not match column list: Wrong number of values for INSERT
My guess is something is slightly different with the 1.03.4.9 version of PowerHome causing the import to fail, but I could be wrong.
-Dean
|
Back to Top |
|
|