Announcement

Collapse
No announcement yet.

Manually execute the power fail routine

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

    Manually execute the power fail routine

    Is there a way to execute the power fail routine even though HS doesn't know the power failed? My HS machine is on a UPS which is backed up by a generator so HS should never lose power. Therefore, I would like to have an event or script that triggers the power fail routine when the generator stops. Is there a way to do this?

    Thanks.

    PS, I found where this has been asked before but I could not find where it had been answered. The replies were about alternative approaches (turning each device on or off individually with a script) but I really want to use the automatic power fail option and trigger it manually.

    #2
    This should do it in a script

    hs.PowerFailRecover
    -Rupp
    sigpic

    Comment


      #3
      Or entered as &hs.PowerFailRecover in the script action of an event (thus saving you from having to create a script file).
      Regards,

      Rick Tinker (a.k.a. "Tink")

      Comment


        #4
        Wow, that was easy. Thanks guys.

        Comment


          #5
          DC -

          A little off topic but maybe you can help me out. If you use the powerfail routine I'd be interested to know if it works as you might expect it to.

          Specifically, when I invoke the routine it causes all lights that should be set to a dim value (e.g. 80%) to zero. So when I observe the routine iterate through all of my devices I see all of my lamps and lights go to full brightness then to dark, and the HS GUI shows the dim value as zero instead of the intended setting.I'm using the latest HS release on a W2K box.

          Thanks much,

          Shawn

          Comment


            #6
            Shawn, I'm not sure I'll have any devices in my power fail routine that will be dimmed, but if I don't, I will do some experimenting and let you know what happens.

            Comment


              #7
              Can someone explain exactly how this feature works? I set it up and tested it and expected events to execute in chronological order, but it did not seem to work that way. For example, I have a script that turns landscape lights on at dusk and off at 1:00 AM. When I just manually executed power fail recovery, the lights ended up on. I expected the ON script to execute first, then the OFF script so I expected the end state to be off. (Actually, I would hope HS is smart enough to know it isn't necessary to turn them on and then back off, just to send the off command).

              Also, in order to get devices back to the proper state for when the power is restored, do I need to include the devices or the events that manipulate the devices in the power fail recovery? Or to put it another way, what is the difference between including a device and including all the events that turn that device on or off?

              Comment


                #8
                DC-

                If my recollection is correct, the power fail is supposed to iterate through all events and scripts from the predetermined time, set the GUI to reflect what the device status should be, and then generate the X10 sigs to set the devices to the status shown on the GUI.

                FWIW, I never have gotten the power fail option to work correctly, at least using the last couple of releases.

                Shawn

                Comment


                  #9
                  Shawn, it's not working "correctly" for me either. At least it's not working like it logically seems it should. I would think it would either:

                  A. Set devices to the same state they were in when the power failed

                  B. Or even better, set devices to the state they should be in based on events that should have run during the number of hours set in the "hours to synchronize from" value in the setup options.

                  Neither of these logical approaches seems to be how it works. For the second night in a row, we had an extended power outage. The outage was from 4:30 AM to 6:30 AM. After the power came back on, HS triggered the power fail routine when my emergency generator stopped. The PF routine turned on landscape lights that should not have been on in either case. They were off when the power failed (they go off at 1:00 AM) so option A should have left them off. In the last 24 hours (the value I have in the setup) events would have turned them on (at dusk) then off (at 1:00 AM) so the end state should have been off. I can't understand why the PF routine turned them on.

                  Maybe HS is confused because no events were actually missed since, as far as HS is concerned, the power didn't actually fail. HST - can you elaborate on how the PF routine actually works and explain why I'm getting the results I am? Thanks.

                  Comment


                    #10
                    In the PF options you set how many hours you want HS to go back. It then sets its internal clock back that many hours and then runs every event that should have run during that time. If you have it set to not run scripts, then anything turned on from a script will not be set properly. After this process is complete, it cycles through all your devices and sends out the proper commands to set them.

                    -Rich
                    website | buy now | support | youtube

                    Comment


                      #11
                      Rich,

                      Thanks for the clarification.

                      Any thoughts on why my lights are set to dim = 0 after the PF routine runs (when they should be set to dim=80% for example)?

                      Shawn

                      Comment


                        #12
                        You must mark the devices to be included in the powerfail recovery, and if you have a device marked to not be included but it is operated from a script, then scripts run during recovery can affect the device.

                        Devices that do not appear to recover correctly are typically those which do not support direct level set capabilities. Standard X-10 devices are set to 80% by sending a couple of dim commands after there is an assumption they are at 100%. If you do not have the device set to reset prior to a dim command being sent, then the outcome from a recovery may not be what you expected either.
                        Regards,

                        Rick Tinker (a.k.a. "Tink")

                        Comment


                          #13
                          Right after the PF runs, check your event log. HS will log all the events that is runs and also log all the devices it sets. Looking at this might tell you what is or is not happening.

                          -Rich
                          website | buy now | support | youtube

                          Comment


                            #14
                            Rich, then the best I can tell, there is a problem with the PF logic. My example is simple. I have two events that manipulate landscape lights:

                            1. Turn them ON at dusk
                            2. Turn them OFF at 1:00 AM

                            Power failed at 4:30 AM and was restored at 6:44 AM. The landscape lights were off when the power failed. I have 24 hours set in the PF options. Since HS did not know the power failed (because it did NOT fail for the HS server), I have an event that runs when my generator shuts down (that's how I know power was restored). This event simply invokes the PF routine using the &hs.PowerFailRecover command. At 6:44 this morning that event ran. I would have expected the PF routine to go back 24 hours and turn the lights on at 8:23 PM "simulated" time and off at 1:00 AM "simulated" time -- therefore the end state would be off. But that's not what happened -- the end state was on.

                            Here are the log entries from this sequence. The device in question is "Landscape Lights Back Flower Bed LV Lights". There is only an on command but no off command. The last command executed during the previous 24 hour period was off (at 1:00 AM).

                            06/17/04 06:44:25 AM~!~Info~!~Synchronization complete, updating devices
                            06/17/04 06:44:25 AM~!~Info~!~Updating device: Landscape Lights Front Sidewalk Moonlights (H1) To-> Off
                            06/17/04 06:44:25 AM~!~Info~!~Updating device: Landscape Lights Potty Area Lights (H3) To-> Off
                            06/17/04 06:44:25 AM~!~Info~!~Updating device: Landscape Lights Circle Drive Moonlights (H2) To-> Off
                            06/17/04 06:44:25 AM~!~Info~!~Updating device: Landscape Lights Park Moonlights (H4) To-> Off
                            06/17/04 06:44:25 AM~!~Info~!~Updating device: Landscape Lights Circle Drive LV Lights (H5) To-> Off
                            06/17/04 06:44:25 AM~!~Info~!~Updating device: Landscape Lights Front Flower Bed LV Lights (H9) To-> On
                            06/17/04 06:44:25 AM~!~Info~!~Updating device: Landscape Lights Back Flower Bed LV Lights (H11) To-> On
                            06/17/04 06:44:25 AM~!~Info~!~Updating device: Landscape Lights Back Moonlights (H12) To-> Off
                            06/17/04 06:44:25 AM~!~Info~!~Updating device: Water System Electric Water Heater (F1) To-> On
                            06/17/04 06:44:25 AM~!~Info~!~Updating device: Water System Water Circulation Pump (G2) To-> On
                            06/17/04 06:44:25 AM~!~Info~!~Device update complete

                            Comment


                              #15
                              What do the log entries look like before the "Synchronization complete" entry. You should see it executing any events that are set to trigger within the PF time frame. You should see the event that turns the lights off being triggered. If not, check that event and make sure the PF checkbox is checked.

                              -Rich
                              website | buy now | support | youtube

                              Comment

                              Working...
                              X