A simple yaml example of triggering a light when I get home please

I’ve even tried the AI chatGPT. It didn’t work!

Please don’t use chatGPT. It was trained on out of date data and just makes things up.

Use a zone trigger, https://www.home-assistant.io/docs/automation/trigger/#zone-trigger

Use the light turn on service in the actions: https://www.home-assistant.io/integrations/light/#service-lightturn_on

description: ""
mode: single
trigger:
  - platform: state
    entity_id:
      - person.me
    from: not_home
    to: home
condition: []
action:
  - service: light.turn_on
    target:
      entity_id: light.hallway
    data: {}

OK thanks I’ll give that a go.
John