Announcement

Collapse
No announcement yet.

Complex thermostat best HS practices

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Complex thermostat best HS practices

    Hi All,

    New HS user here, but 6 years smart home veteran with over 180+ devices about to be migrated from Vera. I'm 3 days in to learning the ways of the new force but whilst this is my first post I'd like to understand a couple of things from those that have already done what I'm trying to do.

    So, I've got 26 eTRVs (Stella z) around the home - currently they all keep different rooms warm using different schedules and setpoints from a complex pleg routine. In addition to each device broadcasting their own local temperature there are other inputs such as outside temps and forecast temps........it's really evolved over time to be a nice 'keep your house warm and wife happy solution'

    So I've been playing around with HS and discovered two potentially useful plugins - BLStat and EasyTrigger and a reckon a combination of these would allow me to set different setpoints at different times of day to different devices. The downside to BLStat I can see is that there are only Wake, Day, Evening and Sleep schedules and ideally it would be great if there was also an afternoon setting....but that's not important right now.

    I can see help on the forum how to get setpoints set using these plugins and using a (rather nice) GUI schedule but my big question is how do you do this in HS ?......

    In pleg I have a condition that compares CurrentTemp with Setpoint temp on EVERY device. If ANY of these devices have a CurrentTemp < SetpointTemp then it sends a signal to the boiler to fire and pump water around the house. The same thing happens in reverse to stop the boiler when all rooms are up to temperature. Neither BLstat or Easytrigger seem to be able to do this out of the box so looking at a best practice here from some experience people as to how you've done it. See below for some of the logic to give you the idea for Heat_On

    "(aaHeating_core_hours AND (zzOutside_temp < zzOutside_Temp_Clip OR zzGarage_temp < zzOutside_Temp_Clip-2)) AND ( (Family_backSPT > Family_backCTEMP) OR (Family_leftSPT > Family_leftCTEMP) OR (Dining_roomSPT > Dining_roomCTEMP) OR (HallSPT > HallCTEMP) OR (Living_frontSPT > Living_frontCTEMP) OR (Living_backSPT > Living_backCTEMP) OR (LandingSPT > LandingCTEMP) OR (OfficeSPT > OfficeCTEMP) OR (ToiletSPT > ToiletCTEMP) OR (Master_backSPT > Master_backCTEMP) OR (MasterTVSPT > MasterTVCTEMP) OR (Master_ensuiteSPT > Master_ensuiteCTEMP) OR (Double_bedSPT > Double_bedCTEMP) OR (Kais_bedSPT > Kais_bedCTEMP) OR (Guest_ensuiteSPT > Guest_ensuiteCTEMP) OR (Keatons_bedSPT > Keatons_bedCTEMP))"

  • #2
    I'm not good with that syntax but I think I get the idea...what might be the best quick way of doing things is going straight into a script in HS. They are written in Visual Basic but there is no need to learn everything and you could just use basic if...then type syntax combined with a loop. This script then is set to run in an event on a recurring interval (every minute or so). This won't work out of the box but should give you an idea, the ArrOfDevices gets filled with the device references of the devices you wish to check. The SetPoint variable gets the device reference of the setpoint device in HS. HS then goes through this loop and checks each one in turn, when it gets to the end it would turn the heating on/off depending on what it found.

    Code:
    Sub Main(ByVal Parm As Object)
    Try
    
    Dim ArrOfDevices() As Integer = {298, 150, 158, 37, 140, 1759, 447, 2386, 2796}
    
    Dim SetPoint As Integer = 343
    
    Dim TurnHeatingOn as Boolean = False
    
    For Each SingleDevice As Integer In ArrOfDevices
    
    hs.writelog("HeatingCheck", "(Ref: " & SingleDevice & ") " & hs.devicename(SingleDevice) & " - Device Value: " & hs.devicevalueex(SingleDevice))
    
    If SetPoint < hs.devicevalueex(SingleDevice) Then
    
    hs.writelog("HeatingCheck", "Turn Heating On")
    TurnHeatingOn = True
    
    Else
    
    hs.writelog("HeatingCheck", "Turn Heating Off")
    TurnHeatingOn = False
    
    End If
    
    Next
    
    If TurnHeatingOn = True Then
    
    hs.writelog("HeatingCheck","Code To Turn On Here")
    
    Else
    
    hs.writelog("HeatingCheck","Code To Turn Off Here")
    
    End If
    
    Catch ex As Exception : hs.writelog("HeatingCheck", "Exception: " & ex.message)
    End Try
    My Plugins:

    Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
    Yeelight 3P | Nanoleaf 3P

    Comment


    • #3
      Cheers mrhappy, just typical for me that the very first thing I want to do on the new system involves code. Can I please ask a few other flying start questions in relation to this therefore:

      *) Where can I find the syntax and/or options for device variables that you refer to above e.g. "hs.devicevalueex(SingleDevice)" ?
      *) How does SetPoint variable get loaded with the actual setpoint from the device in the above script ?
      *) Where do scripts get loaded and/or called from ? Is this all part of an event configuration ?

      Comment


      • #4
        Originally posted by Daveyboy View Post
        In pleg I have a condition that compares CurrentTemp with Setpoint temp on EVERY device. If ANY of these devices have a CurrentTemp &lt; SetpointTemp then it sends a signal to the boiler to fire and pump water around the house. The same thing happens in reverse to stop the boiler when all rooms are up to temperature. Neither BLstat or Easytrigger seem to be able to do this out of the box so looking at a best practice here from some experience people as to how you've done it. See below for some of the logic to give you the idea for Heat_On
        FYI, EasyTrigger has some triggers/conditions to compare device values, see the user guide

        Comment


        • #5
          Thanks Spud - I did originally look at EasyTrigger and have now re-read the user guide again, it looks comprehensive and I'll certainly be able to use this in many other logic routines being migrated (Alarm, Hot Water etc) however, I am really struggling to see how it can be applied in this heating example, hence the call for help and/or best practices.

          I've zeroed in on the "Triggers/Conditions based on a group of devices" section as really I want to avoid a long list of if/then routines, however the premise of the logic doesn't appear to be supported with groups because they group relevant attributes together as opposed to comparing individual ones.

          Let me explain by example:

          TRV1 attributes.... Setpoint = 25, Current Temp =24
          TRV2 attributes.... Setpoint = 24, Current Temp =22
          .....n (there's 26 of these TRVs)

          If TRV1Setpoint >= TRV1CurrTemp AND TRV2Setpoint >= TRV2CurrTemp....etc then "close down the boiler actions"
          If TRV1Setpoint < TRV1CurrTemp OR TRV2Setpoint < TRV2CurrTemp...etc then "fire up the boiler actions" - THIS WOULD BE TRUE in this example

          I can obviously group all the TRVs together, and/or group the CurrTemp and/or the Setpoints but the challenge is each PAIR needs to be compared for each TRV. MrHappy's idea of using a script looks great but I do have the above Newby questions about scripts to progress. Ideally I would really like to use EasyTrigger to programmatically work this logic.


          Comment


          • #6
            Originally posted by Daveyboy View Post
            Thanks Spud - I did originally look at EasyTrigger and have now re-read the user guide again, it looks comprehensive and I'll certainly be able to use this in many other logic routines being migrated (Alarm, Hot Water etc) however, I am really struggling to see how it can be applied in this heating example, hence the call for help and/or best practices.

            I've zeroed in on the "Triggers/Conditions based on a group of devices" section as really I want to avoid a long list of if/then routines, however the premise of the logic doesn't appear to be supported with groups because they group relevant attributes together as opposed to comparing individual ones.

            Let me explain by example:

            TRV1 attributes.... Setpoint = 25, Current Temp =24
            TRV2 attributes.... Setpoint = 24, Current Temp =22
            .....n (there's 26 of these TRVs)

            If TRV1Setpoint >= TRV1CurrTemp AND TRV2Setpoint >= TRV2CurrTemp....etc then "close down the boiler actions"
            If TRV1Setpoint < TRV1CurrTemp OR TRV2Setpoint < TRV2CurrTemp...etc then "fire up the boiler actions" - THIS WOULD BE TRUE in this example

            I can obviously group all the TRVs together, and/or group the CurrTemp and/or the Setpoints but the challenge is each PAIR needs to be compared for each TRV. MrHappy's idea of using a script looks great but I do have the above Newby questions about scripts to progress. Ideally I would really like to use EasyTrigger to programmatically work this logic.

            Have you thought of using the valve percentage rather than temperatures and setpoints? In a scenario using radiator thermostatic valves, which were independently controlling radiators, I would control the boiler on/off by whether any valves are requiring heat. So for instance if any valve was above (say) 5% boiler ON, if all valves below 5% boiler OFF. You could do that fairly easily with EasyTrigger. Each StellaZ is controlling its own valve by the current temp and SetPoint.

            Of course with StellaZs this means polling the valve positions to keep the HS devices up to date but you are doing that with the temp in your method. Unless the firmware has changed in recent months/years, the StellaZs are very frustrating to work with due to having to poll for values and various limitations on this. I realise you have a big investment in these but devices such as the Eurotronics Spirit are much friendlier as they are instant (no waiting for wakeups) and can be configured to broadcast values when they change rather than requiring polling.

            Steve

            Comment


            • #7
              Steve - that's a genius idea !!

              It was never possible on Vera as the valve open percentage was never exposed in the UI in any form. I was surprised to see it a couple of days ago in my HS test bed and wondered how to leverage it. Am going to play with this as a best practice and post back here on the results.

              Comment

              Working...
              X