popraw ten yaml do home assistant tak aby po nacisnieciu pierwszego przycisku roleta sie zamykała,. podczas zamykania jak nacisne przycisk jeszcze raz to niech robi stop i jak nacisne jeszcze raz to niech sie otwiera. pozostałe przyciski zostaw bez zmian
alias: Przycisk na 4
description: ""
triggers:
  - domain: mqtt
    device_id: b18bb1d59fe5555c68c612d1825d52c4
    type: action
    subtype: 1_single
    id: 1 single action
    trigger: device
  - domain: mqtt
    device_id: b18bb1d59fe5555c68c612d1825d52c4
    type: action
    subtype: 2_single
    id: 2 single action
    trigger: device
  - domain: mqtt
    device_id: b18bb1d59fe5555c68c612d1825d52c4
    type: action
    subtype: 3_single
    id: 3 single action
    trigger: device
  - domain: mqtt
    device_id: b18bb1d59fe5555c68c612d1825d52c4
    type: action
    subtype: 4_single
    id: 4 single action
    trigger: device
  - domain: mqtt
    device_id: b18bb1d59fe5555c68c612d1825d52c4
    type: action
    subtype: 1_double
    id: 1 double action
    trigger: device
  - domain: mqtt
    device_id: b18bb1d59fe5555c68c612d1825d52c4
    type: action
    subtype: 2_double
    id: 2 double action
    trigger: device
  - domain: mqtt
    device_id: b18bb1d59fe5555c68c612d1825d52c4
    type: action
    subtype: 3_double
    id: 3 double action
    trigger: device
  - domain: mqtt
    device_id: b18bb1d59fe5555c68c612d1825d52c4
    type: action
    subtype: 4_double
    id: 4 double action
    trigger: device
  - domain: mqtt
    device_id: b18bb1d59fe5555c68c612d1825d52c4
    type: action
    subtype: 1_hold
    id: 1 hold action
    trigger: device
  - domain: mqtt
    device_id: b18bb1d59fe5555c68c612d1825d52c4
    type: action
    subtype: 2_hold
    id: 2 hold action
    trigger: device
  - domain: mqtt
    device_id: b18bb1d59fe5555c68c612d1825d52c4
    type: action
    subtype: 3_hold
    id: 3 hold action
    trigger: device
  - domain: mqtt
    device_id: b18bb1d59fe5555c68c612d1825d52c4
    type: action
    subtype: 4_hold
    id: 4 hold action
    trigger: device
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id: 1 single action
        sequence:
          - choose:
              - conditions:
                  - condition: state
                    entity_id: cover.zaslona
                    state: open
                sequence:
                  - target:
                      entity_id:
                        - cover.zaslona
                    action: cover.close_cover
                    data: {}
              - conditions:
                  - condition: state
                    entity_id: cover.zaslona
                    state: closed
                sequence:
                  - target:
                      entity_id:
                        - cover.zaslona
                    action: cover.open_cover
                    data: {}
              - conditions:
                  - condition: or
                    conditions:
                      - condition: state
                        entity_id: cover.zaslona
                        state: opening
                      - condition: state
                        entity_id: cover.zaslona
                        state: closing
                sequence:
                  - target:
                      entity_id:
                        - cover.zaslona
                    action: cover.stop_cover
                    data: {}
                    enabled: false
                  - device_id: 4aa43bf1ebd0a6ef156e52dbb4ce2d32
                    domain: cover
                    entity_id: 6e269febbacb1772138aabac8f3085e1
                    type: stop
      - conditions:
          - condition: trigger
            id: 1 hold action
        sequence:
          - target:
              entity_id: cover.6e269febbacb1772138aabac8f3085e1
              device_id: 4aa43bf1ebd0a6ef156e52dbb4ce2d32
            action: cover.stop_cover
            data: {}
      - conditions:
          - condition: trigger
            id: 2 single action
        sequence:
          - action: light.toggle
            data: {}
            target:
              entity_id: light.0xa4c138760817fd99
            enabled: false
          - action: media_player.toggle
            metadata: {}
            data: {}
            target:
              entity_id: media_player.hisense_65e8ge_aul30080_airplay
      - conditions:
          - condition: trigger
            id: 3 single action
        sequence:
          - action: light.toggle
            metadata: {}
            data: {}
            target:
              entity_id: light.swiatlo_kuchnia_i_wyspa_l2
      - conditions:
          - condition: trigger
            id:
              - 3 double action
        sequence:
          - action: light.toggle
            metadata: {}
            data: {}
            target:
              entity_id:
                - light.swiatlo_kuchnia_i_wyspa_l1
      - conditions:
          - condition: trigger
            id:
              - 3 hold action
        sequence:
          - action: light.toggle
            metadata: {}
            data: {}
            target:
              entity_id:
                - light.swiatlo_salon_nad_naroznikiem
      - conditions:
          - condition: trigger
            id: 4 single action
        sequence:
          - action: light.toggle
            metadata: {}
            data: {}
            target:
              entity_id: light.sypialnia_kinkiet_krzysiek
      - conditions:
          - condition: trigger
            id:
              - 4 double action
        sequence:
          - action: light.toggle
            metadata: {}
            data: {}
            target:
              entity_id:
                - light.sypialnia_kinkiet_kornelka
      - conditions:
          - condition: trigger
            id:
              - 4 hold action
        sequence:
          - action: light.turn_off
            metadata: {}
            data: {}
            target:
              entity_id:
                - light.sypialnia_kinkiet_kornelka
                - light.sypialnia_kinkiet_krzysiek
mode: single