Announcement

Collapse
No announcement yet.

"Smart Actions" possible? Do not set device if it is already set

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

    "Smart Actions" possible? Do not set device if it is already set

    I created this term to mean...
    "Device values/states are checked before actions are executed. If a device state is currently the same as what the action would set it to be, it is skipped and no action is taken on that device"

    Example:

    Event | tells HS3 to set DEVICE = 1

    HS3 | checks DEVICE in HS3 cache (does not query device)
    | if value already = 1 then NoOp (no operation takes place) and HS3 moves on

    I'm find TONS of actions where my devices are already in the state being set. And HS3 sends commands to lock, close garage doors, etc -- see the quote below, where ONLY 1 of those 34 commands needed to be sent

    Benefits of doing this...
    Event execute faster
    Lower use of computer resources
    Less traffic, and faster protocol response (Zwave/Insteon/etc)
    Less battery drain on devices


    This is especially beneficial when we use House Modes where 10, 20, 30 devices are being set and/or checked.


    Jul-16 3:34:27 PM Device Control Device: Security Status House Mode to Away (1)
    Jul-16 3:34:27 PM Device Control Device: Front Yard Driveway Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Main Playroom Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Main Mudroom Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Main Living Room Mantle Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Main Living Room Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Main Living Room Light 2 to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Main Living Room Fan to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Main Kitchen Table Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Main Kitchen Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Main Kitchen Light 2 to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Main Kitchen Island Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Main Kitchen Espresso Machine to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Main Foyer Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Main Dining Room Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Garage Garage Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Front Yard Entry Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Bedrooms Tylers Room Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Bedrooms Noahs Room Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Bedrooms Master Night Stand Lights to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Bedrooms Master Dresser Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Bedrooms Master Bath Vanity Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Bedrooms Master Bath Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Bedrooms Guest Room Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Basement Office Office Heater to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Basement Office Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Basement Media Room Sub to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Basement Media Room Seating to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Basement Media Room Main Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Basement Media Room Back Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Backyard Patio Outlet to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Backyard Patio Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Backyard Deck Light to Off (0)
    Jul-16 3:34:27 PM Device Control Device: Door Lock Foyer Lock to Lock (255)
    Jul-16 3:34:27 PM Device Control Device: Door Lock Mudroom Lock to Lock (255)

    #2
    Originally posted by Ltek View Post
    I created this term to mean...
    "Device values/states are checked before actions are executed. If a device state is currently the same as what the action would set it to be, it is skipped and no action is taken on that device"

    Example:

    Event | tells HS3 to set DEVICE = 1

    HS3 | checks DEVICE in HS3 cache (does not query device)
    | if value already = 1 then NoOp (no operation takes place) and HS3 moves on

    I'm find TONS of actions where my devices are already in the state being set. And HS3 sends commands to lock, close garage doors, etc -- see the quote below, where ONLY 1 of those 34 commands needed to be sent

    Benefits of doing this...
    Event execute faster
    Lower use of computer resources
    Less traffic, and faster protocol response (Zwave/Insteon/etc)
    Less battery drain on devices


    This is especially beneficial when we use House Modes where 10, 20, 30 devices are being set and/or checked.
    "Smart Actions" as you refer to them are not native. Back in the bad old days of Z-Wave, I made a special group of events that would only control a device if it was not already in that state. Z-Wave devices would frequently end up in an unknown state due to command confusion. This has not been a problem for more than a year.

    They all looked like

    IF This event is manually triggered
    AND IF Device XXX is not On
    Set device XXX to On

    Your "Smart Action" would have to do a similar evaluation on every action.

    Then I would call that event when controlling devices with events. I have all but eliminated the use of those events for several reasons
    1. There is absolutely no perceptible improvement in speed of event execution or control, even in my house asleep event that controls 30+ devices
    2. Event actions have such a small CPU footprint that there would be no measurable impact on computer resources. Evaluating an event probably takes as much CPU power as executing an action.
    3. If a device control action is dependent upon the status in HomeSeer, you could have a device that is out of sync (due to lack of instant status, device controlled when HomeSeer is down, etc.) would fail to be controlled as desired. I mitigated that by using "This device is not equal to...".


    I don't understand the comment about battery life since (other than thermostats), I cannot think of any battery operated devices that are controlled, most only report.

    I don't think your idea is bad, it just wouldn't really make any perceivable difference in the function of HomeSeer and the down side is that it would not force a device into the correct status if it was out of sync.
    HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

    Comment


      #3
      Originally posted by rprade View Post
      "Smart Actions" as you refer to them are not native. Back in the bad old days of Z-Wave, I made a special group of events that would only control a device if it was not already in that state. Z-Wave devices would frequently end up in an unknown state due to command confusion. This has not been a problem for more than a year.

      They all looked like

      IF This event is manually triggered
      AND IF Device XXX is not On
      Set device XXX to On

      Your "Smart Action" would have to do a similar evaluation on every action.

      Then I would call that event when controlling devices with events. I have all but eliminated the use of those events for several reasons
      1. There is absolutely no perceptible improvement in speed of event execution or control, even in my house asleep event that controls 30+ devices
      2. Event actions have such a small CPU footprint that there would be no measurable impact on computer resources. Evaluating an event probably takes as much CPU power as executing an action.
      3. If a device control action is dependent upon the status in HomeSeer, you could have a device that is out of sync (due to lack of instant status, device controlled when HomeSeer is down, etc.) would fail to be controlled as desired. I mitigated that by using "This device is not equal to...".


      I don't understand the comment about battery life since (other than thermostats), I cannot think of any battery operated devices that are controlled, most only report.

      I don't think your idea is bad, it just wouldn't really make any perceivable difference in the function of HomeSeer and the down side is that it would not force a device into the correct status if it was out of sync.
      I understand your point and Clearly this is not critical, but would be nice to see if it made any difference. I would think less wireless traffic would cause faster device responses

      protocol communications are bidirectional... How much does 30 simultaneously queries cause, I don't know. I always think less is more

      I've had zwave for 5+, and insteon for 15 years, never seen them out of sync. I Have about 50 physical devices.

      Battery devices are mainly door locks that would be an issue with drain.


      Sent from my SAMSUNG-SM-G935A using Tapatalk

      Comment


        #4
        I suggested that there could be a place for the condition to be put on the event action, that did not appear to be acknowledged so guess that they had other ideas. It would be basically a nested if command but I would say there was only one level needed rather than creating a hugely nested mess.

        I then toyed with the idea of adding the functionality into another plugin but there would only ever be the CAPI actions that another plugin could query, anything non-CAPI could not be found and triggered by a plugin so I left it on the back burner.

        Comment


          #5
          I agree that I like to minimize unnecessary zwave traffic.

          Luckily this is something you can do inside a script. When you use
          Dim oldvalue As Integer = hs.DeviceValue(defref#) You are getting the cached status of the device, the device itself is not being polled. Sure you are using CPU cycles in the script but that's negligible.

          Its fairly simple to ensure that if oldvalue = newvalue then don't update the device value. Again CPU cycles are used but negligible.
          HS4 Pro on Shuttle NC10U, Win10; Z-NET
          Number of Devices: 1005
          Number of Events: 293

          Plug-Ins: BLLock, DirecTv, EasyTrigger, Honeywell WiFi Thermostat, Marquis monoprice Amp, MeiHarmonyHub, PHLocation2, Pushover 3P, UltraM1G3, rnbWeather, Worx Landroid, Z-Wave

          External applications: Homebridge-homeseer, Geofency, EgiGeoZone.

          Comment

          Working...
          X