Extreme Variations of Temperature and how to deal with it

So first off. I live in Sydney and right now our Volunteer Rural Fire Team are doing an amazing job of trying to control all the forest fires we have around us. The fires have been going on for months now and the so much smoke cloud we barely have a clear day now.

What also happens here is we get days of 35C plus and then a cold change comes thru is very extreme winds. Today we dropped from 40C to 25c within an hour.

In Oz most of us have split aircon vs full house aircon (more found in houses vs apartments). I found got a Sensibo control unit which is does have some good support in OpenHab, but had some issue so I took the big dive into NodeJs and followed up on some great work and produced a NodeRed node for it (new update released).

My big question behind all that is do others have work to share on how they deal with HVAC and extreme temperature changes, along with checking if all doors and windows are closed. I have sensors on doors but not yet done the full work out of how it could work and also when to tell the system to stop as the outdoor temp is now lower than indoor. Over the last few days that has happened many times.

For example today was 40c ourside, as I left the house the weather change hit and we dropped to 28, the as night fell down to a very comfortable 26 and I have the house open with only the fans running and now cooling system running.

I use Openhab and Node-Red. Sensors are a combinatino of Z-wave and also now Zigbee via ZigbeeMQttt which I have translated into OpenHab I am finding it faster to use Node-Red directly.

Many thanks all.

Please post the link
Or even better write a post in the solution category with the link and how to use it

Thanks

I love in the mountains and have similar drops in temperature, though it’s usually more like 26 C to -7 C.

The basic approach I use is to have a Rule trigger when ever an important piece of information changes: target temp for the HVAC is adjusted, outside temp changes, one of the indoor temps change, etc. As you can imagine, this Rule runs a lot. Then based on what ever the current conditions are it makes the decision about what to do. In my case, if it is cooler in the basement than the top floors of the house and it is warmer in the top floors of the house than it is outside and its warmer than the target temp, turn on the house fan to bring the cooler air from the basement to the upper floors. We don’t have AC but this makes a fie degree F difference which is usually enough…We don’t include the door/window states into the calculation but that would just be a simple additional set of checks.

Finally, I have a latch on the Rule to prevent it from changing the state of the HVAC too fast, in this case faster than very 5 minutes.

from core.rules import rule
from core.triggers import when
from org.joda.time import DateTime
from core.utils import sendCommandCheckFirst
from personal.util import hysteresis

@rule("Fan timestamp",
      description="Update the fan's last change timestamp",
      tags=["hvac"])
@when("Item aNest_Fan changed")
def fan_time(event):
    """Set a timestamp whenever the fan changes state"""

    fan_time.log.info("The house fan turned {}"
        .format(str(event.itemState).lower()))
    if not isinstance(event.itemState, UnDefType):
        events.postUpdate("vNest_Fan_LastChange", str(DateTime.now()))

@rule("Fan control",
      description="Turn on the fan when necessary",
      tags=["hvac"])
@when("Item UpperFloorsTemps changed")
@when("Item LowerFloorsTemps changed")
@when("Item aNest_Fan changed")
@when("Item aNest_Fan changed")
def fan_ctrl(event):
    """Determine if the fan needs to turn on.

    If the highest temp among the main floor and top floor sensors is higher
    than the highest temp among the main floor and basement sensors and it's
    warm outside, turn on the house fan. Regardless of the temp differential, we
    do not want to turn on the fan when it's cold outside.

    However, do not command the fan if it has changed state in the past five
    minutes.
    """
    # TODO, treat each temp sensor as it's own thermostat and control the fan
    # and heat based on min and max thresholds for each.

    # Wait at least five minutes before changing the fan state after the last
    # change.
    last_change = DateTime(str(items["vNest_Fan_LastChange"]))
    now = DateTime.now()
    if (not isinstance(last_change, UnDefType)
            and now.minusMinutes(5).isBefore(last_change)):
        return

    # Get the target and upper and lower temps, all are QuantityTypes:
    #   - upper is the maximum of the top floor and main flor temps
    #   - lower is the minimum of the main floor and basement temps.
    target       = items["aNest_TargetTemp"]
    target_lower = target.subtract(QuantityType(u"1 °F"))
    upper_floors = items["UpperFloorsTemps"]
    delta        = upper_floors.subtract(items["LowerFloorsTemps"])
    outside      = items["vWeather_Temp"]

    # Determine if the fan should be on or off: upper is higher than lower and
    # the target and it's warm outside.
    fan_state = str(items["aNest_Fan"])
    if (delta > QuantityType(u"0 °F")
            and upper_floors > target
            and outside > QuantityType(u"60 °F")):
        fan_state = "ON"
    elif upper_floors < target_lower:
        fan_state = "OFF"

    # Change the fan state
    sendCommandCheckFirst("aNest_Fan", fan_state)
1 Like

Hi @vzorglub
Thanks for the feedback. I did list the node red Sensibo node I built over in the in the Sensibo Binding forum

Since I built the NodeRed node there has been an update to the OpenHab binding that is now working. It hopefully gives an option to non OpenHab users who also don’t use Home Assistant. I should have put the link into my question for good reference.

Overall both options work either via the OpenHab Binding or via Node Red. Each will work.

1 Like

@rlkoshak
Thanks as always for sharing the code base you have and I really appreciate the answer and code. While I’m writing this we have been sweltering thru a day of 40c plus and now the front has hit and withing 10 mins the wind and temp have dropped.

Extra happy that you are now using the Python engine which will be a great lead in for me to start new rules in that. I’ve been using your TOD example rule for many years now (works so well I just can’t see the need to change it to Node Red), so very excited to start playing around with the NGRE and Python which I’ve spent way to much time with.

Many thanks,

Dd

1 Like

The above is python, not JavaScript. JavaScript will be supported in OH 3 but python will be the default.

There is a reusable version of that submitted to the Helper Libraries that uses Ephemeris and doesn’t require copy/paste/edit to use, just define some groups and items.

1 Like