Help with Proper Logic to Turn on Lights When Coming Home

Scenario.

Away mode is in place.

Someone comes home, triggering Home mode with Reactor 1 (House Modes) and it is desired to turn on the lights but only between Sunset and Sunrise.

I have it set currently for the following AND Conditions:

House Modes Plugin = Home (1)
Between Sunset and Sunrise

Then the following Activity occurs:

Turn on Lights.

It seems to me that if the Vera is in Home mode that the lights will come on at sunset.

How to logically do this so that it happens only when it is between sunset and sunrise AND the house mode switches from Away to Home? Is this a case for Switchboard?

TIA.

Hint: so, you want the lights to be turned on only if the change to Home mode comes after (condition options, cough cough) the sunset/sunrise restriction goes true?

No Switchboard/virtual switches needed.

If you are literally using the old House Modes Plugin for this, don’t. Reactor has a house mode condition that requires no external support and responds faster to house mode changes than the old plugin.

2 Likes

Thank you very much for your quick response!

It looks like I have a little bit of reprogramming to do on some of my scenes to use reactor instead.

I never worked out how to do this with a scene, but in reactor it took me about 45 seconds (I think)

Sunrise/Sunset: between 15 mins before sunset and 15 mins after sunrise
and
House Mode: changes from any mode to Home

Then put the lights in the activities…

Given it’s summer though, I’ve not tested it :smiley:
C

Patrick is absolutely right, Reactor is way faster at response than the old house modes plug-in. I’ve been playing with mysetup like this for some time, and think I almost have it working perfectly (thanks to a lot of help from Patrick!)

I’m using Patrick’s other awesome add-in (delaylight) to turn on/off all my desired outside lighting when I drive up. Delay light works best, as it has an auto-off setting, with a countdown timer that’s visible in the UI. Love it.

My “trigger” for delaylight is a Reactor sensor that detects “Geofence Entry” for either me or my wife (though you could make your trigger a sensor that simply checks the HOME vs AWAY mode if you don’t want to go that elaborate)

I have 2 “inhibitors” setup for the delaylight control on my outside lighting as follows:

  1. A Reactor sensor that controls my outside lights for when I always want them on anyway (ex: 6pm-10pm for instance)
  2. A Reactor sensor called “Dark outside?”, which has conditions that check if it’s NOT between sunrise and civil dusk - 25 min.

What I light about this approach, is I can refer to the “dark outside” logic from many other sensors, and they all rely on the central NOT between sunrise and (civil dusk - 25min) that I setup. I can change this “time constraint” in the Dark Outside sensor, and it instantly is reflected in any other devices that need to operate in the same time frame.

I’ll upload a couple screenshots of my setup, in case it gives you some ideas. I’m the envy of all my neighbors now. I drive up to my house after dark and all the lights turn on. Even got the “that’s very cool dad” from my teenage daughter. (now that says something!!):stuck_out_tongue_closed_eyes:

1 Like

Are you familiar with the Day or Night plugin. You reminded me of it. Seems like it does the same thing?

C

1 Like

Hmm looks like my (simple) way might not work

Patrick, the the condition
House Mode: changes from Away to Home

Triggers and stays set. I get why it would but how do I do it so it only triggers tha activity when mode goes from away to home only between the timezones

I’m clearly missing something :smiley:

Should I just use The Only One’s method? :wink:
C

You’ve come to the right thread!! Help with Proper Logic to Turn on Lights When Coming Home

Damn you for teaching as opposed to telling! :smiley:

Think I’ve got it, and of course, learned something.

Cheers

C

1 Like

Here’s my current setup. I do not want the lights to come on in the Family Room (only room with automated lights right now) if someone is watching TV.


*************************************************** REACTOR LOGIC SUMMARY REPORT ***************************************************
   Version: 3.2 config 301 cdata 19082 ui 19143 pluginDevice 558
    System: Vera version 1.7.4453 on Sercomm G450; loadtime 1561111219; systemReady 1561111255; Lua 5.1
Local time: 2019-06-21T03:45:44-0700; DST=1
House mode: plugin 1; system 1; tracking on
  Sun data: { "stamp": 2019169, "civdawn": 1560859750, "nautdawn": 1560857594, "sunset": 1560913382, "nautdusk": 1560917290, "latitude": Redacted, "astrodusk": 1560919652, "longitude": Redacted, "civdusk": 1560915134, "astrodawn": 1560855231, "sunrise": 1560861502 }
  Geofence: running in long mode, last update 18:36:00, data version 2
            User 1686711 ishome=1 inlist=1472309878 since=18:36:00
            |1472309878 "Redacted" type="home" status="in" since=17:11:00
            User 1686611 ishome=1 inlist=1 since=18:36:00
            |    1 "Redacted" type="home" status="in" since=18:36:00
            User 2497352 ishome=0 inlist= since=18:36:00
            |1559003821 "Redacted" type="home" status="out" since=16:26:00
            Raw: { "updated": 1561113900, "users_settings": [ { "id": 1686611, "ishome": 1 }, { "id": 1686711, "ishome": 1 }, { "id": 2497352, "ishome": 0 } ], "mode": -1, "users": [ { "id": 1686711, "Level": 1, "Name": "Meritage1", "IsGuest": 0 }, { "id": 1686611, "Level": 1, "Name": "Meritage10", "IsGuest": 0 }, { "id": 2497352, "Level": 1, "Name": "TaylorS", "IsGuest": 0 } ], "usergeofences": [ { "geotags": [ { "radius": 250, "PK_User": 1686611, "id": 1, "status": "Enter", "accuracy": 0, "ishome": 1, "name": "Redacted", "address": "*************************************************** REACTOR LOGIC SUMMARY REPORT ***************************************************
   Version: 3.2 config 301 cdata 19082 ui 19143 pluginDevice 558
    System: Vera version 1.7.4453 on Sercomm G450; loadtime 1561111219; systemReady 1561111255; Lua 5.1
Local time: 2019-06-21T03:45:44-0700; DST=1
House mode: plugin 1; system 1; tracking on
  Sun data: { "stamp": 2019169, "civdawn": 1560859750, "nautdawn": 1560857594, "sunset": 1560913382, "nautdusk": 1560917290, "latitude": Redacted, "astrodusk": 1560919652, "longitude": Redacted, "civdusk": 1560915134, "astrodawn": 1560855231, "sunrise": 1560861502 }
  Geofence: running in long mode, last update 18:36:00, data version 2
            User 1686711 ishome=1 inlist=1472309878 since=18:36:00
            |1472309878 "Redacted" type="home" status="in" since=17:11:00
            User 1686611 ishome=1 inlist=1 since=18:36:00
            |    1 "Redacted" type="home" status="in" since=18:36:00
            User 2497352 ishome=0 inlist= since=18:36:00
            |1559003821 "Redacted" type="home" status="out" since=16:26:00
            Raw: { "updated": 1561113900, "users_settings": [ { "id": 1686611, "ishome": 1 }, { "id": 1686711, "ishome": 1 }, { "id": 2497352, "ishome": 0 } ], "mode": -1, "users": [ { "id": 1686711, "Level": 1, "Name": "Meritage1", "IsGuest": 0 }, { "id": 1686611, "Level": 1, "Name": "Meritage10", "IsGuest": 0 }, { "id": 2497352, "Level": 1, "Name": "TaylorS", "IsGuest": 0 } ], "usergeofences": [ { "geotags": [ { "radius": 250, "PK_User": 1686611, "id": 1, "status": "Enter", "accuracy": 0, "ishome": 1, "name": "Redacted", "address": "Redacted", "longitude": "Redacted", "latitude": "Redacted", "color": "006e45", "notify": 1 } ], "iduser": 1686611 }, { "geotags": [ { "radius": 100, "PK_User": 1686711, "id": 1472309878, "status": "Enter", "accuracy": 0, "ishome": 1, "name": "Redacted", "address": "Redacted", "longitude": "Redacted", "latitude": "Redacted", "color": "#ff0000", "notify": 1 } ], "iduser": 1686711 }, { "geotags": [ { "radius": 250, "notify": 1, "id": 1559003821, "status": "Exit", "color": "ff0000", "ishome": 1, "name": "Redacted", "address": "Redacted", "longitude": "Redacted", "latitude": "Redacted", "accuracy": 0, "PK_User": 2497352 } ], "iduser": 2497352 } ] }
====================================================================================================================================
Welcome Home (#574)
    Version 19082.21 06/19/19 16:35:24
    Message/status: Not tripped
    Test time set: 2019-06-18 03:40
    Test house mode set: 1
    Condition group "Night" (AND) false as of 06-18.03:40:00 <root>
      &-T-housemode in ,1 [2 => 1 at 06-18.03:40:00; T/T as of 06-18.03:40:00/06-18.03:40:00] <condegrejy2>
      &-F-service Harmony Control (351) urn:upnp-org:serviceId:SwitchPower1/Target = 1 [1 => 0 at 06-18.03:40:00; F/F as of 06-18.03:40:00/06-18.03:40:00] <condek2bm9n>
      &-F-sun after civdusk+0, [1560854400 at 06-18.03:40:00; F/F as of 06-18.03:40:00/06-18.03:40:00] <condek2wrmm>
      &-T-sun before civdawn+0, [1560854400 at 06-18.03:40:00; T/T as of 06-18.03:40:00/06-18.03:40:00] <condek2z423>
    Activity root.true
        Device 199 (Fam Room Light & Fan) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="1" )
        Device 26 (Tripod Dimmer) action urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget( newLoadlevelTarget="50" )
    Events
        06/21/19 03:00:50 start: 
        06/21/19 03:10:09 devicewatch: name=Reactor Plugin, var=HouseMode, device=558
```", "longitude": "Redacted", "latitude": "Redacted", "color": "006e45", "notify": 1 } ], "iduser": 1686611 }, { "geotags": [ { "radius": 100, "PK_User": 1686711, "id": 1472309878, "status": "Enter", "accuracy": 0, "ishome": 1, "name": "Redacted", "address": "Redacted", "longitude": "*************************************************** REACTOR LOGIC SUMMARY REPORT ***************************************************
   Version: 3.2 config 301 cdata 19082 ui 19143 pluginDevice 558
    System: Vera version 1.7.4453 on Sercomm G450; loadtime 1561111219; systemReady 1561111255; Lua 5.1
Local time: 2019-06-21T03:45:44-0700; DST=1
House mode: plugin 1; system 1; tracking on
  Sun data: { "stamp": 2019169, "civdawn": 1560859750, "nautdawn": 1560857594, "sunset": 1560913382, "nautdusk": 1560917290, "latitude": Redacted, "astrodusk": 1560919652, "longitude": Redacted, "civdusk": 1560915134, "astrodawn": 1560855231, "sunrise": 1560861502 }
  Geofence: running in long mode, last update 18:36:00, data version 2
            User 1686711 ishome=1 inlist=1472309878 since=18:36:00
            |1472309878 "Redacted" type="home" status="in" since=17:11:00
            User 1686611 ishome=1 inlist=1 since=18:36:00
            |    1 "Redacted" type="home" status="in" since=18:36:00
            User 2497352 ishome=0 inlist= since=18:36:00
            |1559003821 "Redacted" type="home" status="out" since=16:26:00
            Raw: { "updated": 1561113900, "users_settings": [ { "id": 1686611, "ishome": 1 }, { "id": 1686711, "ishome": 1 }, { "id": 2497352, "ishome": 0 } ], "mode": -1, "users": [ { "id": 1686711, "Level": 1, "Name": "Meritage1", "IsGuest": 0 }, { "id": 1686611, "Level": 1, "Name": "Meritage10", "IsGuest": 0 }, { "id": 2497352, "Level": 1, "Name": "TaylorS", "IsGuest": 0 } ], "usergeofences": [ { "geotags": [ { "radius": 250, "PK_User": 1686611, "id": 1, "status": "Enter", "accuracy": 0, "ishome": 1, "name": "Redacted", "address": "Redacted", "longitude": "Redacted", "latitude": "Redacted", "color": "006e45", "notify": 1 } ], "iduser": 1686611 }, { "geotags": [ { "radius": 100, "PK_User": 1686711, "id": 1472309878, "status": "Enter", "accuracy": 0, "ishome": 1, "name": "Redacted", "address": "Redacted", "longitude": "Redacted", "latitude": "Redacted", "color": "#ff0000", "notify": 1 } ], "iduser": 1686711 }, { "geotags": [ { "radius": 250, "notify": 1, "id": 1559003821, "status": "Exit", "color": "ff0000", "ishome": 1, "name": "Redacted", "address": "Redacted", "longitude": "Redacted", "latitude": "Redacted", "accuracy": 0, "PK_User": 2497352 } ], "iduser": 2497352 } ] }
====================================================================================================================================
Welcome Home (#574)
    Version 19082.21 06/19/19 16:35:24
    Message/status: Not tripped
    Test time set: 2019-06-18 03:40
    Test house mode set: 1
    Condition group "Night" (AND) false as of 06-18.03:40:00 <root>
      &-T-housemode in ,1 [2 => 1 at 06-18.03:40:00; T/T as of 06-18.03:40:00/06-18.03:40:00] <condegrejy2>
      &-F-service Harmony Control (351) urn:upnp-org:serviceId:SwitchPower1/Target = 1 [1 => 0 at 06-18.03:40:00; F/F as of 06-18.03:40:00/06-18.03:40:00] <condek2bm9n>
      &-F-sun after civdusk+0, [1560854400 at 06-18.03:40:00; F/F as of 06-18.03:40:00/06-18.03:40:00] <condek2wrmm>
      &-T-sun before civdawn+0, [1560854400 at 06-18.03:40:00; T/T as of 06-18.03:40:00/06-18.03:40:00] <condek2z423>
    Activity root.true
        Device 199 (Fam Room Light & Fan) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="1" )
        Device 26 (Tripod Dimmer) action urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget( newLoadlevelTarget="50" )
    Events
        06/21/19 03:00:50 start: 
        06/21/19 03:10:09 devicewatch: name=Reactor Plugin, var=HouseMode, device=558
```", "latitude": "Redacted", "color": "#ff0000", "notify": 1 } ], "iduser": 1686711 }, { "geotags": [ { "radius": 250, "notify": 1, "id": 1559003821, "status": "Exit", "color": "ff0000", "ishome": 1, "name": "Redacted", "address": "Redacted", "longitude": "Redacted", "latitude": "Redacted", "accuracy": 0, "PK_User": 2497352 } ], "iduser": 2497352 } ] }
====================================================================================================================================
Welcome Home (#574)
    Version 19082.21 06/19/19 16:35:24
    Message/status: Not tripped
    Test time set: 2019-06-18 03:40
    Test house mode set: 1
    Condition group "Night" (AND) false as of 06-18.03:40:00 <root>
      &-T-housemode in ,1 [2 => 1 at 06-18.03:40:00; T/T as of 06-18.03:40:00/06-18.03:40:00] <condegrejy2>
      &-F-service Harmony Control (351) urn:upnp-org:serviceId:SwitchPower1/Target = 1 [1 => 0 at 06-18.03:40:00; F/F as of 06-18.03:40:00/06-18.03:40:00] <condek2bm9n>
      &-F-sun after civdusk+0, [1560854400 at 06-18.03:40:00; F/F as of 06-18.03:40:00/06-18.03:40:00] <condek2wrmm>
      &-T-sun before civdawn+0, [1560854400 at 06-18.03:40:00; T/T as of 06-18.03:40:00/06-18.03:40:00] <condek2z423>
    Activity root.true
        Device 199 (Fam Room Light & Fan) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="1" )
        Device 26 (Tripod Dimmer) action urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget( newLoadlevelTarget="50" )
    Events
        06/21/19 03:00:50 start: 
        06/21/19 03:10:09 devicewatch: name=Reactor Plugin, var=HouseMode, device=558
```

Screengrabs:

Your separate “after dusk” and “before dawn” tests guarantee that at least one of them will always be false, and in an AND group, that means the group can never go true. Change this to a single “between dusk and dawn” condition (it will cross midnight correctly like that).

There’s one more detail missing that’s been covered twice in this thread (hint: it’s marked as the solution for this topic).

I think I’m being dense or overthinking this one. Here’s my latest Logic Sumary


*************************************************** REACTOR LOGIC SUMMARY REPORT ***************************************************
   Version: 3.2 config 301 cdata 19082 ui 19143 pluginDevice 558
    System: Vera version 1.7.4453 on Sercomm G450; loadtime 1561127404; systemReady 1561127433; Lua 5.1
Local time: 2019-06-21T07:57:16-0700; DST=1
House mode: plugin 1; system 1; tracking on
  Sun data: { "stamp": 2019169, "civdawn": 1560859750, "nautdawn": 1560857594, "sunset": 1560913382, "nautdusk": 1560917290, "latitude": Redacted, "astrodusk": 1560919652, "longitude":*************************************************** REACTOR LOGIC SUMMARY REPORT ***************************************************
   Version: 3.2 config 301 cdata 19082 ui 19143 pluginDevice 558
    System: Vera version 1.7.4453 on Sercomm G450; loadtime 1561127404; systemReady 1561127433; Lua 5.1
Local time: 2019-06-21T07:57:16-0700; DST=1
House mode: plugin 1; system 1; tracking on
  Sun data: { "stamp": 2019169, "civdawn": 1560859750, "nautdawn": 1560857594, "sunset": 1560913382, "nautdusk": 1560917290, "latitude": Redacted, "astrodusk": 1560919652, "longitude": -Redacted, "civdusk": 1560915134, "astrodawn": 1560855231, "sunrise": 1560861502 }
  Geofence: running in long mode, last update 06:49:00, data version 2
            User 1686711 ishome=0 inlist= since=06:49:00
            |1472309878 "Redacted" type="home" status="out" since=06:49:00
            User 1686611 ishome=0 inlist= since=06:49:00
            |    1 "Redacted" type="home" status="out" since=05:48:00
            User 2497352 ishome=0 inlist= since=06:49:00
            |1559003821 "Redacted" type="home" status="out" since=16:26:00
            Raw: { "updated": 1561129020, "users_settings": [ { "id": 1686611, "ishome": 0 }, { "id": 1686711, "ishome": 0 }, { "id": 2497352, "ishome": 0 } ], "mode": -1, "users": [ { "id": 1686711, "Level": 1, "Name": "Meritage1", "IsGuest": 0 }, { "id": 1686611, "Level": 1, "Name": "Meritage10", "IsGuest": 0 }, { "id": 2497352, "Level": 1, "Name": "TaylorS", "IsGuest": 0 } ], "usergeofences": [ { "geotags": [ { "radius": 250, "PK_User": 1686611, "id": 1, "status": "Exit", "accuracy": 0, "ishome": 1, "name": " Redacted ", "address": " Redacted ", "longitude": " Redacted ", "latitude": " Redacted ", "color": "006e45", "notify": 1 } ], "iduser": 1686611 }, { "geotags": [ { "radius": 100, "PK_User": 1686711, "id": 1472309878, "status": "Exit", "accuracy": 0, "ishome": 1, "name": "Redacted", "address": "Redacted ", "longitude": " Redacted ", "latitude": " Redacted ", "color": "#ff0000", "notify": 1 } ], "iduser": 1686711 }, { "geotags": [ { "radius": 250, "notify": 1, "id": 1559003821, "status": "Exit", "color": "ff0000", "ishome": 1, "name": "Redacted", "address": "Redacted ", "longitude": " Redacted ", "latitude": " Redacted ", "accuracy": 0, "PK_User": 2497352 } ], "iduser": 2497352 } ] }
====================================================================================================================================
Welcome Home (#574) tripped
    Version 19082.36 06/21/19 07:49:16
    Message/status: Tripped
    Test time set: 2019-06-18 03:40
    Test house mode set: 1
    Condition group "Mode to Home, Night TV on" (AND) TRUE as of 06-18.03:40:00 <root>
      &-T-housemode in ,1 [1 at 06-18.03:40:00; T/T as of 06-18.03:40:00/06-18.03:40:00] <condemeco6y>
      &-T-sun bet civdusk+0,civdawn+0 [1560854400 at 06-18.03:40:00; T/T as of 06-18.03:40:00/06-18.03:40:00] <condemew1sc>
      &-T-service Harmony Control (351) urn:rboer-com:serviceId:Harmony1/activityStatus <> 2 [3 => 0 at 06-18.03:40:00; T/T as of 06-18.03:40:00/06-18.03:40:00] <condemewkmv>
    Activity root.true
        Device 199 (Fam Room Light & Fan) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="1" )
        Device 26 (Tripod Dimmer) action urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget( newLoadlevelTarget="50" )
    Events
 "civdusk": 1560915134, "astrodawn": 1560855231, "sunrise": 1560861502 }
  Geofence: running in long mode, last update 06:49:00, data version 2
            User 1686711 ishome=0 inlist= since=06:49:00
            |1472309878 "Redacted" type="home" status="out" since=06:49:00
            User 1686611 ishome=0 inlist= since=06:49:00
            |    1 "Redacted" type="home" status="out" since=05:48:00
            User 2497352 ishome=0 inlist= since=06:49:00
            |1559003821 "Redacted" type="home" status="out" since=16:26:00
            Raw: { "updated": 1561129020, "users_settings": [ { "id": 1686611, "ishome": 0 }, { "id": 1686711, "ishome": 0 }, { "id": 2497352, "ishome": 0 } ], "mode": -1, "users": [ { "id": 1686711, "Level": 1, "Name": "Meritage1", "IsGuest": 0 }, { "id": 1686611, "Level": 1, "Name": "Meritage10", "IsGuest": 0 }, { "id": 2497352, "Level": 1, "Name": "TaylorS", "IsGuest": 0 } ], "usergeofences": [ { "geotags": [ { "radius": 250, "PK_User": 1686611, "id": 1, "status": "Exit", "accuracy": 0, "ishome": 1, "name": " Redacted ", "address": " Redacted ", "longitude": " Redacted ", "latitude": " Redacted ", "color": "006e45", "notify": 1 } ], "iduser": 1686611 }, { "geotags": [ { "radius": 100, "PK_User": 1686711, "id": 1472309878, "status": "Exit", "accuracy": 0, "ishome": 1, "name": "Redacted", "address": "Redacted ", "longitude": " Redacted ", "latitude": " Redacted ", "color": "#ff0000", "notify": 1 } ], "iduser": 1686711 }, { "geotags": [ { "radius": 250, "notify": 1, "id": 1559003821, "status": "Exit", "color": "ff0000", "ishome": 1, "name": "Redacted", "address": "Redacted ", "longitude": " Redacted ", "latitude": " Redacted ", "accuracy": 0, "PK_User": 2497352 } ], "iduser": 2497352 } ] }
====================================================================================================================================
Welcome Home (#574) tripped
    Version 19082.36 06/21/19 07:49:16
    Message/status: Tripped
    Test time set: 2019-06-18 03:40
    Test house mode set: 1
    Condition group "Mode to Home, Night TV on" (AND) TRUE as of 06-18.03:40:00 <root>
      &-T-housemode in ,1 [1 at 06-18.03:40:00; T/T as of 06-18.03:40:00/06-18.03:40:00] <condemeco6y>
      &-T-sun bet civdusk+0,civdawn+0 [1560854400 at 06-18.03:40:00; T/T as of 06-18.03:40:00/06-18.03:40:00] <condemew1sc>
      &-T-service Harmony Control (351) urn:rboer-com:serviceId:Harmony1/activityStatus <> 2 [3 => 0 at 06-18.03:40:00; T/T as of 06-18.03:40:00/06-18.03:40:00] <condemewkmv>
    Activity root.true
        Device 199 (Fam Room Light & Fan) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="1" )
        Device 26 (Tripod Dimmer) action urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget( newLoadlevelTarget="50" )
    Events

BTW, is there a way to not have address and map coordinates not shown or at least not so many times? It takes a wee bit of time to redact those from the report.

Also, no matter how many times I reset or restart this it still says its true as of 3:40am on June 18?

I was referring to the possible need of an “after” condition option on the sunrise/sunset to sequence that behind the house mode change. Maybe you don’t need that for your purpose, and I’ve just confused you by suggesting it. The after condition option would prevent the activities from being run if it becomes dusk when you’re already home. With the “after” option, the condition would only become true if the house mode transition to home occurs between dusk as dawn. It just depends on if you want the lights to come on if you’re already home and it becomes dusk (the no “after” option effect), or only if you come home between dusk and dawn. You might be confused/misdirected by the short snippet that the forum software gives for the reference to the solution (understandable–I dislike that presentation, a lot), so make sure to read post #2 on this topic in its entirety particularly that first paragraph.

If the condition state doesn’t change during an evaluation, then neither the state nor the timestamp of the state changes.

I think I’m figuring this out. I sent a device info report for my Harmony Control. I need to figure out what settings to use for that to test for the TV being on. Typically, Power is “Everything OFF” and anything else such as “ShieldTV” is a scene whereupon the ShieldTV is on and someone is watching the TV. Having the Family Room lights come on if, say, my daughter comes home while my wife and I are watching Outlander is just plain rude so I want to eliminate that possibility!

I think this is correct: "Device State: Harmony Control (#351) StartingActivityID equals “-1”

Okay. I have it working for when someone opens a door and it goes from night or away or vacation even to home that the lights will come on only at night and only if the TV is off.

On the reverse, If I have the TV off but am in home mode at night and turn the TV off the lights come on. This isn’t expected because I thought the test is from any mode into home mode so if in home mode and the TV gets turned off, the lights shouldn’t come on, right?

That’s why you need to sequence. That’s that first paragraph of post #2.


*************************************************** REACTOR LOGIC SUMMARY REPORT ***************************************************
   Version: 3.2 config 301 cdata 19082 ui 19143 pluginDevice 558
    System: Vera version 1.7.4453 on Sercomm G450; loadtime 1561127404; systemReady 1561127433; Lua 5.1
Local time: 2019-06-21T11:48:36-0700; DST=1
House mode: plugin 2; system 2; tracking on
  Sun data: { "stamp": 2019172, "civdawn": 1561118978, "nautdawn": 1561116821, "sunset": 1561172626, "nautdusk": 1561176536, "latitude": Redacted, "astrodusk": 1561178900, "longitude": Redacted, "civdusk": 1561174378, "astrodawn": 1561114457, "sunrise": 1561120731 }
  Geofence: running in long mode, last update 09:42:00, data version 2
            User 1686711 ishome=0 inlist= since=09:42:00
            |1472309878 "Redacted" type="home" status="out" since=06:49:00
            User 1686611 ishome=0 inlist= since=09:42:00
            |    1 " Redacted " type="home" status="out" since=05:48:00
            User 2497352 ishome=0 inlist= since=09:42:00
            |1559003821 " Redacted " type="home" status="out" since=09:42:00
            Raw: { "updated": 1561142880, "users_settings": [ { "id": 1686611, "ishome": 0 }, { "id": 1686711, "ishome": 0 }, { "id": 2497352, "ishome": 0 } ], "mode": -1, "users": [ { "id": 1686711, "Level": 1, "Name": "Meritage1", "IsGuest": 0 }, { "id": 1686611, "Level": 1, "Name": "Meritage10", "IsGuest": 0 }, { "id": 2497352, "Level": 1, "Name": "TaylorS", "IsGuest": 0 } ], "usergeofences": [ { "geotags": [ { "radius": 250, "PK_User": 1686611, "id": 1, "status": "Exit", "accuracy": 0, "ishome": 1, "name": " Redacted ", "address": " Redacted ", "longitude": "Redacted ", "latitude": " Redacted ", "color": "006e45", "notify": 1 } ], "iduser": 1686611 }, { "geotags": [ { "radius": 100, "PK_User": 1686711, "id": 1472309878, "status": "Exit", "accuracy": 0, "ishome": 1, "name": " Redacted ", "address": " Redacted ", "longitude": Redacted ", "latitude": " Redacted ", "color": "#ff0000", "notify": 1 } ], "iduser": 1686711 }, { "geotags": [ { "radius": 250, "notify": 1, "id": 1559003821, "status": "Exit", "color": "ff0000", "ishome": 1, "name": " Redacted ", "address": " Redacted ", "longitude": “Redacted ", "latitude": " Redacted ", "accuracy": 0, "PK_User": 2497352 } ], "iduser": 2497352 } ] }
====================================================================================================================================
Welcome Home (#574) tripped
    Version 19082.45 06/21/19 11:45:51
    Message/status: Tripped
    Test time set: 2019-06-21 21:43
    Test house mode set: 1
    Condition group "Mode to Home, @Night TV OFF" (AND) TRUE as of 21:43:00 <root>
      &-T-housemode in ,1 [2 => 1 at 21:43:00; T/T as of 21:43:00/21:43:00] <condemeco6y>
      &-T-sun after civdusk+0, [1561142580 => 1561178580 at 21:43:00; T/T as of 21:43:00/21:43:00] <condemew1sc>
      &-T-service Harmony Control (351) urn:rboer-com:serviceId:Harmony1/StartingActivityID = -1 after condemeco6y [32003180 => -1 at 21:43:00; T/T as of 21:43:00/21:43:00] <condemewkmv>
    Activity root.false
        Device 199 (Fam Room Light & Fan) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="0" )
        Device 26 (Tripod Dimmer) action urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget( newLoadlevelTarget="0" )
    Activity root.true
        Device 199 (Fam Room Light & Fan) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="1" )
        Device 26 (Tripod Dimmer) action urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget( newLoadlevelTarget="50" )
    Events
        06/21/19 11:45:33 configchange: 
        06/21/19 11:45:33 configchange: 
        06/21/19 11:45:52 configchange: 
        06/21/19 11:45:52 configchange: 
        06/21/19 11:45:52 configchange: 
        06/21/19 11:45:52 configchange: 
        06/21/19 11:45:52 configchange: 
        06/21/19 11:45:52 configchange: 
        06/21/19 11:45:52 configchange: 
        06/21/19 11:45:52 configchange: 
        06/21/19 11:45:52 configchange: 
        06/21/19 11:45:52 configchange: 
        06/21/19 11:45:52 configchange: 
        06/21/19 11:45:52 configchange: 
        06/21/19 11:45:52 configchange: 
        06/21/19 11:45:52 configchange: 
        06/21/19 11:45:52 configchange: 
        06/21/19 11:45:52 configchange: 
        06/21/19 11:45:52 configchange: 
        06/21/19 11:45:52 configchange: 
        06/21/19 11:45:52 configchange: 
        06/21/19 11:45:52 configchange: 
        06/21/19 11:45:52 configchange: 
        06/21/19 11:46:26 action: action=SetEnabled, state=0
        06/21/19 11:46:31 action: action=SetEnabled, state=1
        06/21/19 11:46:37 action: action=Restart
        06/21/19 11:46:37 start: 
        06/21/19 11:46:47 action: action=Reset
        06/21/19 11:46:47 sensorstate: state=false
        06/21/19 11:46:47 startscene: scene=root.false, sceneName=root.false
        06/21/19 11:46:47 runscene: scene=root.false, sceneName=root.false, group=1, notice=Starting scene group 1
        06/21/19 11:46:47 endscene: scene=root.false, sceneName=root.false
        06/21/19 11:47:20 devicewatch: device=351, old="0", name=Harmony Control, var=urn:rboer-com:serviceId:Harmony1/activityStatus, new="1"
        06/21/19 11:47:20 devicewatch: device=351, old="-1", name=Harmony Control, var=urn:rboer-com:serviceId:Harmony1/StartingActivityID, new="32003180"
        06/21/19 11:47:21 condchange: newState=false, cond=condemewkmv, oldState=true
        06/21/19 11:47:21 evalchange: newState=false, cond=condemewkmv, oldState=true
        06/21/19 11:47:21 condchange: newState=false, cond=root, oldState=true
        06/21/19 11:47:21 evalchange: newState=false, cond=root, oldState=true
        06/21/19 11:47:30 devicewatch: device=351, old="1", name=Harmony Control, var=urn:rboer-com:serviceId:Harmony1/activityStatus, new="2"
        06/21/19 11:48:16 devicewatch: device=351, old="2", name=Harmony Control, var=urn:rboer-com:serviceId:Harmony1/activityStatus, new="3"
        06/21/19 11:48:16 devicewatch: device=351, old="32003180", name=Harmony Control, var=urn:rboer-com:serviceId:Harmony1/StartingActivityID, new="-1"
        06/21/19 11:48:17 condchange: newState=true, cond=condemewkmv, oldState=false
        06/21/19 11:48:17 evalchange: newState=true, cond=condemewkmv, oldState=false
        06/21/19 11:48:17 condchange: newState=true, cond=root, oldState=false
        06/21/19 11:48:17 evalchange: newState=true, cond=root, oldState=false
        06/21/19 11:48:17 sensorstate: state=true
        06/21/19 11:48:17 startscene: scene=root.true, sceneName=root.true
        06/21/19 11:48:17 runscene: scene=root.true, sceneName=root.true, group=1, notice=Starting scene group 1
        06/21/19 11:48:17 endscene: scene=root.true, sceneName=root.true
        06/21/19 11:48:20 devicewatch: device=351, old="3", name=Harmony Control, var=urn:rboer-com:serviceId:Harmony1/activityStatus, new="0"
```
        06/21/19 07:42:35 evalchange: newState=true, cond=condemeco6y, oldState=false
        06/21/19 07:42:35 condchange: newState=true, cond=root, oldState=false
        06/21/19 07:42:35 evalchange: newState=true, cond=root, oldState=false
        06/21/19 07:42:35 sensorstate: state=true
        06/21/19 07:42:35 startscene: scene=root.true, sceneName=root.true
        06/21/19 07:42:35 runscene: scene=root.true, sceneName=root.true, group=1, notice=Starting scene group 1
        06/21/19 07:42:35 endscene: scene=root.true, sceneName=root.true
        06/21/19 07:43:09 action: action=Reset
        06/21/19 07:43:09 sensorstate: state=false
        06/21/19 07:46:28 configchange: 
        06/21/19 07:46:28 configchange: 
        06/21/19 07:46:28 configchange: 
        06/21/19 07:46:29 condchange: newState=true, cond=condemew1sc
        06/21/19 07:46:29 condition: condition=condemew1sc, error=Predecessor condition state not be found
        06/21/19 07:46:29 condchange: newState=false, cond=condemewkmv
        06/21/19 07:46:29 evalchange: newState=false, cond=condemewkmv
        06/21/19 07:46:29 condchange: newState=false, cond=root, oldState=true
        06/21/19 07:46:29 evalchange: newState=false, cond=root, oldState=true
        06/21/19 07:46:30 configchange: 
        06/21/19 07:46:30 configchange: 
        06/21/19 07:46:30 configchange: 
        06/21/19 07:46:31 evalchange: newState=false, cond=condemew1sc
        06/21/19 07:47:47 devicewatch: device=351, old="2", name=Harmony Control, var=urn:rboer-com:serviceId:Harmony1/activityStatus, new="3"
        06/21/19 07:47:47 devicewatch: device=351, old="32003180", name=Harmony Control, var=urn:rboer-com:serviceId:Harmony1/StartingActivityID, new="-1"
        06/21/19 07:47:48 condchange: newState=true, cond=condemewkmv, oldState=false
        06/21/19 07:47:48 evalchange: newState=true, cond=condemewkmv, oldState=false
        06/21/19 07:47:52 devicewatch: device=351, old="3", name=Harmony Control, var=urn:rboer-com:serviceId:Harmony1/activityStatus, new="0"
        06/21/19 07:47:53 evalchange: newState=true, cond=condemew1sc, oldState=false
        06/21/19 07:47:53 condchange: newState=true, cond=root, oldState=false
        06/21/19 07:47:53 evalchange: newState=true, cond=root, oldState=false
        06/21/19 07:47:53 sensorstate: state=true
        06/21/19 07:47:53 startscene: scene=root.true, sceneName=root.true
        06/21/19 07:47:53 runscene: scene=root.true, sceneName=root.true, group=1, notice=Starting scene group 1
        06/21/19 07:47:53 endscene: scene=root.true, sceneName=root.true
        06/21/19 07:48:07 action: action=Reset
        06/21/19 07:48:07 sensorstate: state=false
        06/21/19 07:48:10 action: action=Restart
        06/21/19 07:48:10 start: 
        06/21/19 07:48:11 sensorstate: state=true
        06/21/19 07:48:11 startscene: scene=root.true, sceneName=root.true
        06/21/19 07:48:11 runscene: scene=root.true, sceneName=root.true, group=1, notice=Starting scene group 1
        06/21/19 07:48:11 endscene: scene=root.true, sceneName=root.true
        06/21/19 07:49:10 configchange: 
        06/21/19 07:49:10 configchange: 
        06/21/19 07:49:10 configchange: 
        06/21/19 07:49:10 configchange: 
        06/21/19 07:49:16 configchange: 
        06/21/19 07:49:16 configchange: 
        06/21/19 07:49:16 configchange: 
        06/21/19 07:49:16 configchange: 
```

I tried to sequence it but I must not be sequencing it correctly.

EDIT: I think it is working correctly now. I had it set to be in Home Mode in tools. When I unchecked that but faked a time after dusk it did not turn on the lights after powering off the Harmony. I will continue to test and report back if I have any issues.

Thanks for your help.

Next up, HVAC based on temps, humidity, time of day, etcetera; Getting pool filtration to start up again when stopping the pool heater or spa…

No, your last round of changes miss the objective.

OK, put the sunrise/sunset condition back to “between dusk and dawn”. Then open the condition options pane for that condition (downward-pointing arrow in the condition action buttons), and where it says “Only after” choose your house mode condition from the dropdown menu. Save.

1 Like

Thanks. I will check it tomorrow when I have the the time.