added updated js for pubnub connections, to monitor fan status.. uses history to get last fan reading