Automation to Control Rachio zones using Voice Assistant

With the help of Gemini, I have created the script and Automation shown below. My goal is to simply be able to ask the voice assistant (llama3.12) to turn on a particular zone for a designated duration in minutes. I can manually turn on and off Rachio zones from the “Overview” page without any problem, but the Assistant keeps telling me it cannot find the zones. I would appreciate any help or insight into this problem.

Script:

alias: Rachio Turn On Specific Zone with Duration
description: ""
sequence:
  - data:
      zones:
        - zone: "{{ zone_number }}"
          runtime: "{{ duration * 60 }}"
    action: rachio.start_multiple_zones
  - data:
      message: Rachio zone {{ zone_number }} turned on for {{ duration }} minutes.
      title: Rachio Zone Activated
    action: notify.persistent_notification
fields:
  zone_number:
    selector:
      number:
        min: 1
        max: 11
        step: 1
    name: zone_number
    description: The Rachio zone number to turn on (1-10).
    required: true
  duration:
    selector:
      number:
        min: 1
        max: 120
        step: 1
    name: duration
    description: The duration in minutes to run the zone.
    required: true

Automation:

alias: Rachio Turn On Zone with Duration (Voice)
description: Turns on a Rachio zone using voice commands with llama3l.2.
triggers:
  - command:
      - tell Rachio to turn on zone {{ zone_number }} for {{ duration }} minutes
      - turn on Rachio zone {{ zone_number }} for {{ duration }} minutes
      - start Rachio zone {{ zone_number }} for {{ duration }} minutes
      - run zone {{ zone_number }} {{ duration }} minutes
      - turn on zone {{ zone_number }} for {{ duration }} minutes
      - start zone {{ zone_number }} for {{ duration }} minutes
    trigger: conversation
conditions: []
actions:
  - data:
      zone_number: "{{ trigger.slots.zone_number }}"
      duration: "{{ trigger.slots.duration }}"
    action: script.rachio_turn_on_specific_zone_with_duration
mode: single

Well, after working on this for four days, I asked for help and then within a couple of hours I figured it out. I was using the wrong service to call. I should have called switch.turn_on and switch.turn_off instead of rachio.start_multiple_zones. The following script and automation work good. I hope it helps someone else.

Script:

alias: Rachio Turn On Specific Zone with Duration
description: ""
sequence:
  - target:
      entity_id: switch.zone_{{ zone_number }}
    action: switch.turn_on
  - delay:
      minutes: "{{ duration }}"
  - target:
      entity_id: switch.zone_{{ zone_number }}
    action: switch.turn_off
  - data:
      message: Rachio zone {{ zone_number }} turned on for {{ duration }} minutes.
      title: Rachio Zone Activated
    action: notify.persistent_notification
fields:
  zone_number:
    selector:
      number:
        min: 1
        max: 16
        step: 1
    name: zone_number
    description: The Rachio zone number to turn on (1-16).
    required: true
  duration:
    selector:
      number:
        min: 1
        max: 120
        step: 1
    name: duration
    description: The duration in minutes to run the zone.
    required: true
mode: single

Automation:

alias: Rachio Turn On Zone with Duration (Voice)
description: ""
triggers:
  - command:
      - rachio zone {zone_number} {duration} minute(s)
      - turn on zone {zone_number} for {duration} minutes
      - start rachio zone {zone_number} for {duration} minutes
      - rachio zone {zone_number} for {duration} minutes
      - tell rachio to turn on {zone_number} for {duration} minutes
    trigger: conversation
actions:
  - data:
      zone_number: "{{ trigger.slots.zone_number }}"
      duration: "{{ trigger.slots.duration }}"
    action: script.rachio_turn_on_specific_zone_with_duration
mode: single
variables: {}