Automation with choose option problems

I am trying to create this automation:

- id: calcio
  alias: attivo dazn
  mode: single
  trigger:
    - platform: state
      entity_id: input_boolean.panasonic
      state: 'on'
    - platform: state
      entity_id: input_boolean.panasonic
      state: 'off'
  condition: []    
  action:
    - choose:
      - conditions:
        - condition: state
          entity_id: input_boolean.panasonic
          state: 'on'
        sequence:
         - service: script.dazn
    - choose:
      - conditions:
        - condition: state
          entity_id: input_boolean.panasonic
          state: 'off'
        sequence:
          - service: script.tvsalotto_on
          - delay: "00:00:05"
          - service: script.dazn

following other simil automation i have, but i always get this error when checking configuration:

Logger: homeassistant.config
Source: config.py:454
First occurred: 12:56:15 (3 occurrences)
Last logged: 13:05:59

Invalid config for [automation]: expected dictionary @ data['action'][0]['choose'][0]['sequence'][0]. Got None. (See /config/configuration.yaml, line 26).
Invalid config for [automation]: required key not provided @ data['action'][0]['choose'][0]['sequence']. Got None. (See /config/configuration.yaml, line 26).

Where is the error?

EDIT: found the error.
In trigger state platform must be: ‘to’ and not ‘state’
Right?

The automation now works, but if i’d like to transform the automation in a script, which is the correct syntax? And, in general, is possible to transform an automation in a script?

A script is nothing but the action section of an automation.

to convert an automation to a script you just need to remove the trigger and condition sections and then rename “action:” to “sequence:” along with the other overall differences between the two integrations.