Homeassistant.service throws an error I can't resolve

I have an automation in HA that contains the following:

  - service: remote.send_command
    target:
      device_id: ef0c6731abe4b2d1b41c595f430ba28b
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: Red light therapy
      command: up

This all works fine.

I’m trying to call this same service from ESPHome but get the following error, seemingly regardless of my indentation, of which I think I’ve tried every combination.

 [target] is an invalid option for [homeassistant.service]. Please check the indentation.

My ESPHome config is thus:

  - id: start_red_light_session
    then:
      - homeassistant.service:
          service: remote.send_command
          target:
            device_id: ef0c6731abe4b2d1b41c595f430ba28b
          data:
            num_repeats: "1"
            delay_secs: "0.4"
            hold_secs: "0"
            device: Red light therapy
            command: down

Where am I going wrong?

Solution:

  - id: run_red_light_session
    then:
      - homeassistant.service:
          service: remote.send_command
          data:
            entity_id: remote.broadlink_pro_spa
            num_repeats: "1"
            delay_secs: "0.4"
            hold_secs: "0"
            device: Red light therapy
            command: down

In ESPHome the entity ID is required, rather than the device id.