Updating Min and Max Temperature. How can I do this?

I would like to know, and be able to display on a dashboard, daily Min and Max outside temperatures from my Outside Sensor and am looking for tips as the best way to achieve this. As a first attempt I set up 2 Virtual Temp sensors for Min and Max. I then started to create a trigger in RM that ran when Outside Temp is above Max and another for below Min. That bit is easy, but I can't then find a way to set the value of the Virtual Temp Sensor to that of the Outside Sensor. Is there a way to do that, or is there a better way to do this?

Take a look at attribute tile.

I was thinking about this today as I might have a similar requirement

I’m sure it would be easy enough to take the input from a temperature sensor (or a group of them to get an average) and record the highest and lowest readings, with a reset at midnight.
You just need a little app and a driver to be able to display it on a dashboard.

Andy

1 Like

Just thought I'd revisit this as it's still eluding me. I have tried using Global Variables and can get them to store the correct values but can't display them on a dashboard.

Even with all the new features of RM3.0 I can't set a virtual temperature sensor's value to that of another temperature sensor or a Global Variable.

It feels like this should be a relatively simple thing to do, but whichever way I have tried it I hit a snag.

To recap, I want to be able to monitor the temperature value of my Outside sensor (Aeotec multisensor 6), and save it's max and min values to something that can be displayed on a dashboard.

Anyone got any clever ideas?

I attempted to do this using a Trigger in RM 3.0.

  • The trigger is if Temperature1 != Temperature2
  • The Action is "Custom Action" where I selected the Temperature2 virtual device, and then used its 'setTemperature()' command. Unfortunately, I cannot seem to use any sort of variable (e.g. %value%) as the parameter to the setTemperature() command in the Custom Action.

I even tried using a Global Variable to temporarily hold the value of Temperature1, and then tried to pass that GV as the parameter of the setTemparture() command.

I think we might need @bravenel's expertise to tell us if this can be done with RM 3.0 or not. He might be able to add support for variables to be passed as parameters to commands in the new "Custom Action" feature of RM 3.0. (or at least explain what I have done wrong in my attempt to do so! :wink: )

1 Like

This has been implemented, and will be in the next release. I'm not sure that there will be another hot fix for 2.0.9, so this may not be until 2.1.0. That release allows GVs to be used for any parameter to a custom action.

2 Likes

Instead of using GVs when they are allowed in custom actions, I have come up with an alternative which is working well for me so far.

I've created a custom thermostat driver for a virtual thermostat that uses the heatingSetpoint and coolingSetpoints to record max and min temperatures. I use Andy's @Cobra Average Temp app to send the value of my outside sensor to the temperature value of the virtual thermostat. My driver simply looks at the current temperature value and if it is less than the coolingSetpoint (min) or greater than the heatingSetpoint (max), adjusts them accordingly. Because the setpoints are standard parameters they can be displayed easily and reset at midnight using standard commands in RM (I set them to extremes so that at the next temperature update they will both get automatically updated to the current value). If you wanted weekly/monthly/yearly max/mins too you could create multiple virtual stats using the same driver and just reset the values at the appropriate interval instead of daily.

This is the code. You are welcome to try it.

metadata {
// Thermostat Driver that uses heatingSetpoint and coolingSetpoint to store max and min temperatures 
definition (name: "GT Thermostat MaxMin01 ", namespace: "GT MaxMinStat", author: "GT") {
capability "Thermostat"
capability "Temperature Measurement"
capability "Sensor"
capability "Actuator"

command "setTemperature", ["number"]
}
}

def installed() {
sendEvent(name: "temperature", value: 18, unit: "°C")
sendEvent(name: "heatingSetpoint", value: -40, unit: "°C")
sendEvent(name: "coolingSetpoint", value: 40, unit: "°C")
sendEvent(name: "thermostatSetpoint", value: 20, unit: "°C")
sendEvent(name: "thermostatMode", value: "off")
sendEvent(name: "thermostatFanMode", value: "auto")
sendEvent(name: "thermostatOperatingState", value: "idle")
}

def parse(String description) {
}

def evaluate(temp, heatingSetpoint, coolingSetpoint) {
//log.debug "evaluate($temp, $heatingSetpoint, $coolingSetpoint)"
if(temp.toBigDecimal() < coolingSetpoint.toBigDecimal()){
sendEvent(name: "coolingSetpoint", value: temp)
}
if(temp.toBigDecimal() > heatingSetpoint.toBigDecimal()){
sendEvent(name: "heatingSetpoint", value: temp)
}


}

def setHeatingSetpoint(Double degreesC) {
//log.debug "setHeatingSetpoint($degreesC)"
sendEvent(name: "heatingSetpoint", value: degreesC)
evaluate(device.currentValue("temperature"), degreesC, device.currentValue("coolingSetpoint"))
}

def setCoolingSetpoint(Double degreesC) {
//log.debug "setCoolingSetpoint($degreesC)"
sendEvent(name: "coolingSetpoint", value: degreesC)
evaluate(device.currentValue("temperature"), device.currentValue("heatingSetpoint"), degreesC)
}

def setThermostatMode(String value) {
sendEvent(name: "thermostatMode", value: value)
evaluate(device.currentValue("temperature"), device.currentValue("heatingSetpoint"), device.currentValue("coolingSetpoint"))
}

def setThermostatFanMode(String value) {
sendEvent(name: "thermostatFanMode", value: value)
evaluate(device.currentValue("temperature"), device.currentValue("heatingSetpoint"), device.currentValue("coolingSetpoint"))
}

def off() {
sendEvent(name: "thermostatMode", value: "off")
evaluate(device.currentValue("temperature"), device.currentValue("heatingSetpoint"), device.currentValue("coolingSetpoint"))
}

def heat() {
sendEvent(name: "thermostatMode", value: "heat")
evaluate(device.currentValue("temperature"), device.currentValue("heatingSetpoint"), device.currentValue("coolingSetpoint"))
}

def cool() {
sendEvent(name: "thermostatMode", value: "cool")
evaluate(device.currentValue("temperature"), device.currentValue("heatingSetpoint"), device.currentValue("coolingSetpoint"))
}

def auto() {
sendEvent(name: "thermostatMode", value: "auto")
evaluate(device.currentValue("temperature"), device.currentValue("heatingSetpoint"), device.currentValue("coolingSetpoint"))
}

def fanAuto() {
sendEvent(name: "thermostatFanMode", value: "auto")
evaluate(device.currentValue("temperature"), device.currentValue("heatingSetpoint"), device.currentValue("coolingSetpoint"))
}

def fanOn() {
sendEvent(name: "thermostatFanMode", value: "on")
evaluate(device.currentValue("temperature"), device.currentValue("heatingSetpoint"), device.currentValue("coolingSetpoint"))
}

def fanCirculate() {
sendEvent(name: "thermostatFanMode", value: "circulate")
evaluate(device.currentValue("temperature"), device.currentValue("heatingSetpoint"), device.currentValue("coolingSetpoint"))
}

def setTemperature(value) {
def ts = device.currentState("temperature")
sendEvent(name:"temperature", value: value)
evaluate(value, device.currentValue("heatingSetpoint"), device.currentValue("coolingSetpoint"))
}

@bravenel’s latest update to RM allows you to easily copy one temperature value into another using custom action. I just tried the following and it works great. Thanks Bruce!

1 Like

Dan. I'm just playing around with this on the latest version and I don't quite understand how you get to the "setTemperature(%value%) on Test Temperature 2" Action.

I've set up my GVs and have gone into custom action and get to the setTemperature part for my virtual sensor, but how do I then set that to my relevant GV? Do I need to have set something else up first? I've tried %value% and %GVname% as the parameter value but both give "bad value" errors. See below:

Try using a String variable type. That solved it for me.

Does that work though for decimal temperatures?

Bruce has confirmed that there is a bug in setting a value to a decimal value GV, so I might just wait for the fix. I'm only playing around with it anyway.

Yes, works great with decimal values. I tested positive and negative using a pair of virtual temperature sensors.

1 Like

Hello! Sorry for the up,

did you manage to make the minimum and maximum temperature display work? I'm looking for that too