Announcement

Collapse
No announcement yet.

Best event structuring for my scenario

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

  • Best event structuring for my scenario

    Hi folks - open to thoughts on how to optimize my events for the following scenario.

    I use Blue Iris (camera recording) and there are different profiles that I use to set what should be recording when (essentially). Profiles I have:

    1. At home
    2. Away - Normal
    3. Away - Adjust for shadows (e.g. between 1-3 PM based on the position of the sun and my trees)
    4. Away - Adjust for night shadows (e.g. 30m after sunset to sunrise)
    5. Away - Landscapers (e.g. Thursdays between 12 and 2 PM)

    I use PHLocation to know when I'm home or away. I have a virtual device I use to know whether Blue Iris should be Home or Away (this is set by PHLocation events)

    So now I need to set my events for setting location. I can see the following approaches:

    A. I could make duplicate event groups where the event conditions specify the events only run between certain times, and then I can have a group of events to switch profiles on my schedule.
    B. I could make a single event group with multiple copies of each event and specify the timing in the if condition. I would also need events to switch between profiles based on my schedule.
    C. Maybe something else?

    Open to thoughts for what people think would be easiest to configure and manage.

  • #2
    The way I've handled similar situations is to set up the individual events, but using conditions instead of triggers so that you can reset them anytime (either by triggers, manually, based on other events, or on a recurring "safety net" schedule).

    To simplify the logic, I extended your landscapers and shadows times to match, though it would be certainly possible to set up more detailed triggers and conditions if you don't want to use the expanded window based on video quality or security concerns.

    Create one group with 5 events representing the conditions for when each profile should be active (but not the triggers):
    Blue Iris Home Profile = IF run manually AND virtual device has a value of "at home"
    Blue Iris Away - Normal Profile = IF run manually AND virtual device has a value of "away"
    Blue Iris Away - Shadows Profile = IF run manually AND day is M,T,W,F AND time is between 12-3 pm AND virtual device has a value of "away"
    Blue Iris Away - Night Shadows Profile = IF run manually AND time is 30 minutes after sunset AND time is before sunrise AND virtual device has a value of "away"
    Blue Iris Away - Landscapers = IF run manually AND day is Th AND time is between 12-3 pm AND virtual device has a value of "away"



    Then create a "Set Blue Iris Profile" that has the triggers for each change and then tries to run all of those events, but only if the conditions are met:
    IF virtual device changes and becomes "Home"
    OR virtual device changes and becomes "Away"
    OR day is weekday AND time is 12:00 PM
    OR day is weekday AND time is 3:01 PM
    OR time is 30 minutes after sunset
    OR time is sunrise

    THEN
    Run Event "Blue Iris Home Profile" (if the conditions are met)
    Run Event "Blue Iris Away - Normal Profile" (if the conditions are met)
    Run Event "Blue Iris Away - Shadows Profile" (if the conditions are met)
    Run Event "Blue Iris Away - Night Shadows Profile" (if the conditions are met)
    Run Event "Blue Iris Away - Landscapers" (if the conditions are met)



    The benefit of this approach is that even if you leave at 12:15 or return at 2:45 or leave after sunset, it will always end up set to the right value without having to have a whole laundry list of triggers for all those overlapping conditions.

    NOTE: you may need to put in some short "Wait" actions in between each "run event", because it will temporarily set it to "away - normal" even if it's between 12-3 pm, and I don't know how the Blue Iris stuff (plugin?) will handle having two profiles set in such quick succession.
    Last edited by shill; September 1st, 2018, 01:49 PM. Reason: Removed the reference to the group conditions, which I decided weren't needed after all.

    Comment


    • #3
      Wow - need a bit of time to internalize this. Didn't realize you could group an conditions with an OR. That helps.

      In the set blue iris profile....what group conditions are you referring to? I understand the "if conditions are met" on the events being called. But did I miss where you set group conditions?

      Comment


      • #4
        Originally posted by larrywal32 View Post
        Wow - need a bit of time to internalize this. Didn't realize you could group an conditions with an OR. That helps.

        In the set blue iris profile....what group conditions are you referring to? I understand the "if conditions are met" on the events being called. But did I miss where you set group conditions?
        This is one of the worst parts about the HS3 interface. In HS1 and HS2, "triggers" and "conditions" were better delineated. In HS3, the "trigger" is the thing at the top of the list ("if run manually"), keeping in mind that a new "trigger" starts if you use an "OR". "Conditions" are all the things you add to that trigger (via "AND" statements). The only thing that will cause an event to fire on its own is the trigger. When that happens, it checks the conditions and only does the "THEN" part if the conditions are true.

        So in my examples, anything after an "IF" or an "OR" is a trigger, anything after an "AND" is a condition.

        The "Run Event" advanced options allow you to check a box for "only if the conditions are met", which means it will ignore the trigger when you run that event, but it will still check the conditions. If they're not met, it won't fire that event.

        This is one of the most robust and powerful ways to solve complex problems, but as always, the more flexible something is, the more complicated it tends to be!

        Comment


        • #5
          Thanks - totally makes sense and is familiar to me from a programming standpoint (I actually wish I had more flexibility :P).

          The only item I'm still a bit confused about....for my scenario, what group conditions would you create? I don't see you having listed any; which would make the "AND group conditions are true" item in each of the four OR triggers you listed unnecessary. I think.

          Comment


          • #6
            Originally posted by larrywal32 View Post
            Thanks - totally makes sense and is familiar to me from a programming standpoint (I actually wish I had more flexibility :P).

            The only item I'm still a bit confused about....for my scenario, what group conditions would you create? I don't see you having listed any; which would make the "AND group conditions are true" item in each of the four OR triggers you listed unnecessary. I think.
            Sorry about that - I had to rewrite that whole post 4 times because I kept hitting Ctrl-Z to undo something while formatting it because I didn't learn my lesson the first time I did that - it reset almost my whole post, so I re-wrote it in TextPad and pasted it over, but didn't get all my changes incorporated.

            The idea would be to add "virtual device status is Away" as a group condition and use it for the "Away" ones, but I go back and forth over whether I think that's good or not. From a future-proofing standpoint in some scenarios it's better, since you could adjust the group conditions without having to reset them every time, or in a situation with a LOT of events based on that (like my "Christmas Lights" event group, with a "Christmas Lights Displayed" virtual device that needs to be checked). But in a smaller setting with a single criteria, I ultimately think the readability is better, so I'd replace that with "and the virtual device is Away".

            Comment


            • #7
              Originally posted by shill View Post

              Sorry about that - I had to rewrite that whole post 4 times because I kept hitting Ctrl-Z to undo something while formatting it because I didn't learn my lesson the first time I did that - it reset almost my whole post, so I re-wrote it in TextPad and pasted it over, but didn't get all my changes incorporated.

              The idea would be to add "virtual device status is Away" as a group condition and use it for the "Away" ones, but I go back and forth over whether I think that's good or not. From a future-proofing standpoint in some scenarios it's better, since you could adjust the group conditions without having to reset them every time, or in a situation with a LOT of events based on that (like my "Christmas Lights" event group, with a "Christmas Lights Displayed" virtual device that needs to be checked). But in a smaller setting with a single criteria, I ultimately think the readability is better, so I'd replace that with "and the virtual device is Away".
              And in retrospect, those aren't really needed anyway (the event or the group condition of "away" on the trigger) since they're already in the event conditions.

              Comment


              • #8
                Gotcha - this seems great. I think I can also augment a bit using EasyTrigger to create a few schedules for when each is applicable and then use those instead of hardcoding in days and times. Will take a crack with that.

                Comment

                Working...
                X