Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome General
 PowerHome Messageboard : PowerHome General
Subject Topic: Weather Station Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
phcjpp
Newbie
Newbie
Avatar

Joined: April 21 2010
Location: United Kingdom
Online Status: Offline
Posts: 3
Posted: April 21 2010 at 09:10 | IP Logged Quote phcjpp

Hi,

Does PH integrate with any of the hardware weather stations ? E.g Vantage pro ?

Thanks
Chris


Edited by phcjpp - April 21 2010 at 09:11
Back to Top View phcjpp's Profile Search for other posts by phcjpp Visit phcjpp's Homepage
 
spou
Newbie
Newbie


Joined: July 28 2007
Location: Canada
Online Status: Offline
Posts: 33
Posted: April 22 2010 at 20:01 | IP Logged Quote spou

I have an Oregon Scientific WMR968. All alone, it can not do a lot, besides that is has a RS232 port.

From there, I found a free software that reads the data from the console, and along with not-so-great-display, create a CSV file, that I import into PowerHome each minute using a vbscript of mine.

From there, I can do a lot, like detect rain, and warn me that I should close the windows. I also create a nice text file that I have PH read out (using TTS) when we wake up (this one gave me very high WAF), and other related things.

Given the fact that new HA devices are getting on the market on high frequency, I dont thing that Dave really have the time for our weather stations. The best is definitely to take it from where PH stops, and give it a small hand.
Back to Top View spou's Profile Search for other posts by spou
 
patrickm
Senior Member
Senior Member


Joined: February 22 2007
Location: United States
Online Status: Offline
Posts: 188
Posted: April 23 2010 at 12:52 | IP Logged Quote patrickm

I have a Davis Vantage Pro and I am using the Envoy RF receiver to connect to the PC using Virtual Weather Station.

I use it a couple of ways. VWS generates CSVs and will process html tags. The tags make it pretty easy to pull specific parameters into a file but there parameters that are only in the CSV file so I use both methods. I just use ph_regexsnap in macros to pull the data into variables.
Back to Top View patrickm's Profile Search for other posts by patrickm
 
phcjpp
Newbie
Newbie
Avatar

Joined: April 21 2010
Location: United Kingdom
Online Status: Offline
Posts: 3
Posted: April 23 2010 at 14:57 | IP Logged Quote phcjpp

Thanks guys - I think I will go with the Davis option.

Cheers
Chris
Back to Top View phcjpp's Profile Search for other posts by phcjpp Visit phcjpp's Homepage
 
syonker
Senior Member
Senior Member
Avatar

Joined: March 06 2009
Location: United States
Online Status: Offline
Posts: 212
Posted: October 09 2010 at 14:50 | IP Logged Quote syonker

Spou - Can you point me to the free software that reads the console and produces a CSV (is it Virtual Weather Station)? Any details (scripts, macros, etc.) would be helpful...what's TTS...?

Regards,

-S

__________________
"I will consider myself having succeeded when my house becomes sentient and attempts to kill me."

><(((º>`·.¸¸.·´¯`·.¸><(((º>¸.

·´¯`·.¸. , . ><(((º>`·.¸¸.·´¯`·.¸><(((º>
Back to Top View syonker's Profile Search for other posts by syonker Visit syonker's Homepage
 
patrickm
Senior Member
Senior Member


Joined: February 22 2007
Location: United States
Online Status: Offline
Posts: 188
Posted: October 09 2010 at 15:10 | IP Logged Quote patrickm

Virtual Weather Station generates CSV files. I have some macros that read them if you want.
Back to Top View patrickm's Profile Search for other posts by patrickm
 
syonker
Senior Member
Senior Member
Avatar

Joined: March 06 2009
Location: United States
Online Status: Offline
Posts: 212
Posted: October 09 2010 at 15:23 | IP Logged Quote syonker

I would LOVE those macros! :)

__________________
"I will consider myself having succeeded when my house becomes sentient and attempts to kill me."

><(((º>`·.¸¸.·´¯`·.¸><(((º>¸.

·´¯`·.¸. , . ><(((º>`·.¸¸.·´¯`·.¸><(((º>
Back to Top View syonker's Profile Search for other posts by syonker Visit syonker's Homepage
 
syonker
Senior Member
Senior Member
Avatar

Joined: March 06 2009
Location: United States
Online Status: Offline
Posts: 212
Posted: October 09 2010 at 15:44 | IP Logged Quote syonker

Is it based on something like this, by any chance...?

sub ImportCSV()
'
Const ForReading = 1
dim DataArray
dim strROMId
dim strName
dim dblValue
dim dteLastReadingDate
dim dteLastReadingTime
dim strAvg
dim strMin24H
dim strMax24H
dim strDateFormat
dim strTimeFormat
dim retour
dim SourceFile
dim TextFile
dim intDay
dim intPosition
'
'set filename to read
FileToRead = ph.getglobal_s("TEMP_CSV_FILE")
'
'
'file format:
'"ROMId","Name","Value","dd.mm.yyyy","hh:nn:ss","Avg","MinH2 4","MaxH24",
'"46000000274F1910","atelier",19.56,14.08.2007,23:25:45,19.4 9,18.62,20.95,
'"DA00000015EEDF10","bureau",20.45,14.08.2007,23:25:47,20.31 ,18.18,22.56,
'"FE00080031602E10","chambre",21.19,14.08.2007,23:25:44,20.9 0,20.25,22.38,
'"2800000015FA6610","test",20.73,14.08.2007,23:25:43,20.26,1 8.29,22.17,
'"45000800311CD910","test2",21.31,14.08.2007,23:25:46,21.23, 20.50,22.81,
'------------------------------------------
'
'msgbox "1"
Set SourceFile = CreateObject("Scripting.FileSystemObject")
If not SourceFile.FileExists(FileToRead) Then
' msgbox "CSV File not found!"
exit sub
end if
Set TextFile = SourceFile.OpenTextFile(FileToRead, ForReading)
'
Do While Not TextFile.AtEndOfStream
redim DataArray(0)
TextLine = TextFile.ReadLine 'Read a dataline from SourceFile
'
if instr(textLine,"ROMId")<>0 then 'we will get the date and time format from the first line
DataArray=split(TextLine,",")
strDateFormat=ucase(dataArray(3))
strTimeFormat=ucase(DataArray(4))
end if
if instr(TextLine,"ROMId")= 0 then 'this line contains data
DataArray=split(TextLine,",")
'using the split command, we now have DataArray containg 4 cells (0..3)
'cells that we will transfer into separated variables (not absolutly needed, but might come handy
'for educational purpose)
strROMId = DataArray(0)
strROMId = replace(strROMId,"""","") 'remove doublequote
strName = DataArray(1)
strName = replace(strName,"""","") ' remove doublequote
dblValue = cdbl(DataArray(2))
dteLastReadingDate = DataArray(3)
dteLastReadingDate = replace(dteLastReadingDate,".","/")
dteLastReadingTime = DataArray(4)
strAvg=cstr(DataArray(5))
strMin24H=cstr(DataArray(6))
strMax24H=cstr(DataArray(7))
'
'transfer data from the script to powerhouse
'
'standard naming will be as follow:
'"temp_" followed by the strName value (ex: temp_office)
'that global variable will be of type double and containt the last temperature read
'
'there will be a temp_[strName]_time of type time
'and a temp_[strName]_date of type date
strGlobalId=ucase("TEMP_" & strName)
retour = ph.setglobal_a ( strGlobalId ,cdbl(dblValue ))
retour = ph.setglobal_s ("TEMP_CSV_LAST_DATE", dteLastReadingDate)
retour = ph.setglobal_s ("TEMP_CSV_LAST_TIME", dteLastReadingTime)
'we could also transfer min/max and average, but I have no use for it..yet!
end if
loop
TextFile.Close
end sub

Edited by syonker - October 09 2010 at 15:45


__________________
"I will consider myself having succeeded when my house becomes sentient and attempts to kill me."

><(((º>`·.¸¸.·´¯`·.¸><(((º>¸.

·´¯`·.¸. , . ><(((º>`·.¸¸.·´¯`·.¸><(((º>
Back to Top View syonker's Profile Search for other posts by syonker Visit syonker's Homepage
 
patrickm
Senior Member
Senior Member


Joined: February 22 2007
Location: United States
Online Status: Offline
Posts: 188
Posted: October 09 2010 at 18:49 | IP Logged Quote patrickm

I have been thinking about trying VBS and the plugin SDK for getting a variety of external data into Powerhome. A seperate execution thread would probably help things.

Virtual Weather Station generates several CSV files. There is a file, data.csv, that is generated once a minute. This simple macro that reads that file into some global variables.


insert into macroheader values ('VWS_READ','VWS READ',0,0,1);
insert into macrodetail values ('VWS_READ',1,15,'[LOCAL1]',NULL,'ph_readfile("{VWS_PATH}")',0,'');
insert into macrodetail values ('VWS_READ',2,10,'VWS_WINDSPEED',NULL,'ph_regexsnap("[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,\([0-9\.]*\),","[LOCAL1]",1,0)',0,'');
insert into macrodetail values ('VWS_READ',3,10,'VWS_WINDGUST',NULL,'ph_regexsnap("[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,\([0-9\.]*\),","[LOCAL1]",1,0)',0,'');
insert into macrodetail values ('VWS_READ',4,10,'VWS_WINDDIR',NULL,'ph_regexsnap("[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,\([0-9\.]*\),","[LOCAL1]",1,0)',0,'');
insert into macrodetail values ('VWS_READ',5,10,'VWS_OUTHUMID',NULL,'ph_regexsnap("[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,\([0-9\.]*\),","[LOCAL1]",1,0)',0,'');
insert into macrodetail values ('VWS_READ',6,10,'VWS_OUTTEMP',NULL,'ph_regexsnap("[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,\([0-9\.]*\),","[LOCAL1]",1,0)',0,'');
insert into macrodetail values ('VWS_READ',7,10,'VWS_WINDCHILL',NULL,'ph_regexsnap("[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,\([0-9\.]*\),","[LOCAL1]",1,0)',0,'');
insert into macrodetail values ('VWS_READ',8,10,'VWS_HOURLYRAIN',NULL,'ph_regexsnap("[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,\([0-9\.]*\),","[LOCAL1]",1,0)',0,'');
insert into macrodetail values ('VWS_READ',9,10,'VWS_DAILYRAIN',NULL,'ph_regexsnap("[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,[0-9\.]*,\([0-9\.]*\),","[LOCAL1]",1,0)',0,'');


-Patrick
Back to Top View patrickm's Profile Search for other posts by patrickm
 
syonker
Senior Member
Senior Member
Avatar

Joined: March 06 2009
Location: United States
Online Status: Offline
Posts: 212
Posted: October 09 2010 at 20:52 | IP Logged Quote syonker

Patrick - That is WONDERFUL! I can use this to directly build a "needs-based" lawn-watering algorithm. How AWESOME! I cannot thank you enough!

-S

__________________
"I will consider myself having succeeded when my house becomes sentient and attempts to kill me."

><(((º>`·.¸¸.·´¯`·.¸><(((º>¸.

·´¯`·.¸. , . ><(((º>`·.¸¸.·´¯`·.¸><(((º>
Back to Top View syonker's Profile Search for other posts by syonker Visit syonker's Homepage
 
patrickm
Senior Member
Senior Member


Joined: February 22 2007
Location: United States
Online Status: Offline
Posts: 188
Posted: October 10 2010 at 12:50 | IP Logged Quote patrickm

I have been doing that for a long time. My macros are in this thread.

http://www.myx10.com/forum/forum_posts.asp?TID=2638&PN=1
Back to Top View patrickm's Profile Search for other posts by patrickm
 
syonker
Senior Member
Senior Member
Avatar

Joined: March 06 2009
Location: United States
Online Status: Offline
Posts: 212
Posted: October 10 2010 at 12:55 | IP Logged Quote syonker

Do you happen to know if there's a limit to the number of delimiters you can snap with ph_regexsnap? I'm trying to get the "Inside Temp" which I *think* is in the 29th position (modifying a line from the above macro). I can get the data point in the 28th position, but anything after that comes back blank...

-S

__________________
"I will consider myself having succeeded when my house becomes sentient and attempts to kill me."

><(((º>`·.¸¸.·´¯`·.¸><(((º>¸.

·´¯`·.¸. , . ><(((º>`·.¸¸.·´¯`·.¸><(((º>
Back to Top View syonker's Profile Search for other posts by syonker Visit syonker's Homepage
 
patrickm
Senior Member
Senior Member


Joined: February 22 2007
Location: United States
Online Status: Offline
Posts: 188
Posted: October 10 2010 at 13:04 | IP Logged Quote patrickm

I did find out recently that you cannot have more than 1024 characters in one formula.

I think you should be fine 29 * 9 = 261 characters
Back to Top View patrickm's Profile Search for other posts by patrickm
 
syonker
Senior Member
Senior Member
Avatar

Joined: March 06 2009
Location: United States
Online Status: Offline
Posts: 212
Posted: October 10 2010 at 13:09 | IP Logged Quote syonker

I added a minus (-) as an acceptable character (temps, wind chills, etc.). Here is my formula:

ph_regexsnap("[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,[0-9\.\-]*,\([0-9\.\-]*\),","[LOCAL1]",1,0)

-And it returns nothing. If I remove one of the parse groups, I get the 28th variable in the CSV, but this and anything after return blank. Any ideas?

Regards,

-S

__________________
"I will consider myself having succeeded when my house becomes sentient and attempts to kill me."

><(((º>`·.¸¸.·´¯`·.¸><(((º>¸.

·´¯`·.¸. , . ><(((º>`·.¸¸.·´¯`·.¸><(((º>
Back to Top View syonker's Profile Search for other posts by syonker Visit syonker's Homepage
 
patrickm
Senior Member
Senior Member


Joined: February 22 2007
Location: United States
Online Status: Offline
Posts: 188
Posted: October 10 2010 at 13:13 | IP Logged Quote patrickm

I just looked at the VWS manual (06/19/09) and the inside temp is in the 13th position. Wind Chill is the 29th position. Indoor Heat Index in 30.
Back to Top View patrickm's Profile Search for other posts by patrickm
 
syonker
Senior Member
Senior Member
Avatar

Joined: March 06 2009
Location: United States
Online Status: Offline
Posts: 212
Posted: October 10 2010 at 13:17 | IP Logged Quote syonker

Aha! YOU ARE AGAIN A LIFE SAVER! What I need for this exercise is the Inside Temp.

I guess I would be curious if anyone has found whether snapping from far-right positions has been an issue, but beyond that, I think my problem is solved. Thank you SO SO SO MUCH!.....again!

Regards,

-S

__________________
"I will consider myself having succeeded when my house becomes sentient and attempts to kill me."

><(((º>`·.¸¸.·´¯`·.¸><(((º>¸.

·´¯`·.¸. , . ><(((º>`·.¸¸.·´¯`·.¸><(((º>
Back to Top View syonker's Profile Search for other posts by syonker Visit syonker's Homepage
 
patrickm
Senior Member
Senior Member


Joined: February 22 2007
Location: United States
Online Status: Offline
Posts: 188
Posted: October 10 2010 at 13:18 | IP Logged Quote patrickm

I will try to get some data past the 28th column right now.
Back to Top View patrickm's Profile Search for other posts by patrickm
 
patrickm
Senior Member
Senior Member


Joined: February 22 2007
Location: United States
Online Status: Offline
Posts: 188
Posted: October 10 2010 at 13:37 | IP Logged Quote patrickm

I just confirmed the formula does not work past 28 positions.
Back to Top View patrickm's Profile Search for other posts by patrickm
 
syonker
Senior Member
Senior Member
Avatar

Joined: March 06 2009
Location: United States
Online Status: Offline
Posts: 212
Posted: October 10 2010 at 13:40 | IP Logged Quote syonker

Well, that's certainly good to know for the future...seems like VBScript is the most viable option in that case.

__________________
"I will consider myself having succeeded when my house becomes sentient and attempts to kill me."

><(((º>`·.¸¸.·´¯`·.¸><(((º>¸.

·´¯`·.¸. , . ><(((º>`·.¸¸.·´¯`·.¸><(((º>
Back to Top View syonker's Profile Search for other posts by syonker Visit syonker's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: October 10 2010 at 15:10 | IP Logged Quote dhoward

Hmmm...I checked into the ph_regexsnap function and the 29 position problem and it appears that its a limitation of the regular expression search of the Scintilla control (what PowerHome uses to perform regular expression searches). I was thinking it may have something to do with the length of the regular expression search pattern but even with shortening it, it still does not seem to go beyond a certain point. At this point, I dont think this is fixable because of the external control doint the regular expression searching.

However, always more than 1 way to skin the cat . Looking at what was trying to be accomplished, I immediately thought of the ph_regexsnap1 function. My version looks like:
Code:
ph_regexsnap1(",\([^,]*\),","\1","[LOCAL1]",1,29,0,0,0)

Much simpler if I say so myself. This code searches for the a comma, snaps the block of text that does not contain a comma, followed by a comma. The 29 in the formula says to snap the 29th occurrence of this particular pattern...no length problems of any sort using this logic. Alas, there is a bug in the ph_regexsnap1 function where the occurrence value seems to be skipping (Im working on fixing this now). So in theory, this would be great...it just doesnt work until I correct the bug.

But...we also have access to the ph_regexdiff1 function. My code using this function looks like this:
Code:
ph_regexdiff1(",",",","[LOCAL1]",1,29,0,0,0)

Wow..even simpler. This also has the added benefit of actually working . This just uses two search strings and returns the data in between them and also returns the 29th occurrence.

But...hold on, were not through yet. PowerHome provides a function designed to work with comma (or tab, or etc.) separated values. The ph_parseline function. The equivlant code (and it also works) looks like:
Code:
ph_parseline("[LOCAL1]",",",29)

Tailor made for just this type of data .

Hope this helps.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 

Page of 2 Next >>
  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum