Announcement

Collapse
No announcement yet.

Lighting Motion Control w/ Delaying Off Event - inefficient or is there another way?

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

    Lighting Motion Control w/ Delaying Off Event - inefficient or is there another way?

    I do a LOT of events where motion sensors are used to turn on/off lights. 30% of them involve multiple motion sensors for a given light device (or set of light devices)



    I've been using the method:


    No Motion + Light On = Delayed Device action to turn Light Off in 5 min.
    &

    Motion Detected + Light On = Remove Delayed Device Action


    Unless I misunderstand, this causes an inherent inefficiency when using multiple motion sensors in the same space, controlling the same lights.
    ...The 'remove delayed action' would happen frequently even when its not needed... meaning, there is no delayed action set to occur.


    Is there a way to include Event Condition to check for existing delayed action? This would cause FAR fewer triggerings of the event.



    thx!

    #2
    Originally posted by Ltek View Post
    Is there a way to include Event Condition to check for existing delayed action? This would cause FAR fewer triggerings of the event.
    I'm not aware of any way to test for the existence of a delayed event or action. On the other hand, the question assumes that checking for the existence is more efficient than deleting a delayed event that doesn't exist. I'm don't think that's a good assumption. (For all we know, the delete action itself may include a check for existence as part of the algorithm.)
    Mike____________________________________________________________ __________________
    HS3 Pro Edition 3.0.0.548, NUC i3

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

    Comment


      #3
      Newbie here.

      Couldn't you use a counter to track the existence of a delayed event? Set it to 1 when the delayed event is created, change to 0 when run or removed?

      Comment


        #4
        Originally posted by Ltek View Post
        I do a LOT of events where motion sensors are used to turn on/off lights. 30% of them involve multiple motion sensors for a given light device (or set of light devices)



        I've been using the method:


        No Motion + Light On = Delayed Device action to turn Light Off in 5 min.
        &

        Motion Detected + Light On = Remove Delayed Device Action


        Unless I misunderstand, this causes an inherent inefficiency when using multiple motion sensors in the same space, controlling the same lights.
        ...The 'remove delayed action' would happen frequently even when its not needed... meaning, there is no delayed action set to occur.


        Is there a way to include Event Condition to check for existing delayed action? This would cause FAR fewer triggerings of the event.



        thx!
        Instead of a delayed event can you use the no motion for at least 5 minute?

        Motion Sensor "has been" no-motion "for at-least" 5 minutes
        AND IF light is ON
        Then turn off light


        With that there's no need to watch for or kill the delayed action. If there's no motion within the 5 minutes then the light turns off. If there is motion the light stays on.

        Comment


          #5
          HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

          Comment


            #6
            Originally posted by rprade View Post
            I have a script that goes through all my devices (2411) and sets or clears the command logging flag. The script runs, clears or sets the flag and creates a log entry for each device all within a single second. It would seem to me that motion triggers would have to be several seconds to several minutes (depending on motion timeout) apart. This would hardly tax a system that has to continually evaluate as many Event triggers as a busy system might have.
            Hi Randy. I'm curious why the need for the script? Are there some devices where it makes no sense to log or is it some other reason?

            Comment


              #7
              Originally posted by NetworkGuy View Post
              Hi Randy. I'm curious why the need for the script? Are there some devices where it makes no sense to log or is it some other reason?
              I turn off device logging unless I am troubleshooting a problem or event logic, to reduce log clutter. There is no need for device chatter in the log during normal operation. It is more difficult to spot problems in the log when there are dozens to hundreds of entries per minute. Any time a new device is added, logging is enabled by default. When a multi-child device is added there are a number of devices to be manually edited. I find it easier to disable all at once. This is done by setting a virtual device. I can also enable or disable command logging on Z-Wave, Arduino, Virtual or all devices. When I need to diagnose a problem I can enable logging on a single device, a device type or all device.

              I also do not have most events logged as well. This has worked well for my purposes.
              HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

              Comment


                #8
                Originally posted by rprade View Post
                I turn off device logging unless I am troubleshooting a problem or event logic, to reduce log clutter. There is no need for device chatter in the log during normal operation. It is more difficult to spot problems in the log when there are dozens to hundreds of entries per minute. Any time a new device is added, logging is enabled by default. When a multi-child device is added there are a number of devices to be manually edited. I find it easier to disable all at once. This is done by setting a virtual device. I can also enable or disable command logging on Z-Wave, Arduino, Virtual or all devices. When I need to diagnose a problem I can enable logging on a single device, a device type or all device.

                I also do not have most events logged as well. This has worked well for my purposes.
                Thanks, Randy - that makes good sense. I just hadn't thought about it like that. Is the script somewhere on the board where it could be used to do the same? And would you mind sharing your event logic too? Seems like a good tool for the toolbox to have around...

                Comment


                  #9
                  Originally posted by NetworkGuy View Post
                  Thanks, Randy - that makes good sense. I just hadn't thought about it like that. Is the script somewhere on the board where it could be used to do the same? And would you mind sharing your event logic too? Seems like a good tool for the toolbox to have around...
                  Here is the script to stop all logging:
                  Code:
                  sub Main(ByVal Parm As Object)
                  
                      Try
                          'run through the enumerator, remove the location two strings
                  
                          Dim dv As Scheduler.Classes.DeviceClass
                          Dim EN As Scheduler.Classes.clsDeviceEnumeration
                  
                          EN = hs.GetDeviceEnumerator
                  
                          Do
                              dv = EN.GetNext
                  
                                  hs.writelog("Log Stop", "Device: " & dv.Name(Nothing))
                                  dv.MISC_Set(hs, Enums.dvMISC.NO_LOG)
                             
                          Loop Until EN.Finished
                          hs.writelog("Log Stop", "All device logging disabled" ) 
                      Catch ex As Exception : hs.writelog("Device Clear", "Exception: " & ex.message)
                      End Try
                  
                  End Sub
                  To make it set command logging change dv.MISC_Set(hs, Enums.dvMISC.NO_LOG) to dv.MISC_Clear(hs, Enums.dvMISC.NO_LOG).

                  For specific device types, you need to only select devices matching a certain type. The script loops through all devices. Here is the one that stops Z-Wave logging
                  Code:
                  sub Main(ByVal Parm As Object)
                  
                      Try
                          'run through the enumerator, remove the location two strings
                  
                          Dim dv As Scheduler.Classes.DeviceClass
                          Dim EN As Scheduler.Classes.clsDeviceEnumeration
                  
                          EN = hs.GetDeviceEnumerator
                  
                          Do
                              dv = EN.GetNext
                              If dv Is Nothing Then Continue Do
                  
                              If dv.Interface(Nothing).ToLower = "z-wave" Then
                                  hs.writelog("Log ZDev Stop", "Device: " & dv.Name(Nothing))
                                  dv.MISC_Set(hs, Enums.dvMISC.NO_LOG)
                              End If
                  
                          Loop Until EN.Finished
                  
                      Catch ex As Exception : hs.writelog("Device Clear", "Exception: " & ex.message)
                      End Try
                  
                  End Sub
                  For other devices, change "z-wave" to another interface type.
                  HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

                  Comment


                    #10
                    Thanks Randy!

                    Comment

                    Working...
                    X