Light on when presence between sunrise and sunset when already home

need a little help please
trying to setup my daughters bedroom to have the light turn on if she is present with presence being her mobile phone between sunset and sunrise
but cant seem to get it to happen so i know i am missing somthing if anyone can help

i can get it to turn on if she arrives after sunset as the trigger is presence and the presence sensor is her mobile and when to turn on i have 2 options someone arrives or everyone leaves so chose someone arrives and times are between sunset and sunrise and this is fine but what i would like to happen if she is already home before sunset i would like her light to turn on at sunset if her mobile is here and if the mobile is not here then to keep light off until she arrives
only way i can see of getting this to work would be a sensor in her room but wanted to try and do without a sensor in the kids rooms and try it the way i have above
i am pretty sure this can be done but cant figure it out

if not i would look at getting the fibaro motion sensor and use the lux and motion sensor of it

i hope this makes seance

As with all things SmartThings, there is more than one way to accomplish anything.

I’m going to assume you don’t want to make house mode changes based solely on your daughters presence so you will need something capable of more complex logic.

I’m sure CORE will do this. I don’t have any experience with CORE but there is plenty of help on this forum to help you with creating rules to do what you want. SmartRules is a very intuitive app available in the App Store or Google Play Store. It can definitely handle the logic you need and you can creat 1 rule for free. It’s $10 for unlimited rules.

With smartLigthing (which I am assuming you are using) the trigger is her arrival. The rule is only executed between those hours of sunset to sunrise. Since the trigger happened before the time window it will not be executed.

With Core you can set up a rule:

If Time Between Sunset and Sunrise
Daughter is Present
Turn on light

Core will evaluate this rule every minute (or so) and if true will turn on the light.

Yup, use CoRE. That way you can use conditions instead of triggers.

Thank you very much for the input and help I look for the smart rules app but can’t find it on Google play so looked into core and wow there is a lot to do and spec how you want things to happen so I have set up my first Piston and fingers crossed I have done it correct

So this is what I have set up I think it’s correct can anyone see any issues with this
If X presence is present
If time is between sunset and midnight
Using X light
Turn on

So what I am hoping is if X is home with her mobile presence device then at sunset the X light will auto come on but If she is out then the light will remain off and come on when she is back if before midnight I am very new to HA and smartthings but love tinkering with things so if my terminology is wrong I apologies and just point me in the right way

Cheers Baz

You want IF presence AND time, THEN turn on.

You may also want a turn off when false in there as well.
Let’s say your daughter is home between the two times and you all go out, you might want to turn the light off.
Also if you are after some guidance, it could be easier for people to give advice if you attach a screenshot.

thank you that made it work as i wanted i think the more i mess about with it he easier it will be

1 Like

i have set all lights off when we leave the house anyway and this seems to work fine
i was at work on my mobile trying to also set the core ect up so was a right pain but got there in the end in future i will put screen shots up as i have read a few other threads now and see the sort of layout other do when needing help or suggestions

As log as you get it working to how you want it that’s all that matters.
When I first started with CoRE I had lots of different pistons that ended up contradicting each other. Nightmare.
It was only asking questions and getting guidance on here that I finally got my head round it all.
Good luck with your automating. :wink:

i am sure it wont be long before i get clashes and will be back asking more questions only way to learn is ask and try by error

thanks for the help so far tho