I'm Back Automation Help Needed

Hi all. I decided to move over the the new app manually several months ago skipping the automatic migration. I recreated all my old routines as automations which were working fine. Unfortunately, the “I’m Back” automation which turns off STHM, changes the location mode to “Home - Day/Night” and turns on certain lights (if night) is not working. Because of Covid, one of the 3 of us have almost always been home and, therefore, I don’t know if this had ever worked since moving to the new app, however, it’s consistently not working now, forcing me to turn things on/off from the garage.

I’ve recently started using webcore but have only created very basic pistons so far. From what I gathered in the other posts, I need to do the following:

Create 4 virtual switches for the 3 occupants plus 1 presence sensor used for guests
Use webcore to detect presence and trigger the virtual switches
Create automations triggered by the virtual switches to turn off SMHM, switch the location mode and trigger the respective day/night scene (I don’t use scenes currently so, can I just add the lights to the automation?)

Additionally, I’d like to be able to see the status of the individual presences sensors like you could in the classic app. Please let me know if that is accomplished via webcore also, and, if so, if anyone can direct me to the necessary code.

Thanks!!

You can create simulated presence sensors in the devices section in IDE. Then you can use automations or webcore to sync the status of those simulated presence sensors to the appropriate user’s presence. Two parts, if user arrives… change simulated presence sensor to present or if their status changes to not present, change tHe simulated presence sensor to not present.

As for the lights, you can add those directly to automations if you choose.

Thanks @jkp. I’m almost there but I’m not sure an automation will work as, I believe, I need a combination of “and” and “or” statements:

If Presence 1, 2, 3 or 4 is “Home”
AND
Location Mode is “Away” (Precondition “Off”)
Then…

Or is there a simpler way of doing this?

check out the webcore forum. You can write pistons to do anything you want. There are lots of example pistons you can look at over there. There are also several users who enjoy helping others with building their pistons. They can probably point you to an existing piston for presence.

I actually just took some similar Webcore pistons and transitioned them to ST automations a couple of weeks ago. However, I think I may have a slightly different approach. And don’t get me wrong the Webcore pistons were easier to manage, because it was just two pistons where now I have several automations.

Whether you go webcore or automation is up to you, but the concept that I followed was actually from a webcore example on the webcore wikipedia a couple years ago.

The devices involved for presence are phones and a virtual switch to turn on if we have visitors.
There are 4 sets of automations:

  1. The first is a single automation, if no one is home, arm STHM and set the location mode to Away.
  2. I have Location Mode Automations for each mode that I want set that change the location mode at set times, I use morning, home, evening, and night. Example of my “Evening” automation:
  3. Arrival automations - I have one for the time window of each of the modes set above. So if someone arrives during the various location mode times, the mode will be set correctly based on the time of day. Example of my “Arrival Evening” automation:
  4. I currently have a stand-alone arrival automation that disarms STHM when someone arrives, but I could incorporate this into the arrival automations in bullet 3 above.

I manage my lights on separate timed-based automations, because I don’t care about presence for the lights I control, but you could add them in to these.

Hope this helps give you some ideas, this approach has worked well for me for a few years. I only moved to automations recently to see if I could do it without webcore, because it seems it may phase out at some point.

Thanks @Mobiz. What’s really confusing me is that my Goodbye routines are working fine. My I’m Back (Day/Night) automations are the ones that are not working correctly. I read somewhere that “Presence” is just a state and should not be relied on for any arrivals which, I believe is why this doesn’t work:

This is what led me to think I should go the virtual switch route and have webcore trigger it. I never had issues with the classic app which is why this is so frustrating.

I did a little digging, but I think you want the pre-condition for the location mode on. Right now it is trying to trigger on away and presence. With precondition on, it means location mode is away-night AND your presence switches to home. So you presence is the only trigger.
This was the post I looked at:

Thanks again. I came across that post several weeks ago when I discovered the precondition option for the first time. Once I realized I was having problems with the automation, I remembered that precondition option and changed it from On to Off (I didn’t change anything else at the time so that wasn’t the cause).

Yesterday I created a simple piston to push a button switch when anyone is home which in turn runs the ST automation above (I replaced the phone presence with the button switch). I know that button switches won’t work in the new app, however, apparently, with webcore controlling the switch the automation seems to be working after a single test yesterday.

If the piston/automation setup continues to work, I’ll stick with it as long as I can (until a new, new app is released). Thanks all!