alias: Neue Automatisierung
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.test_living_room_window
to: "on"
condition: []
action:
- service: esphome.test_control_stepper
data:
target: 1000
mode: single
Can anyone say me how i can the Position of a Stepper new calculate if a Sensor triggered.
Or how i can add for example 1000 steps to the target.
Now is my problem with this Automation that it drive just of the Position 1000, but my thought is if the sensor is triggered drive 1000 steps again and again if the sensor is new triggered
Just to remind that if you’re using that binary_sensor as a trigger, it needs to fire “off->on” that automation triggers. Maybe use launch every minute and check in condition if binary_sensor is “on”?
The code was only an example to you if you know the real sensor you want to use in your automation.
Could you have a sensor in your system called something like “test_control_stepper”/“stepper Position”? You can find all you Home Assistant entities from the developer tools->states. Do you see it there?
OK, so you have a “sensor.test_stepper_position” and I assume it shows current set position like “1000”. Now you add to your automation sensor value and add to it 1000. Everytime your binary_sensor goes something → “on”, it will keep adding 1000 value to the stepper motor position current position value. Just to give a hint, device need to change to the other value than “on” mean while if you need to continue to add 1000 to it, like on->off->on->off-on (3x1000 added to position).