[SOLVED] Script delay with "expected a dictionary"

I don’t understand the mistake…
Where is the problem?

Source:

automation.yaml

  - id: Wohnzimmer Dining Motion Sensor
    alias: Wohnzimmer Dining Motion Sensor
    trigger:
      - platform: state
        entity_id: sensor.wohnzimmer_motion_sensor
        to: 'on'
    condition:
      - condition: time
        after: '23:00:00'
        before: '06:00:00'
    action:
      - service: script.turn_on
        data:
          entity_id: script.wohnzimmer_motion

script.yaml

wohnzimmer_motion: !include scripts/wohnzimmer_motion.yaml
wohnzimmer_motion_sensor_timer: include scripts/wohnzimmer_motion_sensor_timer.yaml

wohnzimmer_motion.yaml

  alias: Wohnzimmer Motion Sensor
  sequence:
    - service: script.turn_off
      data:
        entity_id: script.wohnzimmer_motion_sensor_timer
    - service: light.turn_on
      data:
        entity_id: light.wohnzimmer
        brightness: 255
        color_temp: 500
        xy_color: [0.1572,0.2044]
        
    - service: script.turn_on
      data:
        entity_id: script.wohnzimmer_motion_sensor_timer.yaml

wohnzimmer_motion_sensor_timer.yaml

  alias: Wohnzimmer Motion Sensor Timer
  sequence:
    - delay:
        minutes: 1
    - service: light.turn_off
      data:
        entity_id: light.wohnzimmer

The Error is:

2017-11-18 18:07:25 ERROR (MainThread) [homeassistant.config] Invalid config for [script]: expected a dictionary for dictionary value @ data['script']['wohnzimmer_motion_sensor_timer']. Got 'include scripts/wohnzimmer_motion_sensor_timer.yaml'. (See /config/configuration.yaml, line 140). Please check the docs at https://home-assistant.io/components/script/
2017-11-18 18:07:25 ERROR (MainThread) [homeassistant.setup] Setup failed for script: Invalid config.

Thanks for your Help! :slight_smile:

Try removing the .yaml in entity_id: script.wohnzimmer_motion_sensor_timer.yaml. There’s no entity with that name.

thanks! how blind…

but i have still the same error… :-/

2017-11-18 18:27:28 ERROR (MainThread) [homeassistant.config] Invalid config for [script]: expected a dictionary for dictionary value @ data['script']['wohnzimmer_motion_sensor_timer']. Got 'include scripts/wohnzimmer_motion_sensor_timer.yaml'. (See /config/configuration.yaml, line 140). Please check the docs at https://home-assistant.io/components/script/
2017-11-18 18:27:28 ERROR (MainThread) [homeassistant.setup] Setup failed for script: Invalid config.

wohnzimmer_motion.yaml

  alias: Wohnzimmer Motion Sensor
  sequence:
    - service: script.turn_off
      data:
        entity_id: script.wohnzimmer_motion_sensor_timer
    - service: light.turn_on
      data:
          entity_id: light.wohnzimmer
          brightness: 255
          transition: 5
          xy_color: [0.1572,0.2044]
        
    - service: script.turn_on
      data:
        entity_id: script.wohnzimmer_motion_sensor_timer

wohnzimmer_motion_sensor_timer.yaml

  alias: Wohnzimmer Motion Sensor Timer
  sequence:
    - delay:
        minutes: 1
    - service: light.turn_off
      data:
        entity_id: light.wohnzimmer

… i don’t know where the fault was but now it’s work. -.-