Calibrating Multiple Curtains with Input Select

I’ve been experimenting with automating the calibration of my curtains, and I wanted to share my approach and ask for feedback. I have four curtains in my bedroom, and I’d like to be able to calibrate them one at a time without creating separate automations for each. Here’s what I’ve come up with so far:

I’ve set up two input selects: one for selecting the curtain name and another for the corresponding cover entity. This way, I can choose which curtain I want to calibrate without having to create multiple automations. Here’s how it looks:

yaml
input_select:
curtain_select1:
name: Curtain Select 1
options:
- “Bedroom Window One”
- “Bedroom Window Two”
curtain_select2:
name: Curtain Select 2
options:
- “bedroom_window_one”
- “bedroom_window_two”

Then, I’ve created an automation that uses these input selects to determine which curtain to calibrate. Here’s the configuration:

yaml
automation:

  • alias: ‘Calibrate curtain’
    trigger:
    • platform: state
      entity_id: input_boolean.curtains_calibration
      to: ‘on’
      action:
    • service: mqtt.publish
      data:
      topic: zigbee2mqtt/{{ states(‘input_select.curtain_select1’) }}/set
      payload: ‘{ “options”: { “reset_limits”: true } }’
    • service: cover.close_cover
      entity_id: cover.{{ states(‘input_select.curtain_select2’) }}
    • delay: seconds: 15
    • service: cover.open_cover
      entity_id: cover.{{ states(‘input_select.curtain_select2’) }}

I’m wondering if this approach will work as intended or if there’s a better way to handle this. Would it be more efficient to stick with separate automations for each curtain, or is this method a good way to keep things organized? I’d love to hear other people’s experiences with similar setups!

This has been a fun project, and I’m excited to see if I can get it working smoothly. If anyone has tips or suggestions, I’d be happy to hear them!