Whole house fan needs virtual thermostat


#1

1) Give a description of the problem
I have a whole house exhaust fan that I turn on at night. But, some nights get too cold, thus freezing us out of the bedroom in the early mornings. I have a temp/humidity sensor in the bedroom and one outside the house. I have a switch that controls the fan. I have a window sensor to make sure the fan doesn’t turn on unless the window is open.

2) What is the expected behavior?
When the window is open the fan turns on and the main thermostat turns off. If the outside temp is below 73 or 72 degrees and the bedroom is above 73-72 degrees, conditions are right for the fan to stay on.
When the bedroom temp falls below 68-67 degrees I want the fan turn off until the bedroom warms up again to 73-72 degrees. People in the HVAC business call this “economizer cooling”. It would be a bonus if I could get an adjustable set point, but not necessary.

3) What is happening/not happening?
I looked up old posts of virtual thermostats, but all had physical thermostats with adjustable set points. I do not have adjustable set points, just a couple of temp/humidly sensors. This is my second piston and it beyond my skill level.


#2

Here is an idea, I’m not sure if this is what you need but this is what I use for my AC in the house.
(I like to keep the house around 72,73)
Since you have Temp sensors you can use them, you just need to make sure that they are calibrated correctly.

IF sensor X temp rises to or above 72
Then 
With AC 
Do turn ON

IF sensor X temp drops to or below 71
Then 
With AC
Do turn OFF

#3

Yeah. I can try it with the fan instead of the A/C.
Can you share that piston with me?
Is there a meathod of calibrating the sensors in webCore? @webCoRE_Minions


#4

I would use a simulated device, with two slider tiles, one to set min, one to set max


#5

that sound great one for upper set point and the other for lower set point.


#6

Do you know how to knock that up? I have examples but they are vastly more complicated than just two sliders.


#7

Try this:

metadata {
    definition (name: "Fan Setpoints", namespace: "RobinWinbourne", author: "RobinWinbourne", vid: "generic-switch") {
        capability "Switch"
        capability "Actuator"

        attribute "upperSetpointLevel", "string"
        attribute "lowerSetpointLevel", "string"

        command "setUpperSetpoint"
        command "setLowerSetpoint"
    }

    tiles(scale: 2) {
        standardTile("Title1", "device.Title1", inactiveLabel: false, width: 3, height: 1, decoration: "flat", wordWrap: false) {
            state "default", label:'Lower Setpoint'
        }
        standardTile("Title2", "device.Title2", inactiveLabel: false, width: 3, height: 1, decoration: "flat", wordWrap: false) {
            state "default", label:'Upper Setpoint'
        }
        standardTile("switch", "device.switch", inactiveLabel: false, width: 6, height: 3, decoration: "flat", canChangeIcon: false) {
            state "off", label: '${name}', action: "switch.on", icon: "https://cdn.rawgit.com/RobinWinbourne/devicetypes/master/fan3.png", backgroundColor: "#ffffff", nextState:"turningOn"
            state "on", label: '${name}', action: "switch.off", icon: "https://cdn.rawgit.com/RobinWinbourne/devicetypes/master/fan3.png", backgroundColor: "#ff9900", nextState:"turningOff"
            state "turningOn", label:'${name}', action:"switch.off", icon:"https://cdn.rawgit.com/RobinWinbourne/devicetypes/master/fan3.png", backgroundColor:"#ff9900", nextState:"turningOff"
            state "turningOff", label:'${name}', action:"switch.on", icon:"https://cdn.rawgit.com/RobinWinbourne/devicetypes/master/fan3.png", backgroundColor:"#ffffff", nextState:"turningOn"
        }
        controlTile("lowerSetpointLevel", "device.lowerSetpointLevel", "slider", height: 2, width: 3, range: "(0..100)", inactiveLabel: false) {
            state "default", action:"setLowerSetpoint", backgroundColor:"#AF1586"
        }
        controlTile("upperSetpointLevel", "device.upperSetpointLevel", "slider", height: 2, width: 3, range: "(0..100)", inactiveLabel: false) {
            state "default", action:"setUpperSetpoint", backgroundColor:"#AF1586"
        }
        main(["switch"])
        details(["switch","Title1","Title2","lowerSetpointLevel","upperSetpointLevel"])
    }
}

def installed() {
    log.debug "installed()"
    configure()
}

def updated() {
    log.debug "updated()"
}

def on() {
	sendEvent(name: "switch", value: "on", isStateChange: true, displayed: false)
}

def off() {
	sendEvent(name: "switch", value: "off", isStateChange: true, displayed: false)
}

def setLowerSetpoint(value) {
    log.trace "Setting Lower Setpoint to $value"
    Map levelEventMap = buildSetLevelEvent(value)
    sendEvent(levelEventMap)
}

def setUpperSetpoint(value) {
    log.trace "Setting Upper Setpoint to $value"
    Map levelEventMap = buildSetLevelEvent2(value)
    sendEvent(levelEventMap)
}

private Map buildSetLevelEvent(value) {
    def intValue = value as Integer
    def newLevel = Math.max(Math.min(intValue, 100), 0)
    Map eventMap = [name: "lowerSetpointLevel", value: newLevel]
    return eventMap
}

private Map buildSetLevelEvent2(value) {
    def intValue = value as Integer
    def newLevel = Math.max(Math.min(intValue, 100), 0)
    Map eventMap = [name: "upperSetpointLevel", value: newLevel]
    return eventMap
}

#8


#9

Is there a tutorial on how to knock that up?
That is something I could use many different things.
I’m new so I am just learning how to make pistons.


#10

Sure thing,
Don’t mind the variable, that has a different purpose, you can do this wihtout it.


#11

Robin, I put your script in my device handlers. Please tell me whats the next step. I have the piston I have the DH. i just need them to work together.


#12

See below, switch 18 is my version of the virtual device.


#13


Compared to what? I dont have a switch18. I cant find a virtual device.


#14

Hang on, have you installed the virtual device?

after adding the code to the device handlers tab in the ST IDE, go to my devices and add a new device, choose the ‘fan setpoints’ handler as the device ‘type’, something random for the network ID.

Note that the webcore dashboard and the ST IDE conflict with eachother when adding new devices manually, use a different browser.

After adding the device, go to the webcore smartapp in the ST mobile app, and add the device to webcore.

Then refresh the webcore dashboard and select your new device where it currently says ‘nothing selected’


#15


I used the laptop as IDE and my phone as webCoRE


#16

That is the error you get when webcore dashboard is running on the same browser… try clearing cookies or go to dashboard.webcore.co and click log out


#17

… or use an Incognito / Private browsing window…
(my preferred method)


#18

is that working again? last few times I tried it wouldn’t let me log in to the IDE

I use Chrome for everything, but crappy Microsoft edge for the IDE lol


#19

temp

has never failed for me… (Firefox)


#20

yep, working for me again now… they deployed incognito recognition software a while back and started blocking login attempts… but I read somewhere that Google were working on a fix to prevent detection… must be fixed now I guess