[chbot] [OT] flick electric price logging

Peter Ellens ellensp at gmail.com
Thu Aug 30 03:45:55 BST 2018


Its not big enough to justify a repo...

I use https://www.npmjs.com/package/flick-electric-api

and the script getprice.js
--------------------------------------------------------
var FlickAPI = require('flick-electric-api')

// set up API
var flick = new FlickAPI('USERNAME', 'PASSWORD');

// attach some events
flick.on('error', function(err) { console.log("Error: " + err); });
flick.on('price', function(price) { console.log("Current price: $" + 
price + "per kWhr") });

// and get the current price
flick.get_price();
------------------------------------------------------------------------------------

and a extremely simple batch file loggetprice.sh
------------------------------------------------------------------------------------
#!/bin/bash
date=`date`
cmd=`node getprice.js`
echo $date $cmd >> /home/pi/pricelog.txt;
------------------------------------------------------------------------------------

and add it to crontab with the line
* * * * * bash /home/pi/loggetprice.sh




On 30/08/18 06:09, Jasper Mackenzie wrote:
> Very interested.
>  Do you have a github repo with your docs and code?
>
> Cheers




More information about the Chchrobotics mailing list