Tag Archives: NAS

How to log Humidity data from your NEST

Based on my success in getting my NEST to SMS when my furnace fails I wanted to get into something else that bugs me about the NEST.   It knows the humidity in the house, but its tedious to get it to tell you… click, click, click on either the NEST or the app or the website.

What I’ll do with data?  I’m not sure.   Perhaps justify a whole house humidifier some day or running a window A/C in dehumidify mode or figure out when to buy vats of hand lotion…

#!/bin/bash
#
# By M. De Remer 2014
#
# Inspired by the article by Scott Baker and comments at
# http://www.smbaker.com/a-python-api-for-the-nest-learning-thermostat
#
# Remember to make these file(s) executable ‘chmod +x hum_log.sh nest.py’
#
# More at http://www.EngineerItDude.com
#
# Remember to add this to /etc/config/crontab
#
# Requirements
# – Python
# – nest.py
# – a NEST
#
# Change these items to match your accounts
#
# Nest Login info
USERNAME=”you@you.com”
PASSWORD=”supersecretpassword”
#
# Install path
NPATH=”/share/HDA_DATA/.qpkg/nest”
#
# Don’t change anything below here unless you know what you’re doing
#
echo “HumLog started at $(date)”
#
# Set rarely changed variables
LOG=”$NPATH/hum_log.txt”
CTF=$(python $NPATH/nest.py curhumid –user $USERNAME –password $PASSWORD)
CTFR=$(echo $CTF | cut -d”.” -f1)
#
#
if [[ -z $CTF ]]
then
echo “Alert: NEST has not responded or another error has occured”
log_tool –append ‘HumLog ERROR’ -t 0
else
echo “Humidty is $CTFR”
echo $(date +”%m-%d-%Y”),$(date +”%T”),$CTFR >> $LOG
echo “Humidty logged. Exiting”
fi

Caveat:   Again I used log_tool to alert on a failure to connect to the NEST.   This is used by QNAP.   Others may use another command.   You can comment this out if desired.