87squirrels Posted January 2, 2011 Posted January 2, 2011 I have two long gutter/roof heaters to prevent formation of icicles along our roofline, and they 400 Watts each I also have a Davis Instruments weather system, which I interface to my computer with an open-source package called wview. A feature of wview is that it can run a script on the computer when certain events occur. I have one script that runs every minute that uses the ISY's REST interface to switch the gutter heaters off when they are not needed (temp below 25 or above 35), and on when the temp is inside that window, which saves considerable power, and keeps the gutters flowing when the temp is in the critical zone. I also use the network modules to log messages back to my computer when they are turned on and off so that I can check in to see that all is working as expected. Before setting this up, I was either forgetting the plug them in, or forgetting to disconnect them; I guessing that I will save $20-30/month during Dec - Feb by virtue of not having these suckers on any more than needed. I have one thing left to do, which is decide how to handle the "clear roof" scenario. I'll probably put the program triggers by the REST interface in a folder that I will disable when there is no snow on the roof, but I may handle it on the server side. Edit: include actual power ratings.
TomW Posted February 9, 2011 Posted February 9, 2011 Hi 87, What a great application. I didn't plug my gutter heater in before some amazing ice dams formed. Next year I plan to install two additional gutter heaters. Can you please share your code that you run on your computer and the ISY. Thanks. /Tom
stevehoyt Posted February 20, 2011 Posted February 20, 2011 It looks like this is for unix only. Is there a version or some other program to interogate the Davis weather station that will run on windows 7? Thanks Steve
87squirrels Posted March 14, 2011 Author Posted March 14, 2011 @stevehoyt -- Davis does have a Windows program, but I don't know if you can access the data remotely. Since the only computer I run 24x7 is Linux, I didn't really look for alternatives. @TomW -- code coming up. Sorry for the delayed responses! -tom
87squirrels Posted March 14, 2011 Author Posted March 14, 2011 Here's the entry in wvalarm.conf: OutsideTemp 1 -40 60 /etc/wview/alarms/outdoorUpdate.sh This causes the script outdoorUpdate.sh to be called once a minute whenever the temp is above -40. outdoorUpdate.sh #!/bin/bash # Run as an alarm script every minute # Notifies the home automation controller and copies a status file to the web directory # argv[1] -- Alarm type (always 0 in this case) from wvalarm.conf # argv[2] -- Alarm threshold (always -40) from wvalarm.conf # argv[3] -- Current value (outdoor temperature) # Status file # w1 [w2 w3] # w1 = ON|OFF -- last known status # w2 = MANUAL|{null} -- MANUAL if no automated control desired # w3 = ON|OFF -- manual setting # ISY's REST URL ISY_REST_URL=http://isy99/rest # Commands to send to the ISY's REST interface, based on desired state ISYGUTTER_ON=/programs/0036/runThen ISYGUTTER_OFF=/programs/0036/runElse GUTTER_LO_TEMP=25 GUTTER_HI_TEMP=35 NOW=`date` echo "$NOW: outdoorUpdate temp alarm script called with $*" >>/tmp/wvalarm.log # Gutter heaters -- should be on from 25 - 35F file1="/var/www/wview/outdoorGutterOn.xml" file2="/var/www/wview/outdoorGutterStatus.txt" # Strip decimal places so we can do integer comparisons TEMP=${3%\.*} if [[ $TEMP -ge $GUTTER_LO_TEMP && $TEMP -le $GUTTER_HI_TEMP ]]; then GUTTERMODE=ON else GUTTERMODE=OFF fi; MANUAL="" MANUALMODE="" if [[ -r $file2 ]]; then GUTTERSTATUS=`cat $file2` GUTTERWORDS=(${GUTTERSTATUS}) if [[ ${GUTTERWORDS[1]} == "MANUAL" ]]; then MANUAL=MANUAL GUTTERSTATUS=${GUTTERWORDS[0]} MANUALMODE=${GUTTERWORDS[2]} GUTTERMODE=${GUTTERWORDS[2]} # Force to our desired mode fi; else GUTTERSTATUS=Unknown fi; echo "$NOW: outdoor temp is $TEMP; gutters should be $GUTTERMODE currently $GUTTERSTATUS $MANUAL" >>/tmp/wvalarm.log # If the calculated mode is different than the saved mode, send an udpate to the ISY99 controller if [[ $GUTTERMODE != $GUTTERSTATUS ]]; then echo "$NOW: gutter status is $GUTTERSTATUS; need to set $GUTTERMODE" >>/tmp/wvalarm.log ISYCMD=ISYGUTTER_$GUTTERMODE wget -O /tmp/isy99gutter.log --user ***** --password ***** ${ISY_REST_URL}${!ISYCMD} echo $GUTTERMODE $MANUAL $MANUALMODE >$file2 fi; exit The status file can also be updated by an external script to force the gutters into always-off (MANUAL OFF) or always-on (MANUAL ON) state. That script merely sets nn MANUAL OFF (i.e.) and waits for this script to actually update the isy.
87squirrels Posted March 14, 2011 Author Posted March 14, 2011 Here's the (trivial) program. If - No Conditions - (To add one, press 'Schedule' or 'Condition') Then Set Scene 'Outdoors / Gutters' On Resource 'Log: Gutter On' Else Set Scene 'Outdoors / Gutters' Off Resource 'Log: Gutter Off' Program is triggered by script running on server's /etc/wview/alarms directory when tripped by temperature in range calling for gutter heat. The network request merely creates a log file on the server, mostly for when I was first debugging the code. It's not important to the actual functionality. As you can see, I could have simply set the scene on or off from the external script.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.