This git repo contains all the code required to run the VMW Chargepoint Dashboard (http://wreckr.net/vmw).
-
Sign up for a free OpenShift Account at https://www.openshift.com/
-
Install the Openshift Client tools: https://developers.openshift.com/en/managing-client-tools.html. (I like to use Ubunutu for most of my dev work.)
-
Setup rhc for your openshift account. Instructions are in the same link as step #2
-
Create the App and deploy the application code
$> rhc app create vmwcp python-2.7 cron-1.4 --from-code=git://github.com/wrecker/vmw-chargepoint
Here vmwcp is the name of the application. You can use any valid name instead of vmwcp. This step will take a few minutes. Be patient.
-
The
app create
step above will also clone locally the private git repo backing your app. This repo contains a full copy of the repo on github. In your local repo edit the filewsgi/.cp_passwd
and put your chargepoint username & password in this formatusername:password
on the first line. Commit and update the app.$> git add wsgi/.cp_passwd $> git commit $> git push
Once the git commit is pushed to the private remote repo, you will see a lot of messages about python packages and finally the app will be restarted.
-
Wait for a few minutes for the first cron run to trigger. Open the url http://vmwcp-[openshift-domain].rhcloud.com/vmw
The app has support for generating notifications using PushBullet. By default its turned off and can be enabled with a couple of lines of changes.
- Sign up for a PushBullet Account and get your API Key/Access Token from this page https://www.pushbullet.com/account. Edit the file
wsgi/.pb_key
and paste this key as the first line of the file. - At the top of file
wsgi/get_json.py
, look for the comment block that starts with "Garages & Pushbullet Channels". After this block there is a dict variable namedGARAGES
. This dict is initialized with the three garage names and a corresponding pushbullet tag. - Create three pushbullet channels at https://www.pushbullet.com/my-channel and update the dict
GARAGES
inwsgi/get_json.py
. - Edit file
.openshift/cron/minutely/get_json.sh
and go to line 36. Delete or comment out the line that saysnotify=""
. The lines above in this line are doing some calculations based on the current time & day to decided if the app should generate pushbullet notifications. Make any changes to the schedule. - Commit all the changes to the three files and push the changes to the remote git repo.
If you have any questions email me at coder@mahesh.net