ULN2003 YAML assistance

Hello all, this is my maiden post, so I apologize for any mistakes that I am sure will undoubtedly come to light. Also, this is my first time using home assistant and consequently esphome

I am trying to put together a simple bit of YAML code to control a ULN2003 stepper motor with an esp8266 nodeMCU (AMICA) to automate my window blinds. I have found several examples online and the esphome.io stepper motor page, but I am still having issues.

To explain, I am expecting to find a button/switch on the dashboard that will send the driver to either 0 or 1000 (I plan to play with this later to dial it in), but I am unable to find anything to “add” to the dashboard relating to the stepper. My assumption is that there is something important missing (or needs reorganizing) in the YAML code below, or perhaps my presumptive understanding of “service” is mistaken. If anyone has any input I would be very grateful. Likewise, if there is any further information I can provide to clarify my intent, I am happy to share.

esphome:
  name: "blinds"

esp8266:
  board: nodemcu

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  fast_connect: true
  reboot_timeout: 45min
  

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Blinds Fallback Hotspot"
    password: "nW7Cp5aGmrzF"

ota:
  password: "53c17c902ba3963cdc35784a0a4e76df"

# Enable logging
logger:


##
# Enable Home Assistant API
api:
  encryption:
    key: "39XLozgXyuguB0tlSeXRWhERV4Tfh3e7Zy1Xl8oVT78="
  services:
    - service: control_blind
      variables:
        target: int
      then:
        - stepper.set_target:
            id: living_room_blinds
            target: !lambda 'return target;'
    - service: open_blinds
      then:
        - stepper.set_target:
            id: living_room_blinds
            target: 0     
    - service: close_blinds
      then:
        - stepper.set_target:
            id: living_room_blinds
            target: 1000 


#stepper setup
stepper:
  - platform: uln2003
    id: living_room_blinds
    pin_a: D2
    pin_b: D5
    pin_c: D6
    pin_d: D7
    max_speed: 250 steps/s
    acceleration: 45
    deceleration: 22
    sleep_when_done: true

The ESPHome example answers your question.

You will need to create some helpers (maybe a slider or input number and a toggle?), add them to a card, then create some automations to call your services.

The example shows you how to do this in configuration.yaml but you can create the helper and the automation using the gui. When you select the action for the automation the services you created should show up as one of the options.

Thanks @zoogara! I’ll give this a shot later today