Jump to content

Filtrete 3M-50 WiFi Thermostat


ResIpsa

Recommended Posts

Posted

Got a PM asking about progress since my earlier post in this thread; here's where I am now, with a combination of network resources and scripts running on a Linux server:

 

Network resource to turn the fan on looks like this:

POST /tstat HTTP/1.1
Host: tstat-mbr.home.87squirrels.com:80
User-Agent: Mozilla/4.0
Connection: Close
Content-Type: application/x-www-form-urlencoded
Content-Length: 11

{"fmode":2}

To switch to Auto mode, use

{"fmode":0}

 

Bash script to get status information from the thermostat (excerpted from a longer script):

       TSTATURL="http://thermostat.ip.address.goes.here
       STR=`curl --silent ${TSTATURL}/tstat`
       if [ "$?" != "0" ]; then
               echo "Retrying..."
               sleep 15
               STR=`curl --silent ${TSTATURL}/tstat`
       fi
       if [ "$STR" != "" ]; then
               ##echo String=$STR
               TEMP=`echo $STR | sed -e 's/.*temp":\([0-9]*\).*/\1/'`
               HOLD=`echo $STR | sed -e 's/.*hold":\([0-9]*\).*/\1/'`
               MODE=`echo $STR | sed -e 's/.*tmode":\([0-9]*\).*/\1/'`
               FAN=`echo $STR | sed -e 's/.*fmode":\([0-9]*\).*/\1/'`
               HEATSETTING=`echo $STR | sed -e 's/.*t_heat":\([0-9]*\).*/\1/'`
               COOLSETTING=`echo $STR | sed -e 's/.*t_cool":\([0-9]*\).*/\1/'`
               STATE=`echo $STR | sed -e 's/.*tstate":\([0-9]*\).*/\1/'`
                       HOLDTYPES=("" "HOLD")
                       MODETYPES=("Off" "Heat" "Cool" "Auto")
                       FANTYPES=("Auto" "Circulate" "On")
               HOLDING=${HOLDTYPES[$HOLD]}
               MODENOW=${MODETYPES[$MODE]}
               FANSET=${FANTYPES[$FAN]}
               ##
               if [ "$MODENOW" == "Heat" ]; then
                   SETTING=$HEATSETTING
                   COOLSETTING="-"
               elif [ "$MODENOW" == "Cool" ]; then
                   SETTING=$COOLSETTING
                   HEATSETTING="-"
               else
                   SETTING=""
               fi
       else
               TEMP=""
       fi

 

Update the ISY with the current temperature:

ISY_AUTH="--user admin --password admin"      # change to your user/pass
ISY_URL="http://isy.ip.address.here"
ISY_SET_STATE_VAR="rest/vars/set/2"
wget -o /tmp/mbr_status -O /tmp/mbr_status_temp $ISY_AUTH ${ISY_URL}/${ISY_SET_STATE_VAR}/2/$TEMP   # $MBR_TEMP is state variable #2 on my ISY

 

With similar wget commands for other variables to be updated in the ISY (current setpoint, heat/cool/off mode, etc.)

 

Here's the program that cycles the fan:

If
       $MBR_TSTAT_STATE is $_TSTAT_MODE_OFF
   And $MBR_TSTAT_MODE is $_TSTAT_MODE_COOL
   And $MBR_TSTAT_COOL_SETPOINT < 83
   And Status  'Bedroom / MBR - KPL:B # Away' is not On
   And From    Sunset  - 30 minutes
       To      Sunrise + 30 minutes (next day)

Then
       Wait  20 minutes 
       Repeat Every  20 minutes 
          Resource 'mbr_tstat:Fan On'
          Wait  5 minutes 
          Resource 'mbr_tstat:Fan Auto'

Else
       Resource 'mbr_tstat:Fan Auto'

Nighttime, thermostat in cool mode, but 'idle' (i.e., not calling for cool)
Set cool setting to 83 or higher to disable.
Run fan for 5 minutes every 20 minutes.
Switch back to auto mode when tstat is switched out of cool mode, or when it calls for cool.

 

I'm considering moving the shell scripts to node.js, which would make parsing JSON responses easier, but have not done so yet.

I do have a node.js program monitoring my alarm system (an Ademco system, using an adaptor called AD2USB) and setting a variable with the current disarmed/armed status; that's working nicely.

  • 1 year later...
  • 1 year later...
Posted

Got a PM asking about progress since my earlier post in this thread; here's where I am now, with a combination of network resources and scripts running on a Linux server:

 

Network resource to turn the fan on looks like this:

POST /tstat HTTP/1.1
Host: tstat-mbr.home.87squirrels.com:80
User-Agent: Mozilla/4.0
Connection: Close
Content-Type: application/x-www-form-urlencoded
Content-Length: 11

{"fmode":2}
To switch to Auto mode, use
{"fmode":0}
Bash script to get status information from the thermostat (excerpted from a longer script):

        TSTATURL="http://thermostat.ip.address.goes.here
        STR=`curl --silent ${TSTATURL}/tstat`
        if [ "$?" != "0" ]; then
                echo "Retrying..."
                sleep 15
                STR=`curl --silent ${TSTATURL}/tstat`
        fi
        if [ "$STR" != "" ]; then
                ##echo String=$STR
                TEMP=`echo $STR | sed -e 's/.*temp":\([0-9]*\).*/\1/'`
                HOLD=`echo $STR | sed -e 's/.*hold":\([0-9]*\).*/\1/'`
                MODE=`echo $STR | sed -e 's/.*tmode":\([0-9]*\).*/\1/'`
                FAN=`echo $STR | sed -e 's/.*fmode":\([0-9]*\).*/\1/'`
                HEATSETTING=`echo $STR | sed -e 's/.*t_heat":\([0-9]*\).*/\1/'`
                COOLSETTING=`echo $STR | sed -e 's/.*t_cool":\([0-9]*\).*/\1/'`
                STATE=`echo $STR | sed -e 's/.*tstate":\([0-9]*\).*/\1/'`
                        HOLDTYPES=("" "HOLD")
                        MODETYPES=("Off" "Heat" "Cool" "Auto")
                        FANTYPES=("Auto" "Circulate" "On")
                HOLDING=${HOLDTYPES[$HOLD]}
                MODENOW=${MODETYPES[$MODE]}
                FANSET=${FANTYPES[$FAN]}
                ##
                if [ "$MODENOW" == "Heat" ]; then
                    SETTING=$HEATSETTING
                    COOLSETTING="-"
                elif [ "$MODENOW" == "Cool" ]; then
                    SETTING=$COOLSETTING
                    HEATSETTING="-"
                else
                    SETTING=""
                fi
        else
                TEMP=""
        fi
Update the ISY with the current temperature:

ISY_AUTH="--user admin --password admin"      # change to your user/pass
ISY_URL="http://isy.ip.address.here"
ISY_SET_STATE_VAR="rest/vars/set/2"
wget -o /tmp/mbr_status -O /tmp/mbr_status_temp $ISY_AUTH ${ISY_URL}/${ISY_SET_STATE_VAR}/2/$TEMP   # $MBR_TEMP is state variable #2 on my ISY
With similar wget commands for other variables to be updated in the ISY (current setpoint, heat/cool/off mode, etc.)

 

Here's the program that cycles the fan:

If
        $MBR_TSTAT_STATE is $_TSTAT_MODE_OFF
    And $MBR_TSTAT_MODE is $_TSTAT_MODE_COOL
    And $MBR_TSTAT_COOL_SETPOINT < 83
    And Status  'Bedroom / MBR - KPL:B # Away' is not On
    And From    Sunset  - 30 minutes
        To      Sunrise + 30 minutes (next day)
 
Then
        Wait  20 minutes 
        Repeat Every  20 minutes 
           Resource 'mbr_tstat:Fan On'
           Wait  5 minutes 
           Resource 'mbr_tstat:Fan Auto'
 
Else
        Resource 'mbr_tstat:Fan Auto'
 
Nighttime, thermostat in cool mode, but 'idle' (i.e., not calling for cool)
Set cool setting to 83 or higher to disable.
Run fan for 5 minutes every 20 minutes.
Switch back to auto mode when tstat is switched out of cool mode, or when it calls for cool.
I'm considering moving the shell scripts to node.js, which would make parsing JSON responses easier, but have not done so yet.

I do have a node.js program monitoring my alarm system (an Ademco system, using an adaptor called AD2USB) and setting a variable with the current disarmed/armed status; that's working nicely.

 

 

Thanks 87squirrels.  This helped me.

 

 

Something to note for for setting up the Network Resource on the ISY... (I was banging my head until I tried it)...  I had to switch the mode from "URL-Encoded" to "Raw Text" for the POST to work for me and have the CT-50 accept the fan changes.  I imagine the same will be had for any other POSTs to this TStat.

 

Cheers

  • 2 weeks later...
Posted

Is there anyone successfully using this 3M-50 TStat and the USnap module with their zWave upgraded ISY ?    I was considering pulling the trigger on a USNAP.

 

Thx

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...