Help with stepper automation

Hi guys

I have this automation I can’t get to work

kommer her https://pastebin.com/pE2Z6KSf

I keep getting this error

Invalid config for [automation]: expected a dictionary. Got [OrderedDict([(‘alias’, ‘Write Stepper Value to ESP’), (‘trigger’, None), (‘platform’, ‘state’), (‘entity_id’, ‘input_number.stepper_control’), (‘action’, [OrderedDict([(‘service’, ‘esphome.steppermotor_control_stepper’), (‘data_template’, None), (‘target’, ‘{{ trigger.to_state.state | int }}’)])])])]. (See /config/automation/Gardin.yaml, line 1). Please check the docs at https://home-assistant.io/components/

Really hope someone can help me :smile:

can paste your code here.

# Control stepper motor
  - alias: 'Write Stepper Value to ESP'
    trigger:
    platform: state
    entity_id: input_number.stepper_control
    action:
    - service: esphome.steppermotor_control_stepper
      data_template:
      target: '{{ trigger.to_state.state | int }}'

You’re not indenting properly. Try:

# Control stepper motor
  - alias: 'Write Stepper Value to ESP'
    trigger:
      platform: state
      entity_id: input_number.stepper_control
    action:
    - service: esphome.steppermotor_control_stepper
      data_template:
        target: '{{ trigger.to_state.state | int }}'

sorry still getting error

Then it must be something else, for example, how the rest of the file is written/formatted, or how it is included in configuration.yaml.

Check the names of your enitity ID and service names to make sure that was what has been created. When I first did mine, the entity ID didn’t match what I thought it should be from following the instructions.

Hi
Just found out that i am using a directory with all my automation files inside and they are all working except for the one mentioned above, but if I instead of directory try using the automation.yaml file and only with the automation above it is working like a dream.
But why is it giving me error when using the same thing I directory.?
Hope you know what I mean

How are the automation files from that directory being included? Specifically, what do you have in configuration.yaml for automation:?