stepper:
- platform: tmc2209
id: motor
- max_speed: ${max_speed}
+ max_speed: ${max_speed} steps/s
acceleration: 100 steps/s^2
deceleration: 200 steps/s^2
rsense: 100 mOhm
name: Home
id: home
on_press:
- - stepper.set_target:
- id: motor
- target: !lambda "return id(motor)->current_position - 2.5 * ${encoder_closed_pos};"
+ - lambda: |
+ id(motor).set_max_speed(${max_speed}/2);
+ id(motor).set_target(id(motor)->current_position - 2.5 * ${encoder_closed_pos});
- platform: template
name: Stop
- logger.log:
level: INFO
format: "Blind rehome"
- - stepper.set_target:
- id: motor
- target: !lambda "return id(motor)->current_position - 2.5 * ${encoder_closed_pos};"
+ - lambda: |
+ id(motor).set_max_speed(${max_speed}/2);
+ id(motor).set_target(id(motor)->current_position - 2.5 * ${encoder_closed_pos});
- platform: gpio
name: Button 3
} else {
ESP_LOGI("cover", "idle at %d", id(encoder_tracking_)[1]);
}
+ id(motor)->set_max_speed(${max_speed});
id(pd_blinds)->current_operation = COVER_OPERATION_IDLE;
id(pd_blinds)->publish_state(false);
}
encoder_closed_pos: "230000" # full blinds length (in encoder counts) !! CHANGE TO SUIT YOUR SETUP !!
microsteps: "2"
run_current: "100m"
- max_speed: "800 steps/s"
- stallguard_threshold: "55"
+ max_speed: "800"
+ stallguard_threshold: "60"
packages:
blind: !include blind.yaml