IF anyone arrives home and it is light outside (based on a light sensor)
THEN switch on devices but not lights, also setting my location mode to Home (light)
And then a second automation
IF anyone arrives home and it is dark outside (based on a light sensor)
THEN switch on devices but and lights, also setting my location mode to Home (dark)
But what happens currently is as soon as it gets light it triggers the automation again because it matches all conditions.
This keeps will then run several times a day when at home.
The typical way of writing these automations is to add conditions based on the current Location Mode. They can be set as preconditions so they act as restrictions without adding additional triggers or interfering with the existing conditions.
@Benjamin_Ginders there is a workaround. Create a virtual switch and four automations, and if any of them come home, turn on the virtual switch and then turn it off in one second. This means that you have a virtual switch which turns on whenever the presence of anybody comes home. You can run an automation when this switch is turned on. However, this would run every time somebody comes home, so make the automation only occur when the mode is away, and change the mode to home if anybody comes home.
For the everyone leaves home, just create an automation that says nobody is at home, and have it trigger another virtual switch. I think that it will only trigger the routine if the state of a presence changes, so this should work,
These are both very good suggestions, however I tend to get lost in all the automations and changes of location modes to make things happen how I want them to.
I would find it so much better if I could just have automations that only happen on arrival or leaving.
The current ‘at’ locations are great when I want things to happen when I am at home or out of home.
But it is not ideal the example I provided above.
I have adapted my automations based in your suggestions as a workaround but worry of something goes wrong It would take alot longer to find resolve the problem.
Thank you again for your help
The issue I have is I want the automation to change the Location Mode to Home Light or Home Dark,
Have you (or has anyone reading this) investigated the ‘Advanced Options’ in Member Locations such as X being at home ‘after being away for y minutes’ to see how they behave?
I haven’t seen any documentation or explanation as to exactly what they do, which is frustrating as they aren’t things you can test easily.
Update: Actually I suspect they might not help. I currently return true to ‘at home after being away for X minutes’ even though I’ve been in for hours.
Can you set up an IF statement with the Member Location ? For some reason, I can’t get it sorted for both myself and my wife without doing separate automations.
-edit - I got it worked out. Seemed that my wife didn’t set the permissions right on her phone when she set it up.
Glad you got it sorted, a few others on here have done the same thing… Especially for legacy user the app isn’t great at reminding you to allow the needed permissions