Script to log Nest thermostat details, using the output from the excellent pynest script.
To use this logger, first download pynest, then edit lines 24-28 specifying your Nest login credentials and where to save the output:
my $outfile = '/Path/to/logfile'; # logfile location
my @thermostats = (0,1); # thermostat index numbers (use 0 for a single thermostat)
my $user = 'your_nest_username';
my $pass = 'your_nest_password';
my $pynest = '/Path/to/nest.py';
Then add a cron job for the desired frequency:
$ crontab -e
To run every minute of every day, for example, enter:
* * * * * /path/to/your/repo/pynest-logger.pl
The data file contains the following values, tab separated:
- Timestamp, epoch format
- Thermostat name
- Current temperature
- Target temperature
- Current humidity
- Auto-away status
- Current fan control status
- Current cooling status
- Current heating status
- Fan mode (on/auto/duty-cycle)
- Fan on/off
- HVAC cooling support
- HVAC heating support
- Nest temperature scale setting
- Nest leaf status
Time name current_temperature target_temperature current_humidity auto_away fan_control_state hvac_ac_state hvac_heater_state
1377291009 Upstairs 25.31 25.3390000000 59 0 False False False
1377291010 Kitchen 25.85 25.5555555556 60 0 False False False
fan_mode hvac_fan_state can_cool can_heat temperature_scale leaf
duty-cycle False True False F False
duty-cycle False True False F False
A single entry in the sample above is around 100 bytes.
Logging one thermostat every minute for a year should use around 50 MB.
More scripts to make fancy charts and graphs from the data are on the way!