Struggling to get simple automation running

I’m new to HA so stay with me here. I’m simply trying to turn on a switch when HA recognizes I’m home.

- action:
  - service: switch.turn_on
    data: 
      entity_id: switch.hanging_light 
  alias: New Automation
  condition: []
  id: '1503679037720'
  trigger:
  - entity_id: device_tracker.androidphone
    from: not_home
    platform: state
    to: home

In the log i keep getting this error
ERROR (MainThread) [homeassistant.components] homeassistant/turn_on cannot be called without entity_id

any ideas what im doing wrong here?

The entity_id shouldn’t be in a data: block

- action:
  - service: switch.turn_on
    entity_id: switch.hanging_light 
  alias: New Automation
  condition: []
  id: '1503679037720'
  trigger:
  - entity_id: device_tracker.androidphone
    from: not_home
    platform: state
    to: home