Pet feeder with D1 mini and stepper motor 28byj-48 5V, in ESPHome

I want make a pet feeder with D1 mini and 28byj-48 5V. I have tried 28byj-48 with ULN2003 and D1 mini, but motor haven’t enough torque to rotate a cornflakes dispenser.
Now I think convert 28byj-48 in Bipolar and use with L298N driver with D1 mini. Please guide me how can I setup in ESPHome. which components I need in ESPHome?

Here is what i want to do -

esphome:
  name: test

esp8266:
  board: d1_mini

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "XXXXXXXXXXX"

wifi:
  ssid: "XXXXX"
  password: "XXXXX"

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

captive_portal:

    
output:
  - platform: gpio
    id: motor_forward_pin
    pin: GPIO5
  - platform: gpio
    id: motor_reverse_pin
    pin: GPIO4 
    
fan:
  - platform: hbridge
    id: test
    name: "test"
    pin_a: motor_forward_pin
    pin_b: motor_reverse_pin
    # enable_pin: motor_enable
    decay_mode: slow   # slow decay mode (braking) or fast decay (coasting).
    

Error

INFO Reading configuration /config/esphome/test.yaml...
Failed config

fan.hbridge: [source /config/esphome/test.yaml:37]
  platform: hbridge
  id: test
  name: test
  
  ID 'motor_forward_pin' of type gpio::GPIOBinaryOutput doesn't inherit from output::FloatOutput. Please double check your ID is pointing to the correct value.
  pin_a: motor_forward_pin [source /config/esphome/test.yaml:40]
  
  ID 'motor_reverse_pin' of type gpio::GPIOBinaryOutput doesn't inherit from output::FloatOutput. Please double check your ID is pointing to the correct value.
  pin_b: motor_reverse_pin [source /config/esphome/test.yaml:41]
  decay_mode: SLOW
  disabled_by_default: False
  restore_mode: RESTORE_DEFAULT_OFF
  speed_count: 100

I know this is a little late but it doesnt seem anyone has fixed this. Per the docs, the way you have your schematic is correct along with the code. However as you know it does not work. The work around I found for this is to leave the enable jumpers on if possible and try your forward and reverse pins as output >> platform >> ledc. You will also need to set the frequency, min_power, and max_power. Its basically the exact opposite of what the docs say.

Im also trying to make this work, but I want to use Cover instead of Fan.
It seems there´s no h.bridge platform for cover, so I have no idea how to start coding this.

I have reed switches for open and close positions and everything works ok with a dc motor, using only one port of H-Bridge and using Cover.

Now I need more torque and slower rotation, so need to move to this unipolar stepper, converted to bipolar.

It would be easier if I had a A4988 laying around…but I dont :frowning:

To start with…
Can someone share some code on how to control this stepper motor with an H-bridge?

thx in advance

Did you made any advance with this?

I also want to convert this 28BY from unipolar to bipolar, but I would like to see some code of this working with H-Bridge LN298 before moving forward.

output:
 
  - platform: gpio
    pin: GPIO5 # Pin to IN1
    id: door_up
    interlock: &interlock_group [door_up, door_down]
  - platform: gpio
    pin: GPIO4  # Pin to IN2
    id: door_down
    interlock: *interlock_group
  - platform: esp8266_pwm
    pin: GPIO0   # Pin to EAN
    id: motor_speed
    frequency: 1000Hz 

The code above is for a single coil DC motor.
Dont have a clue how to define 2 more pins for IN3 and IN4 and control frequency in both EAN1 and EAN2 enable pins at same time.
Also have no clue about max and min frequency for 28BY

Some light would be appreciated.