: Script to start the Volt
I've hacked together a small script to emulate the OnStar's remote start feature. The big advantage this has to what OnStar offers is that this can be configured (via Windows "Scheduled Tasks" feature) to run automatically at a set schedule. Because that was my intended purpose, it (intentionally) produces no visual output or feedback as it runs - though it does create a number of logs and debug files for troubleshooting in the future when OnStar changes things and/or it fails to run.
I am very hesitant to release this, as I have only used it myself a small handful of times. I'm only doing the same thing the web page currently does, but I'd imagine that should OnStar revise their website at some point in the near future, this will stop working, and who knows what sort of issues it would be creating on their end at that point... that being said, I'm very disappointed at the number of true "hacks" I've seen for the Volt so far. I used to have a Prius, and people were constantly taring it apart to find different ways to "enhance" functions. Perhaps this will be a ever-so-slight kickstart to some of those ideas for the Volt.
I don't claim this will work for you, and I certainly don't recommend using it. It just seems like a bad idea - starting your car on a set schedule potentially without you being aware, around, or even in the same state you were when you scheduled it to run. I provide no support for this, it's not official in any way, it's not pretty or well documented, and I don't even know what half of this data going back and forth is (though perhaps I could take a guess at some of it...)
This is provided as a learning aid only - not for use. I take no responsibility for what happens with it, to it, or to your car, health, or welfare. I only ask that should you improve upon this idea, you share your work as well (at least with me!)
The below file would be a VBScript file (with a .vbs extension) if it were a program. It would also require slight modification to personalize it to your account and environment.
Update: Version 3
Now supports Canadian owners and multiple Volt's on the same account!
Credit goes to Destinet for the Canadian weather additions and all the assistance in getting 2 Volts on the same account tested!
7968
Version 2
Now supports preconditioning based on:
Current outdoor temp ranges
Charging on 120v, 240v, or not plugged in at all
Only when fully charged
Ohm
Driverguy01 11-13-2011, 02:37 PM Can you change the script to add a hold option to the MM button......id like that!
AySz88 11-13-2011, 05:00 PM Can you change the script to add a hold option to the MM button......id like that!
It's not that sort of script... :p It's basically going on the myvolt.com website and hitting the "remote start" button for you.
eplantz 11-13-2011, 08:03 PM I just tried this on my Windows 7 virtual machine. Worked like a champ!! Thanks for doing the work. I was just thinking about this today before I saw your message.
Ron C 11-13-2011, 10:21 PM Thanks Ohm - I'm going to use the essence of this in an iPhone app to do all of the timing of the double-remote-start-while-plugged-in dance. (Oh, I sent you a PM).
When I start looking for beta testers, I'll post in this thread (http://gm-volt.com/forum/showthread.php?9579-Smartphone-app-ideas).
Update: Version 2
Now supports preconditioning based on:
Current outdoor temp ranges
Charging on 120v, 240v, or not plugged in at all
Only when fully charged
I'm going to use the essence of this in an iPhone app to do all of the timing of the double-remote-start-while-plugged-in dance.
Sounds great! Please send me 10% of your pre-tax earnings. :)
Brittt1 01-02-2012, 07:29 PM I just set up this script with the Windows Task Scheduler and tested a few times with different Variables. All works very well. Thanks for putting this together.. Now who is putting together the iPhone App? Id like to schedule auto charging etc too.
Prius2Volt 01-02-2012, 07:38 PM hmm, i could turn this into a compiled task bar program...
Just a quick note to say if there were any changes to the onstar site after their update : the script still works.
-------------
I have never used C_url and was not sure if I needed the SSL version but I did get and try it.
curl_724_0_ssl.zip
and
libssl.zip which has libeay32.dll and ssleay32.dll needed for the SSL version of C-url
all in the Curl folder.
I run Win-7 64 - not sure of any advantages to the 64 bit -Curl build.
-------------
Thanks for posting the script
eplantz 03-12-2012, 03:00 PM I've hacked together a small script to emulate the OnStar's remote start feature.
any idea why the temp thing is not working??? Seems to have picked up the current temp and properly displays my preferred lower and upper limits
http://www.weather.gov/xml/current_obs/KMDW.xml -o "C:\curl\Current_Weather.xml"
Temp within range for preconditioning: current temp (65.0) lower than 60 or higher than 85
Indeed you're correct. It was a bug I missed due to the cold winter temps combined with VBScript's implicit conversion process. I've corrected the error and updated the attachment in the first post.
Thanks for the note!
eplantz 03-15-2012, 09:39 AM can you take a look again at the temp script. still does not seem to be working.
"c:\curl\curl.exe" -s --insecure -b "C:\curl\Cookies.txt" -c "C:\curl\Cookies.txt" -q http://www.weather.gov/xml/current_obs/KORD.xml -o "C:\curl\Current_Weather.xml"
Temp within range for preconditioning: current temp (63.0) lower than 60 or higher than 85
Brittt1 03-15-2012, 09:53 AM James sent me an update on the original file modify the following:
A quick round statement before the "If temp >" seems to fix it.
Insert on a new line above the "If temp >":
temp = round(temp)
black88mx6 03-15-2012, 10:09 AM The round fix has been working good for me this last week.
I'm pretty sure my logic in that area was just all around wrong. I've revised the overall logic, as well as incorporated the round function. Based on my (latest) tests, the round isn't needed - but I figure it can't hurt. I'm pretty sure it would do the same thing as the IsNumeric() change I put in yesterday to force it to compare as a numeric value.
Version 2.2 now updated in first post.
HOUSTONVOLTAGE 03-16-2012, 02:48 PM I needed the right curl version plus some libraries:
http://www.paehl.com/open_source/?download=curl_724_0_ssh2_ssl_sspi.zip
http://www.paehl.com/open_source/?download=libssl.zip
NOTE: All you need is the right "curl.exe" - YOU DO NOT NEED TO DO ANY COMPLEX INSTALLATION!!! JUST THE CURL.EXE in a folder!!!
I put the library and curl.exe in the same folder: C:\curl
NOTE: THIS IS ALL YOU NEED!!! (Plus the script of course)
Notes on ID and password and PIN: I had forgotten that the phone app uses that 4-digit PIN and was trying to use my password twice. The ID is your onstar ID, the password is the password for the Onstar website, and the PIN is the 4-digit number you use on the phone app. At least this is how I remember it.
Notes on using the script - I got confused on what "True" and "False" means for the various prompts. Here are some notes (I do better when I ignore the text in the script after the setting so I dont show it below):
Run_when_unplugged = False
>If this is set to True, it will start the car even if the car is unplugged. If it's set to False, it will only start if it's plugged in.
Run_on_120 = True
>If this is set to True, it will start the car if it's plugged in using the 120v charger. If it's set to False, it won't start if plugged into 120v
Run_on_240 = True
>If this is set to True, it will start the car if it's plugged in using the 240v charger. If it's set to False, it won't start if plugged into 240v
Run_only_when_fully_charged = True
>If this is set to True, it will only start the car IF it's at a 100% charged level. If it's only 99% charged, the car will not start. If you set it to False, it will start the car no matter how low the battery is.
I don't use the script to start my car on a schedule. I use it to start the car instead of the phone app. I get annoyed waiting on my phone to communicate with Onstar, connect to the car, waiting waiting waiting.... With this script you can just double-click it on the computer and your car starts! Awesome!
With some additional work and setting the onstar charging mode back and forth from Immediate-- do you think we could have computer control of the Volts charging times ?
There are times when designing a control system it seems the basic back yard water sprinkler controller has a lot to offer.
With some additional work and setting the onstar charging mode back and forth from Immediate-- do you think we could have computer control of the Volts charging times ?
All I can really do at this point is emulate existing website functionality. It looks like the functionality is there to modify the charging schedule on the fly... Perhaps we could set it to Immediate to initiate charging, then set it to a Delayed Start based on departure time, then give it a time far in the future when we want it to stop? Seems like that might work.
Unfortunately, I'm not living in an area where time-of-day rates are in effect, so I see no benefit from doing this myself. If you give me specific wants/needs around how you'd like it to work though, I could give it a shot.
eplantz 07-05-2012, 01:01 PM It looks like the Weather Service has changed their website and the script is no longer picking up the current temp. When you have a chance, can you look at it and see if it can be fixed.
Thanks
Gene
astrand1 07-05-2012, 04:17 PM So I guess I have to be the one to ask. Is there a way for this to work on a mac? for those of us who can't stand the dreaded windows operating system? lol
eplantz 07-06-2012, 03:32 PM it looks like a simple change to the script makes it works again
EDIT the script.... find the line beginning with weather_url and make it look like this:
weather_url = "http://w1.weather.gov/xml/current_obs/" & Weather_Station & ".xml"
I use bootcamp on my 2011 mac-mini and Windows 7 - I'll see if that works.
eplantz 07-06-2012, 10:13 PM I use bootcamp on my 2011 mac-mini and Windows 7 - I'll see if that works.
I use Parallels to run Windows 7 on my iMacs. The script runs fine that way.
The weather part of the script and more option in setting charging times for power rates would make a good computer app or smartphone app.
I have though about getting back into the Apple Developer program. Just hope Absoft Pro Fortran is still around ;-)
I've been trying to get this to work but haven't been able to locate a curl.exe executable. I'm not sure how to compile the source code. I'm a Mac user too and it'd be great to be able to run this natively on OS X, or even better as an Iphone/Droid app.
eplantz 07-07-2012, 06:14 PM I've been trying to get this to work but haven't been able to locate a curl.exe executable. I'm not sure how to compile the source code.
Are you talking about Windows??? The first line in the script tells you where you find the CURL application/library. Just download the WIN32 version, unzip it to a folder on your Windows (such as C:\CURL) and you are ready to go.
Just change a few lines at the frontend of the script to indicate your OnStar login info and where you put CURL and copy the script into the CURL folder and run it from there. you DO NOT need to compile anything .... it is VBS which is a runtime system.
I use this all the time on my iMac using Parallels and Windows 7.
Yes, I'm using Windows 7 Ultimate on VMWare Fusion. I had downloaded the sourcecode accidentally but I've got the win32 curl.exe now. I've edited the script with the path to curl.exe, my MyVolt login, and my Onstar PIN and saved it with the vbs extension. The curl version I downloaded is the SSL enabled one and I also copied over the libs from libssl.zip. When I double click the script in windows, nothing happens. If I double click it again, I get a permission denied error. It is generating the 3 log files which contain output from the MyVolt.com site but I don't see anything in them confirming a successful login and my Volt isn't starting. I'm sure there's something I'm missing... Any ideas?
Thanks
eplantz 07-08-2012, 07:57 AM Yes, I'm using Windows 7 Ultimate on VMWare Fusion. I had downloaded the sourcecode accidentally but I've got the win32 curl.exe now. I've edited the script with the path to curl.exe, my MyVolt login, and my Onstar PIN and saved it with the vbs extension. The curl version I downloaded is the SSL enabled one and I also copied over the libs from libssl.zip. When I double click the script in windows, nothing happens. If I double click it again, I get a permission denied error. It is generating the 3 log files which contain output from the MyVolt.com site but I don't see anything in them confirming a successful login and my Volt isn't starting. I'm sure there's something I'm missing... Any ideas?
Thanks
The script does not display any progress on the screen. It produces a number of log files. If you run it while it is still running, it attempts to clean-up (delete) previous log files and cannot because the previous instance is running and using one of them hence the permissions denied message.
What I usually do is look at DEBUG_PAGE7.TXT for the "successful" or failed message. I look at LOG.TXT to check on the temperature/weather check if there is a question about that working.
It takes a few minutes to run because the OnStar access is slow. The script would be nicer if it wrote a dialog box for FINISHED (or perhaps as a option in the script).
Got it working! For some reason the first time I tried it this morning it logged that my Volt was not plugged in so it didn't start but it really was plugged in. I checked the charge level with GreenCharge which was 100% and tried the script again a few minutes later and it worked fine. Onstar is unfortunately buggy which is shown in both the onstar app and the script. It's great to be able to send the start command with a double click though! I hope this can be ported to Iphone/Droid apps.
Thanks
eplantz 07-08-2012, 05:56 PM Got it working!
if you are going to use the weather temp feature, don't forget to fix the script as I mentioned in a recent post.
UseLessGas 07-10-2012, 04:23 PM I downloaded "curl-7.23.1-win64-ssl-sspi.zip". When I run the VBS I get an error window with the title "curl.exe - System Error" and the text "The program can't start because MSVCR100.dll is missing from your computer. Try reinstalling the program to fix this problem."
eplantz 07-10-2012, 06:44 PM I downloaded "curl-7.23.1-win64-ssl-sspi.zip". When I run the VBS I get an error window with the title "curl.exe - System Error" and the text "The program can't start because MSVCR100.dll is missing from your computer. Try reinstalling the program to fix this problem."
did you download the libraries that go with it????
http://curl.haxx.se/docs/libs.html
UseLessGas 07-11-2012, 01:11 AM did you download the libraries that go with it????
http://curl.haxx.se/docs/libs.htmlNo ... I am confused by the pages that present the binaries and the OpenSSL project ... and there is no clear set of instructions of exactly what's needed. (Running Win7-64.) Do I need to compile the "curl" package ?? I would rather avoid this. That's why I searched for and found and downloaded only the "curl.exe".
eplantz 07-11-2012, 10:58 AM No ... I am confused by the pages that present the binaries and the OpenSSL project ... and there is no clear set of instructions of exactly what's needed. (Running Win7-64.) Do I need to compile the "curl" package ?? I would rather avoid this. That's why I searched for and found and downloaded only the "curl.exe".
I don't have WIN64 but here is what it looks like you need:
The CURL program itself:
http://curl.haxx.se/dlwiz/?type=bin&os=Win64&flav=-
the second one is SSL if you want that. Just unzip it to a folder like C:\CURL
OpenSSL lib: http://slproweb.com/products/Win32OpenSSL.html
scroll down to the WIN64 light version. download and install to C:\CURL as well
Copy your VBS script to C:\CURL
edit the VBS script to specify the folder and your OnStar info and WEATHER true/false
you do not need to compile anything.
good luck.
UseLessGas 07-11-2012, 08:04 PM Nogo.
After installing the light package ... same error. I then searched and found the MSVCR100.dll in a Windows\SysWOW64 folder. Copied it to c:\curl. It sort of worked but bombed out later in the script.
If someone is using Win7-64 successfully, please post a list of all files ( incl. DLLs ) in your C:\CURL folder.
TIA.
I think i did that early in the thread but here is what i have :
in my curlssl folder
curl.exe
libeay32.dll
ssleay32.dll
UseLessGas 07-12-2012, 01:16 AM I think i did that early in the thread but here is what i have :
in my curlssl folder
curl.exe
libeay32.dll
ssleay32.dllRight ! Your post = #10 in this thread. And again sorry for being "dense" ... but where did you get "libssl.zip" from ?
I did get it from
http://curl.haxx.se/
There seems to be a newer version.
lets us know what error you get and I am sure we can help
I get so much of my video support files from guru3d.com -- I almost posted that link !!!
------------------
My first computer program was for the IBM 1401 - by the time I got to see a 1401 it was being used as a print buffer device for the IBM-360
GalinMD 08-03-2012, 07:09 PM Can I ask for another feature/script?
I would like one that will tell the Volt to Charge Now.
Explanation:
I signed up for the TOU rates with my local utility company at my house. They rate jumps up from $0.06/kWh to $0.35/kWh from 1pm to 7pm. Because of that I have the Volt set top NOT charge between 1pm - 7pm daily.
I also get to charge at work on occasion. I noticed that it would stop charging at 1pm (as it should), and I would go into the OnStar app and tell it to start charging again...but if I forget than I come back from lunch and start charging I get like 1 hour of charging, then it sits plugged in and not charging.
Is it possible to script that? I would love to have one that will start the charge if it's plugged into 120 (I have 240 at home). So I know that it will start at work, but not if I'm at home and the rates are too high.
AySz88 08-04-2012, 10:08 AM I signed up for the TOU rates with my local utility company at my house. They rate jumps up from $0.06/kWh to $0.35/kWh from 1pm to 7pm. Because of that I have the Volt set top NOT charge between 1pm - 7pm daily.
I also get to charge at work on occasion. I noticed that it would stop charging at 1pm (as it should), and I would go into the OnStar app and tell it to start charging again...but if I forget than I come back from lunch and start charging I get like 1 hour of charging, then it sits plugged in and not charging.
Would it be viable to change your departure time to 4 pm or something? Then the car will still charge at work. And if you plug it in after 4, the car will wait until 7 to start (if I understand that feature correctly). The only con is that if you use some juice in the morning, the car will keep charging 1-4 pm regardless of where it is, even at home.
mikeg3 08-04-2012, 10:28 AM I'm very disappointed at the number of true "hacks" I've seen for the Volt so far. I used to have a Prius, and people were constantly taring it apart to find different ways to "enhance" functions. Perhaps this will be a ever-so-slight kickstart to some of those ideas for the Volt.
Has anyone checked the Terms of Use for OnStar? How about for the Volt itself? Is reverse engineering prohibited?
This program works through the OnStar server. That server can track the actual location of a Volt and even stop the car dead on the highway. Given what I've seen of OnStar's applications, I'm not that certain about their security.
Do you really want someone hacking into code that's one hop removed from a two ton computer-controlled vehicle?
Not all hackers are nice people.
GalinMD 08-06-2012, 09:53 AM Have you tried the delayed charging override when you plug in at work? plug-unplug-plug switches to immediate charge mode. Not sure if it would stop at 1pm if you were in immediate charge mode.
Not sure I've seen that difference. I'll have to check.
Would it be viable to change your departure time to 4 pm or something? Then the car will still charge at work. And if you plug it in after 4, the car will wait until 7 to start (if I understand that feature correctly). The only con is that if you use some juice in the morning, the car will keep charging 1-4 pm regardless of where it is, even at home.
I tried this for a while, it was a bigger pain than just re-starting the charge at 1pm.
I know enough about scripting to see that it's probably a really easy modification to the script to do this...and just too little to actually make the change myself. I guess I'll see if I get a response...maybe I'll dive in to the world of VBScript.
focher 08-06-2012, 10:59 AM Has anyone checked the Terms of Use for OnStar? How about for the Volt itself? Is reverse engineering prohibited?
This program works through the OnStar server. That server can track the actual location of a Volt and even stop the car dead on the highway. Given what I've seen of OnStar's applications, I'm not that certain about their security.
Do you really want someone hacking into code that's one hop removed from a two ton computer-controlled vehicle?
Not all hackers are nice people.
Haven't read OnStar's terms of use, but they don't appear to have an issue with VoltStats.net and it's use data from OnStar. And that includes passing your OnStar username and password through the VoltStats.net service.
However, they appear to have decoupled the service into a "read only" and an "action" set of capabilities. Reading data only appears to require your username and password. Sending commands to the car to do something - like start up, unlock/lock, or beep the horn/flash the lights - require a PIN as a secondary layer of security.
But I'm also pretty sure that OnStar doesn't expose the "shut the car down" capability at all through their API.
AySz88 08-07-2012, 01:39 PM I tried this for a while, it was a bigger pain than just re-starting the charge at 1pm.
Hmm, does this mean that you have to switch back and forth (i.e. there are cases where you have the car without a full charge at 1pm other than at work)? There is a way to just change that time permanently, if not.
Awesome job on this - thank you!!
Ron C 09-19-2012, 11:57 AM All of this would be a lot better if OnStar would open up the APIs like they promised for "later this summer." On Saturday, it officially becomes fall.
Destinet 10-09-2012, 03:59 PM are you able to modify the script to control two volt in one onstar account?
are you able to modify the script to control two volt in one onstar account?
In theory, yes - but I'm afraid I only have one Volt, and have no idea what 2 on one account looks like or how it operates. Does it work well for one of your two cars? Perhaps if you could send me the log files the script generates and describe the behavior you see when you log in (and how you change cars), I may be able to get somewhere with it.
With Destinet's help, we now have version 3 posted to the first thread - now supporting multiple Volt's on the same account, AND working for Canadian Volt owners, complete with Canadian weather additions!
If you only have one Volt and you live in the US, there's no reason for you to upgrade at this time - but it won't hurt anything if you choose to. Just update the config section at the top and you'll be on your way.
I should note that having multiple Volt's on one account within the US has *not* been tested, though I have confirmed that nothing has been broken since v2, and I'm 97% confident that this will work for US owners with multiple Volt's as well. If not, let me know and I'll get it corrected (with a little input from you).
Thanks Destinet!
OhioEE 11-11-2012, 11:12 PM Think I managed to get it installed correctly but have some questions. Never have gotten remote start to work via the website but once I ran the script I noticed the brake lights flash and the interior monitor come on momentarily and then that was it. I assumed that it verified the the temp wasn't in range and so did not remote start but then I recalled that this is solely going through the website. Where is the temperature verified from, vehicle or the weather station I entered?
Edit:
Even after setting temp checks to false, the lights flash but no remote start....perhaps I have something in the car set wrong...
eplantz 11-11-2012, 11:18 PM Where is the temperature verified from, vehicle or the weather station I entered?
you are running a web transaction checking the weather station ID you set in the script. this has nothing to do with car temp or garage temp.
if the script ran/worked, the car should be locked.
there are quite a few logs you can check in the folder you installed it in.
OhioEE 11-11-2012, 11:33 PM you are running a web transaction checking the weather station ID you set in the script. this has nothing to do with car temp or garage temp.
if the script ran/worked, the car should be locked.
there are quite a few logs you can check in the folder you installed it in.
Ahh, duh. I leave the fob in the vehicle when in the garage. Interesting that it will still lock the door with the fob in it when attempting a remote start. Script works great!
sabray1 11-15-2012, 11:01 AM After some fumbling around I got this working on my windows laptop. :cool:
ptarp 11-20-2012, 02:02 PM Just got this working on win7 64 bit using the 32 version of curl (the other version didn't want to play nice with the script.)
Looking at this it would be cool to have seperate scripts for canceling remote start, locking and unlocking.
Very nice work btw..
John_Hatchett 11-26-2012, 11:32 PM With Destinet's help, we now have version 3 posted to the first thread - now supporting multiple Volt's on the same account, AND working for Canadian Volt owners, complete with Canadian weather additions!
If you only have one Volt and you live in the US, there's no reason for you to upgrade at this time - but it won't hurt anything if you choose to. Just update the config section at the top and you'll be on your way.
I should note that having multiple Volt's on one account within the US has *not* been tested, though I have confirmed that nothing has been broken since v2, and I'm 97% confident that this will work for US owners with multiple Volt's as well. If not, let me know and I'll get it corrected (with a little input from you).
Thanks Destinet!
Any chance you could work out a download and archive of the 30 day charging, efficiency and mileage files from myvolt ?
Destinet 11-27-2012, 07:58 AM Any chance you could work out a download and archive of the 30 day charging, efficiency and mileage files from myvolt ?
I'm working on that, i'm leaving on vacation friday so the script should be ready when i come back arround the 10 of december.
John_Hatchett 11-27-2012, 09:00 AM I'm working on that, i'm leaving on vacation friday so the script should be ready when i come back arround the 10 of december.
excellent!!!
maybe I can break out perl and write a script to process the .csv files, de-dupe individual records, and pump them into one consolidated spreadsheet and into a calendar.
I eventually would like to have a daily calendar log of EV miles, CS miles, kWh's and gasoline .
Destinet 11-27-2012, 09:04 AM excellent!!!
maybe I can break out perl and write a script to process the .csv files, de-dupe individual records, and pump them into one consolidated spreadsheet and into a calendar.
I eventually would like to have a daily calendar log of EV miles, CS miles, kWh's and gasoline .
I'm building it so it will be one csv/excel sheet. The result of the query will be append to the end of the file so you will not have many many file.
kdawg 11-27-2012, 12:50 PM Any chance you could work out a download and archive of the 30 day charging, efficiency and mileage files from myvolt ?
Why not just download the data from Voltstats.net?
Destinet 11-27-2012, 12:53 PM Why not just download the data from Voltstats.net?
The data from voltstats only include gallonburned, lifetimefuelecon, lifetimeevmiles, lifetimemiles now. All other column are empty
mlard811 12-06-2012, 08:27 AM Just found this little gem last night! I set it up on my WHS2011 and it works great! Thanks so much for letting us in on this. I've always thought there must be a way to automate it. Thanks again!
John_Hatchett 12-09-2012, 03:20 PM I'm building it so it will be one csv/excel sheet. The result of the query will be append to the end of the file so you will not have many many file.
That sounds great. I'm not sure what magic has to happen in the header to get google drive to recognize the columns but you might want to test it. Some csv files open just fine, others open with everything in one column.
I just need to write a script to convert the sheet into a bunch of calendar entries and populate a google calendar.
I have also started populating fuelly with my kWh converted to gallons (33.7 kWh = 1 gallon)
John_Hatchett 12-12-2012, 11:16 AM I'm working on that, i'm leaving on vacation friday so the script should be ready when i come back arround the 10 of december.
How is it going ?
Destinet 12-12-2012, 11:31 AM How is it going ?
Lots of job with my week away. Didn't had a chance to work on it. So fare i'm still working on getting the correct data on the daily screen. When that will be done i will sent the script to Ohm so he can test with is US account and be sure the data is good and finaly i will post it. When the script will be send to Ohm i will advise you. Thanks!
John_Hatchett 12-16-2012, 08:10 PM I'm building it so it will be one csv/excel sheet. The result of the query will be append to the end of the file so you will not have many many file.
Are you planning to put all three (charging, effeciency, mileage) into one csv/excel sheet?
I was looking at this again today and the records for each are different and none of them include the odometer reading. some threading of the records could be done using the date/time fields. the odometer reading can be captured from the charging screen but that reading is "current" and the history files are typically lagging by 24 hours or more. Perhaps the odometer capture from a previous run of the script could be used to augment the history files with odometer data in each record.
elluke 12-19-2012, 06:27 PM Question for script author. I am attempting to port this script over to perl 1) because I am using it to learn perl and 2) I want to run it in unix. No understanding the http workflow and windows scripting, my first question is:
Do you examples of the full URL's you are really posting in your "cmd" functions? I think I can figure it out but it would be nice to have something real to compare to.
Dante 12-30-2012, 05:42 PM Hey gang, I just found this thread, downloaded the txt file (v3 of the script), installed the basic 32-bit CUrl binaries (running Win7x64 here), tweaked the script for my data as described, and ran it with fingers crossed. I then looked around the various logs for a clue as to what happened while dispatching my offspring to the garage to check on the car. She reported that the car lights were not on, only that the green charge light was on, solid. I read through logs, and it indicated success, so I went and checked the car again, and it had started the pre-condition state. Interesting, OnStar is just un-real slow in sending messages to the car, I guess. In the end, it DID work, it just took a little while (a minute or better).
While perusing the logs, in Current_Weather.xml, I noticed it was throwing back an HTTP 302, and that the new url for the data was available here:
http://w1.weather.gov/xml/current_obs/<your-4-digit-weather-station>.xml
The script shows "www" and not "w1", otherwise the URLs are identical. The script interpreted this result as "0" for the data, and since I'd set the temp constraints to start when < 55F or > 85F, and since 0 < 55, it started.
I changed the weather url and ran it again, and got a well-formed XML document back instead of the HTTP 302 error. Yay! Lots of interesting info in there... In the log I now see the correct outside temp (47F) instead of 0, so it's parsing the weather xml data correctly, and further on down after the "almost infinite loop" (interesting comments in there btw), while waiting for OnStar to talk to the car, I eventually see a message about "All conditions met to precondition." so it looks good with this fix.
No idea when they changed the weather page, it is the kind of thing that if you aren't paying attention or haven't set a "happy range" where you don't want the car to pre-condition (such as when you've got this thing running from a timed script), you'd never see. So, it's what I think of as a sneaky bug that only some users would find in some situations. Personally, I don't think I will automate execution of this, but just keep it handy via a desktop shortcut. My departure times are far too erratic!
I'm a software engineer by trade, and it's pretty tempting for me to make a C# app out of this with proper UI that will give users some feedback as to what the heck it's doing, and it wouldn't be much to make it single binary that someone just runs, plugs in their info at setup, hits save, and then would just enter their PIN each time, like on the OnStar RemoteLink app. I haven't tried to reverse engineer the mobile apps, but I would bet that the other 5 buttons on that app are just variations of the URL for the remote start (lock, unlock, cancel remote start, horn & lights, stop horn & lights on the "Remote" tab). There's a lot more functionality in the smartphone app, but if we determine the url/querystring for the "read-only" screens like the "Dashboard" that shows your current charge state, etc, it wouldn't be a big jump to showing that info as well.
Having said all that, the EULA is pretty explicit about not reverse-compiling their apps, so I'd never do such a thing, and shame on you if you do. :p
Destinet 01-29-2013, 04:07 PM Hi everyone the stats script is finaly done and working. But i have a canadian account and the url are not the same for us. Is there someone willing to help me? if yes message me.
Regards
ari_c 02-02-2013, 04:20 PM I finally decided to try this out. I should have read the last few comments as I ran into the same problem that Dante mentioned about the weather url and I was going to post about the w1 instead of the www.
I always want to precondition my car unless it is below 26 degrees, so I set my range backrwards. My Low_temp_trigger is 0 and my High_temp_trigger is 26. This way it will always remote start unless the temp is between 0 and 26. I don't expect it to get below 0 in my area! I guess I could stick in a negative value there.
I am attaching an icon I made (red volt only). I created a shortcut (with the icon) out of the vbs script and put it on my start menu for those times I am too lazy to actually walk to the garage or find my keys!
Destinet 02-05-2013, 03:49 PM The stats script is ready, let me know if you have problem.
http://gm-volt.com/forum/showthread.php?25873-Your-own-Stats-script.
Destinet 03-15-2013, 01:05 PM Here is another script to collect remotelink data.
http://gm-volt.com/forum/showthread.php?34177-Remote-link-data-download
piratefan2 03-26-2013, 09:34 AM I have downloaded Curl (64-bit, non-ssl) and edited the script, placing both in the same directory. I have a 2013 Volt and a 2011 Equinox on my OnStar account, so I entered the Volt's VIN number, along with my myvolt.com login info and PIN.
I saved the file with a .vbs extension. When I double-clicked on it, I'm told it isn't a valid Win32. I then chose to 'Open With' Microsoft Windows Based Script Host. This time, I got an error that says:
Line: 242
Char: 7
Error: File not found
Code: 800A0035
Source: Microsoft VBScript runtime error
Line 242 in the script is "set started_file = fso.OpenTextFile(output7)". It begins on character 7.
Can anyone tell me what I'm doing wrong?
Destinet 03-26-2013, 09:38 AM can you show me the log file?
piratefan2 03-26-2013, 10:14 AM Thanks for the quick reply! Here are the contents of log.txt:
"C:\Program Files\Curl\curl.exe" -s --insecure -b "C:\Program Files\Curl\Cookies.txt" -c "C:\Program Files\Curl\Cookies.txt" -q https://secure.myvolt.com/web/portal/home -o "C:\Program Files\Curl\debug_page1.txt"
"C:\Program Files\Curl\curl.exe" -s --insecure -b "C:\Program Files\Curl\Cookies.txt" -c "C:\Program Files\Curl\Cookies.txt" -q https://secure.myvolt.com/web/portal/home?p_p_id=voltlogin_WAR_loginportlet_INSTANCE_ih 6I&p_p_lifecycle=0&p_p_state=exclusive&p_p_mode=view&p_p_col_id=column-1&p_p_col_pos=3&p_p_col_count=4&callback=jsonp705547511577 -o "C:\Program Files\Curl\debug_page2.txt" -e "https://secure.myvolt.com/web/portal/home" --data "userAction=validateUserCredentials&user=<<MyVolt_Login>>&password=<<MyVolt_Password>>&callback=jsonp705547511577"
"C:\Program Files\Curl\curl.exe" -s --insecure -b "C:\Program Files\Curl\Cookies.txt" -c "C:\Program Files\Curl\Cookies.txt" -q https://secure.myvolt.com/web/portal/home?p_p_id=voltlogin_WAR_loginportlet_INSTANCE_ih 6I&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1&p_p_col_pos=3&p_p_col_count=4 -o "C:\Program Files\Curl\debug_page3.txt" -e "https://secure.myvolt.com/web/portal/home" --data "user=<<MyVolt_Login>>&password=<<MyVolt_Password>>&remember=on&userAction=login&acctNum="
"C:\Program Files\Curl\curl.exe" -s --insecure -b "C:\Program Files\Curl\Cookies.txt" -c "C:\Program Files\Curl\Cookies.txt" -q https://secure.myvolt.com/web/portal/home?p_p_id=volthome_WAR_voltovdportlet_INSTANCE_Z q7f&p_p_lifecycle=1&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1&p_p_col_pos=2&p_p_col_count=4&selectedVoltVin=1G1RB6E41DU129727 -o "C:\Program Files\Curl\Car_swap.txt" -e "https://secure.myvolt.com/web/portal/home"
"C:\Program Files\Curl\curl.exe" -s --insecure -b "C:\Program Files\Curl\Cookies.txt" -c "C:\Program Files\Curl\Cookies.txt" -q https://secure.myvolt.com/web/portal/home?p_p_id=onstarvoltportlet_WAR_onstarvoltportle t_INSTANCE_4oBf&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-2&p_p_col_pos=1&p_p_col_count=2&_onstarvoltportlet_WAR_onstarvoltportlet_INSTANCE_ 4oBf_action=pinauthorization -o "C:\Program Files\Curl\debug_page4.txt" -e "https://secure.myvolt.com/web/portal/home"
"C:\Program Files\Curl\curl.exe" -s --insecure -b "C:\Program Files\Curl\Cookies.txt" -c "C:\Program Files\Curl\Cookies.txt" -q https://secure.myvolt.com/web/portal/home?p_p_id=onstarvoltportlet_WAR_onstarvoltportle t_INSTANCE_4oBf&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-2&p_p_col_pos=1&p_p_col_count=2&_onstarvoltportlet_WAR_onstarvoltportlet_INSTANCE_ 4oBf_action=pinauthorization -o "C:\Program Files\Curl\debug_page5.txt" -e "https://secure.myvolt.com/web/portal/home" --data "authenticate=true&pin=<<MyVolt_Pin>>"
"C:\Program Files\Curl\curl.exe" -s --insecure -b "C:\Program Files\Curl\Cookies.txt" -c "C:\Program Files\Curl\Cookies.txt" -q https://secure.myvolt.com/web/portal/home?p_p_id=onstarvoltportlet_WAR_onstarvoltportle t_INSTANCE_4oBf&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-2&p_p_col_pos=1&p_p_col_count=2&_onstarvoltportlet_WAR_onstarvoltportlet_INSTANCE_ 4oBf_action=remotecommands -o "C:\Program Files\Curl\debug_page6.txt" -e "https://secure.myvolt.com/web/portal/home" --data "initiate=true&command=InitiateRemoteStart"
"C:\Program Files\Curl\curl.exe" -s --insecure -b "C:\Program Files\Curl\Cookies.txt" -c "C:\Program Files\Curl\Cookies.txt" -q https://secure.myvolt.com/web/portal/home?p_p_id=onstarvoltportlet_WAR_onstarvoltportle t_INSTANCE_4oBf&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-2&p_p_col_pos=1&p_p_col_count=2&_onstarvoltportlet_WAR_onstarvoltportlet_INSTANCE_ 4oBf_action=remotecommands -o "C:\Program Files\Curl\debug_page7.txt" -e "https://secure.myvolt.com/web/portal/home" --data "command=InitiateRemoteStart"
Destinet 03-26-2013, 10:17 AM Weird, so you don't have the file debug_page7.txt in your folder? can you show me the debug_page6.txt content?
piratefan2 03-26-2013, 10:27 AM The only .txt file that was created when I ran the script was log.txt.
I even tried creating blank versions of all of the txt/xml files. Then when I ran the script, all but log.txt and Car_Swap.txt were deleted.
Destinet 03-26-2013, 10:31 AM can you show me the car swap file?
piratefan2 03-26-2013, 10:41 AM The car swap file that I have is the blank one that I created. It wasn't modified by the script.
| |