Task to lower awning using "printed_circuit"

Hello

I use a printed_circuit_board_switch_2_channel connected to a somfy module and wants to lower the awning.
Goal is:

  • Channel 1 extends the awning
    • if Channel 1 gets active, channel 2 gets inactive
    • Channel gets inactive after 20 seconds (time to extend the awning)
  • Channel 2 retracks the awning
    • if Channel 2 gets active, channel 1 gets inactive
    • Channel gets inactive after 20 seconds (time to retrack the awning)

Has someone coded this in the past ? Thank you for some hints!
Cheers
Laurent

Extend Awning

alias: Markise Ausfahren
description: ''
trigger:
  - platform: device
    type: turned_on
    device_id: ee07f7723bf142cc9524c26bba8d9ef7
    entity_id: switch.printed_circuit_board_switch_2_channel1
    domain: switch
condition: []
action:
  - type: turn_off
    device_id: ee07f7723bf142cc9524c26bba8d9ef7
    entity_id: switch.printed_circuit_board_switch_2_channel2
    domain: switch
  - wait_template: ''
    timeout: '00:00:20'
    continue_on_timeout: true
  - type: turn_off
    device_id: ee07f7723bf142cc9524c26bba8d9ef7
    entity_id: switch.printed_circuit_board_switch_2_channel1
    domain: switch
mode: single

Retract Awning

alias: Markise Einfahren
description: ''
trigger:
  - platform: device
    type: turned_on
    device_id: ee07f7723bf142cc9524c26bba8d9ef7
    entity_id: switch.printed_circuit_board_switch_2_channel2
    domain: switch
condition: []
action:
  - type: turn_off
    device_id: ee07f7723bf142cc9524c26bba8d9ef7
    entity_id: switch.printed_circuit_board_switch_2_channel1
    domain: switch
  - wait_template: ''
    timeout: '00:00:20'
    continue_on_timeout: true
  - type: turn_off
    device_id: ee07f7723bf142cc9524c26bba8d9ef7
    entity_id: switch.printed_circuit_board_switch_2_channel2
    domain: switch
mode: single

:grinning: