alias: Shelly Remote Control
description: ""
triggers:
  - domain: mqtt
    device_id: 52ae23ab5875a749ae481e4ebf5e3335
    type: action
    subtype: "off"
    trigger: device
    id: "1"
  - domain: mqtt
    device_id: 52ae23ab5875a749ae481e4ebf5e3335
    type: action
    subtype: "on"
    trigger: device
    id: "2"
  - domain: mqtt
    device_id: 52ae23ab5875a749ae481e4ebf5e3335
    type: action
    subtype: brightness_step_up
    trigger: device
    id: "3"
  - domain: mqtt
    device_id: 52ae23ab5875a749ae481e4ebf5e3335
    type: action
    subtype: brightness_step_down
    trigger: device
    id: "4"
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - "1"
        sequence:
          - choose:
              - conditions:
                  - condition: state
                    entity_id: sensor.shelly_remote_control_action_group
                    state:
                      - "1"
                sequence:
                  - action: light.turn_off
                    metadata: {}
                    target:
                      entity_id: light.living_room_bulbs
                    data: {}
      - conditions:
          - condition: trigger
            id:
              - "2"
        sequence:
          - choose:
              - conditions:
                  - condition: state
                    entity_id: sensor.shelly_remote_control_action_group
                    state:
                      - "1"
                sequence:
                  - action: light.turn_on
                    metadata: {}
                    target:
                      entity_id: light.living_room_bulbs
                    data: {}
      - conditions:
          - condition: trigger
            id:
              - "3"
        sequence:
          - choose:
              - conditions:
                  - condition: state
                    entity_id: sensor.shelly_remote_control_action_group
                    state:
                      - "1"
                sequence:
                  - action: light.turn_on
                    metadata: {}
                    target:
                      entity_id: light.living_room_bulbs
                    data:
                      brightness_step: >-
                        {{
                        states('sensor.shelly_remote_control_action_step_size')
                        | float * 3 | default(128) | int }}
      - conditions:
          - condition: trigger
            id:
              - "4"
        sequence:
          - choose:
              - conditions:
                  - condition: state
                    entity_id: sensor.shelly_remote_control_action_group
                    state:
                      - "1"
                sequence:
                  - action: light.turn_on
                    metadata: {}
                    target:
                      entity_id: light.living_room_bulbs
                    data:
                      brightness_step: >-
                        {{
                        states('sensor.shelly_remote_control_action_step_size')
                        | float * -1 * 3 | default(128) | int }}
mode: queued
max: 3