October 29, 2023
Description
Material List:
I did use a universal PSU with 30W and was put the Voltage to 6V You can even go up to 9V but when you connect the NodeMCU make sure to use the VIN Connector.
I use ESPHome with this configuration
api:
encryption:
key: "****"
services:
- service: control_blind
variables:
target: int
then:
- stepper.set_target:
id: my_stepper
target: !lambda 'return target;'
- sensor.template.publish:
id: position
state: !lambda 'return target;'
cover:
- platform: template
name: "Wohnzimmer"
id: my_blind
device_class: shade
position_action:
- stepper.set_target:
id: my_stepper
target: !lambda 'return -52000 +(int(52000 * pos));'
- sensor.template.publish:
id: position
state: !lambda return id(my_stepper).current_position;
open_action:
- stepper.set_target:
id: my_stepper
target: 1 # Set the target position for fully open (0 steps)
- sensor.template.publish:
id: position
state: !lambda return id(my_stepper).current_position;
close_action:
- stepper.set_target:
id: my_stepper
target: -52000 # Set the target position for fully closed (-52000 steps)
- sensor.template.publish:
id: position
state: !lambda return id(my_stepper).current_position;
stop_action:
- stepper.set_target:
id: my_stepper
target: !lambda 'return id(my_stepper).current_position;'
- sensor.template.publish:
id: position
state: !lambda return id(my_stepper).current_position;
optimistic: true
assumed_state: true
has_position: true
sensor:
- platform: template
name: "Wohnzimmer Position"
id: position
update_interval: 1s
lambda: |-
return id(my_stepper).current_position;
stepper:
- platform: uln2003
id: my_stepper
pin_a: D1
pin_b: D2
pin_c: D5
pin_d: D6
max_speed: 500 steps/s
sleep_when_done: true
# Optional:
acceleration: inf
deceleration: inf
The 52000 in the code is the steppes needed to go all the way down. This you have to figure out yourself for your window.
For windows that are right next to each other there is a 2x version so you only need to use one NodeMCU.
License:
Creative Commons — Attribution — Noncommercial — Share Alike