Automation ignorance

Guys, I haven’t have any luck getting any automations to work for me. I’ve tried using the UI and configurator with no luck.
I’m simply wanting to create a automation to turn on a group of lights after the sun goes when me or my wife’s phone connects to our network using presents detection. I want the lights to stay on for 20 mins and reset again.
I have a super simple setup but I guess I just can’t get the hang of this. I’ve only been playing with HA for about a week. I only have three lights and they all work inside HA so I know its gonna be me that’s missing something. Any links to explaining all commands and their usage would be great.

I dont just want someone to make a automation for me because I’m not gonna learn anything.
Thanks in advance

Post what you’ve created so we can examine it and provide guidance.

I figured out what I was doing wrong by simplifying the code and one I got that working, I started adding more code and everything is working great. The Service call tool also helped me figure out what would activate my switch or not.

I’m so glad I figured this software out! Thanks Tara’s for the reply but I think I’m gonna be ok.
When others said the learning curve was sharp, they should have said it’s a cliff lol. Loving the home assistant software now. Thanks everyone!

I’m glad to hear you solved the problem. However, by not posting what you had created, and how you changed it to make it work, no one else can learn from your experiences. You’re not obliged to share anything but if you do it helps others.

Good luck!

And, you may have got it working but with a less than optimal method (I don’t think so but you never know) We may offer to clean the code. That gets you into good habits sooner and should avoid ‘some’ mistakes going forward.
(Please remeber to use the “</>” button, 7th in from the left just above the text entry box, to post your code as otherwise it’s pretty much unreadable).

  alias: exterior lights
  description: Exterior lights come home through device location.
  trigger:
  - entity_id: person.shane
    from: not_home
    platform: state
    to: home
  - entity_id: person.kesha
    from: not_home
    platform: state
    to: home
  - entity_id: person.emmie
    from: not_home
    platform: state
    to: home
  condition:
  - condition: state
    entity_id: sun.sun
    state: below_horizon
  action:
  - data:
      entity_id: group.exterior_lights
    service: homeassistant.turn_on
  - delay: 0:10
  - data:
      entity_id: group.exterior_lights
    service: homeassistant.turn_off