No announcement yet.

Not sure where to find.....

  • Filter
  • Time
  • Show
Clear All
new posts

    Not sure where to find.....

    I'm not sure where to find what I'm looking for. It may be part of a plugin, or maybe it needs to be scripted, so I don't know where to look, I just don
    t want to reinvent the wheel. Maybe I'm looking in the wrong place.

    I'm looking for some way to take a "snapshot" of a device (parent and child devices) on a set schedule, maybe once a week, and then using that snapshot, run an event that will reset that device back to whatever the last snapshot was.

    More specifically- I have a thermostat I'd like to snapshot once a week. If the power goes out, I'd like to reset that thermostat to whatever it was before the power went out. If I need to record the individual child devices (setpoint, mode, fan, etc), no problem.

    I have the thermostat, I have a lines power monitor. I have an event already created and working that will react both when the power goes out and when it comes on. I just need a way to snapshot the thermostat.

    Any ideas?

    I am not understanding the underlying need. A thermostat is represented in HS as a set of devices. On a power outage HS does not loose its memory of its devices. If your thermostat does then all you should need is a periodic event to set the thermostat to the values contained in HS.


      I follow what you're saying, but the only way I can see to do that is-

      IF power loss happens (trigger)
      THEN Control a Device
      Thermostat mode to heat or cool
      Thermostat heating or cooling setpoint to XX
      Thermostat fan to on/off/auto

      I want it to come back to what it was before the power went off, not whatever this event would set it to. There's no option for "previous state", and I don't want to have to change the event every time I make an adjustment on the thermostat. I'd be ok with creating a handful of events for different times of the year, but I don't see any option in the event creator to run whatever event based on calendar date.

      If I create an event to run periodically, it will set the thermostat to whatever the event values are. If I adjust the thermostat, then I need to adjust the event to match.

      The thermostat settings only get changed maybe once a month, but occasionally I'll need to adjust modes once a week or more based on the outside weather. It just seems like a whole bunch of extra effort to adjust both the thermostat and whatever events I've got set up whenever I make a change.


        Every hour set the thermostat to whatever is in the device for the thermostat. It has no bearing on power lost or not.

        This actually should be handled by the plugin that manages the thermostat. Power loss implies HS restart so when thermostat plugin starts it should set thermostat to prior settings in HS.


          I can think of a couple ways using EasyTrigger plugin. One would be to create a duplicate set of control devices to match your tstat. Use "set device to another device" to set your duplicates to match the tstat devices. You could do it on a schedule, anytime one of them changes, etc. Then on power recovery reverse the process. A second way would be ET's push/pop function. I've not used it, and not sure whether it's documented anywhere, but I believe it would fit this purpose.


            You can write a script to save the values to an .ini file if you don't have or don't want to buy EasyTrigger. When the system starts, it can set the device for the ini file. You can also set defaults. These are the "540", "960" and "1" in the hs function call.

            Here are snippets from my Startup.vb

            Dim FQPN As String = "WateringXXXX.ini"
            Dim ZoneTime As Integer = hs.GetINISetting("Watering", "ZoneTime", "540", FQPN) 'Create a default
            Dim FlowerTime As Integer = hs.GetINISetting("Watering", "FlowerTime", "960", FQPN)'Create a default
            Dim sCycles As Integer = hs.GetINISetting("Watering", "SoakCycles", "1", FQPN) 'Create a default

            I write the values to global variables but you could write them to a device as well

            'Create the global variables needed
            '7-3-2019 Add Watering Global variables.

            errst = hs.CreateVar("zntime")
            errst = hs.CreateVar("znflwrtime")
            errst = hs.CreateVar("soakcycles")

            errst = hs.SaveVar("zntime",ZoneTime)
            errst = hs.SaveVar("znflwrtime",FlowerTime)
            errst = hs.SaveVar("soakcycles",sCycles)

            I write to the ini file from an event triggered by hstouch action. This is to control the time to water the lawn and flowerbeds. Here is what the ini file looks like.



              cc4005 and AllHailJ

              It looks like the EasyTrigger will do just what I need. I'm just getting into scripting things, so I can try my hand at that first, and go for the EasyTrigger if I can't get it.



                I think the best solution might be get a thermostat that either runs on batteries(they usually last many months if not a year or more) or has battery backup. I use the Nortek GIG 2 (GC-TBZ48) z-wave thermostat that uses battery or 24VAC from the furnace and I think it even hold the settings if the power is removed-in Non-Volitile Memory).


                  Pull the thermostat cover off and see if it has a battery.....