blueprint:
  name: Aqara-Magic-Cube-T1-Pro-(CTP-R01) - 2024-06-04
  author: SirGoodenough
  description: "This Blueprint uses a Zigbee2MQTT built sensor to sort out the 58+
    unique commands (118+ total) available from the Xiaomi Magic Cube Remote. (Some
    unique commands listed as + are not counted & available thru templating only.
    See the related document.)\n**NOTE:** This blueprint is for the PRO cube version
    ONLY and is not fully compatible with the original version of the cube. Links
    for those are in my [GIT repository](https://github.com/SirGoodenough/HA_Blueprints).\nThis
    cube has an 'Action' mode (Shown below with this graphic: \U0001FAF3 ACTION MODE
    ONLY \U0001FAF3 )\nand a 'Scene' mode (Shown below with this graphic: \U0001F440
    SCENE MODE ONLY \U0001F440 ).\nMake sure the cube is in the mode you think it
    is in when triggering it. The functions are separate. IE 'Action - slide' will
    do something different from 'Scene - slide'.\nThe split out of functions gives
    you the ability to assign local scripts or functions to do the things you want
    the remote to do.\nFunctions that are left empty will simply do nothing.\n####
    \U0001F34E There is a set of 36 + 18 actions that will trigger on specific actions
    on specific sides that are listed as **Group 1 \U0001F34E**\n#### \U0001F352 There
    is a set of 6 + 3 actions that will trigger on specific actions on *ANY* side
    that are listed as **Group 2 \U0001F352**\n#### \U0001F350 There is a set of 30
    + 30 event functions that will trigger on cube flips to & from specific sides
    that are listed as **Group 3 \U0001F350**\n#### \U0001F355 There are 5 actions
    (shake & throw for each mode & hold in scene mode) that only occur once in each
    mode & are OK to be combined with any other group in that mode.  Listed as **Group
    4 sections \U0001F355**.\nPlease be aware that ALL actions except the 4 listed
    above, \U0001F355 will trigger an action in **ALL 3 groups in the matching mode
    at the same time** every time. Therefore I suggest if you just have a couple of
    things you want this remote to do that you choose the *ANY / Group 2 / \U0001F352*
    events.  Action events and Scene events are separate from each other.\nIf you
    want more than a few events, you should select actions in **Group 1 / \U0001F34E
    OR Group 3 / \U0001F350**.\nWith careful selection you can use mixed groups, but
    you run the risk of a single cube action triggering more than 1 Home Assistant
    action and making a mess of things \U0001F371.\n\n#### NOTICE: This cube *can*
    be triggered 124 ways, but only 38(+54) of them are unique (with templating).\n#####
    This blueprint has been known to freak out when there are spaces or odd characters
    in the MQTT Topic. Make sure there are no spaces, ONLY a single word, and ONLY
    A thru Z, a thru z, and 0 thru 9 in the topic. (```  /  ``` is ok between device
    and topic) If there are, you will need to change the name of the cube to remove
    those characters.\n### IF YOU SEE --> TemplateError: Must provide a device or
    entity ID\nIf you get an error like that, The friendly_name in Z2M likely does
    not match the  friendly_name on HA. To fix go into the Z2M ```Open web UI``` and
    set the  friendly_name there. Setting this in just HA or in Z2M without ticking
    the update HA box will cause this. See the blueprint documentation page for details.\n\nThere
    is sample code to make the template sensor in the help file on GitHib named [Zigbee2MQTT
    - Xiaomi Cube Controller MQTT Triggered.md](https://github.com/SirGoodenough/HA_Blueprints/blob/master/Automations/Zigbee2MQTT%20-%20Xiaomi%20Cube%20Controller%20MQTT%20Triggered.md)
    & in the [community page related to this](https://community.home-assistant.io/t/zigbee2mqtt-xiaomi-cube-controller/393203).\n\nWithin
    this blueprint there is an event handler that will latch the last command that
    the blueprint finds and sends that to the event buss. From there a simple Template
    sensor can grab it and show you the last action sent. Thie will help when setting
    up new functions and to troubleshoot strange behaviours.\n\n> This was forked
    from https://community.home-assistant.io/t/z2m-xiaomi-cube-controller/263006 1.2
    project authored by luckypoppy and the friends he pulled together to create the
    base. I sincerely thank Him (Them) for their work. I felt there needed to be more
    documentation for rookie users to properly set this up. I had quite a few questions
    and when I saw a few questions in that chat from people struggling, I wanted to
    help. I also had a better idea for troubleshooting info.\n\n[Community link for
    this blueprint](https://community.home-assistant.io/t/zigbee2mqtt-aqara-magic-cube-t1-pro-ctp-r01-xiaomi-lumi-cagl02/525111)\n\n##
    \U0001F5FFNotice\U0001F46E\U0001F3FF‍♂️:\n* Copies of the original Blueprint that
    were converted via the 'Take Control' feature or other means are officially not
    supported by me.\n\n* I may or may not be able to support you when you have a
    problem after you make changes to my code, as some of the code is no longer mine.\n\n*
    I & my license also require attribution as a link back to the original should
    you use this code in your own creation.\n\n* [Here is a link to my license & the
    original github post](https://github.com/SirGoodenough/HA_Blueprints?tab=License-1-ov-file)
    expected to be followed & referenced as attribution should you use this code elsewhere.\n"
  source_url: https://github.com/SirGoodenough/HA_Blueprints/blob/master/Automations/Zigbee2MQTT-Aqara-Magic-Cube-T1-Pro-CTP-R01-Xiaomi-Lumi.yaml
  domain: automation
  homeassistant:
    min_version: 2024.6.0
  input:
    required_input:
      name: "Required input \U0001F440"
      icon: mdi:alert-box
      collapsed: false
      description: "This blueprint has been known to freak out when there are spaces
        or odd characters\n  in the MQTT Topic. Make sure there are no spaces, ONLY
        a single word,\n  and ONLY A thru Z, a thru z, and 0 thru 9 in the topic.\n
        \ (```  /  ``` is ok between device and topic)\n\n  If there are other characters,
        you will need to change the name of the cube to\n  remove those characters.\n\n
        \ ### IF YOU SEE --> TemplateError: Must provide a device or entity ID\n\n
        \ If you get an error like that, The friendly_name in Z2M likely does not
        match the \n  friendly_name on HA. To fix go into the Z2M ```Open web UI```
        and set the \n  friendly_name there. Setting this in just HA or in Z2M without
        ticking the update HA\n  box will cause this. See the blueprint documentation
        page for details.\n"
      input:
        topic:
          name: Topic
          description: "The main MQTT Topic for your cube. \nDetails on finding the
            correct topic can be found here: \n[Find my Cube Topic](https://github.com/SirGoodenough/HA_Blueprints/blob/master/Automations/Zigbee2MQTT-Aqara-Magic-Cube-T1-Pro-CTP-R01-Xiaomi-Lumi.md#to-make-the-blueprint-work-it-will-need)\n"
          default: zigbee2mqtt/?
          selector:
            text:
              multiline: false
              multiple: false
    optional_conditions:
      name: "Optional conditions\U0001F913"
      icon: mdi:alert-octagon-outline
      collapsed: true
      description: "This input was added by user request. With it you can add your
        own condition.\n  If you only want the cube to work like this in the morning,\n
        \ then after 6pm you want it to do different actions, add a condition that\n
        \ will only let this run from 6am until 6pm. Then have another copy of\n  the
        blueprint that will only run from 6pm until 6am. (for example)\n\n  Any valid
        conditions you can dream up, you should be able to add here.\n\n  Leave it
        as the default of you don't want to add a condition of your own.\n"
      input:
        additional_conditions:
          name: Additional conditions
          description: "Extra conditions you may want to add to this automation \n(Example:
            Home occupied, TV on, etc)\n"
          default: []
          selector:
            condition: {}
    action_side_1_group_1_actions:
      name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Side 1 Group 1 actions \U0001F34E"
      icon: mdi:numeric-1-box
      collapsed: true
      description: "These are Group 1 actions that end with Face 1\n  (the one with
        the 'Aqara' LOGO) of the cube up to start.\n"
      input:
        action_slide_face_1:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Slide with
            face 1 up"
          description: Face 1 is the one with the 'Aqara' LOGO
          default: []
          selector:
            action: {}
        action_doubletap_face_1:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Double
            tap with face 1 up"
          description: Face 1 is the one with the 'Aqara' LOGO
          default: []
          selector:
            action: {}
        action_flipped90_face_1:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Flip 90
            degrees to face 1"
          description: Face 1 is the one with the 'Aqara' LOGO
          default: []
          selector:
            action: {}
        action_flipped180_face_1:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Flip 180
            degrees to face 1"
          description: '**NOTE:** This action is trick to master, and should be used
            sparingly... Face 1 is the one with the ''Aqara'' LOGO'
          default: []
          selector:
            action: {}
        action_flip_from_any_to_face_1:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Flip From
            any face to face 1"
          description: Face 1 is the one with the 'Aqara' LOGO
          default: []
          selector:
            action: {}
        action_rotate_cw_face_1:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Rotate
            CW with face 1 up"
          description: Face 1 is the one with the 'Aqara' LOGO
          default: []
          selector:
            action: {}
        action_rotate_ccw_face_1:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Rotate
            CCW with face 1 up"
          description: Face 1 is the one with the 'Aqara' LOGO
          default: []
          selector:
            action: {}
    action_side_2_group_1_actions:
      name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Side 2 Group 1 actions \U0001F34E"
      icon: mdi:numeric-2-box
      collapsed: true
      description: 'These are Group 1 actions that end with Face 2

        '
      input:
        action_slide_face_2:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Slide with
            face 2 up"
          default: []
          selector:
            action: {}
        action_doubletap_face_2:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Double
            tap with face 2 up"
          default: []
          selector:
            action: {}
        action_flipped90_face_2:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Flip 90
            degrees to face 2"
          default: []
          selector:
            action: {}
        action_flipped180_face_2:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Flip 180
            degrees to face 2"
          description: '**NOTE:** This action is trick to master, and should be used
            sparingly...'
          default: []
          selector:
            action: {}
        action_flip_from_any_to_face_2:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Flip From
            any face to face 2"
          default: []
          selector:
            action: {}
        action_rotate_cw_face_2:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Rotate
            CW with face 2 up"
          default: []
          selector:
            action: {}
        action_rotate_ccw_face_2:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Rotate
            CCW with face 2 up"
          default: []
          selector:
            action: {}
    action_side_3_group_1_actions:
      name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Side 3 Group 1 actions \U0001F34E"
      icon: mdi:numeric-3-box
      collapsed: true
      description: 'These are Group 1 actions that end with Face 3

        '
      input:
        action_slide_face_3:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Slide with
            face 3 up"
          default: []
          selector:
            action: {}
        action_doubletap_face_3:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Double
            tap with face 3 up"
          default: []
          selector:
            action: {}
        action_flipped90_face_3:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Flip 90
            degrees to face 3"
          default: []
          selector:
            action: {}
        action_flipped180_face_3:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Flip 180
            degrees to face 3"
          description: '**NOTE:** This action is trick to master, and should be used
            sparingly...'
          default: []
          selector:
            action: {}
        action_flip_from_any_to_face_3:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Flip From
            any face to face 3"
          default: []
          selector:
            action: {}
        action_rotate_cw_face_3:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Rotate
            CW with face 3 up"
          default: []
          selector:
            action: {}
        action_rotate_ccw_face_3:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Rotate
            CCW with face 3 up"
          default: []
          selector:
            action: {}
    action_side_4_group_1_actions:
      name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Side 4 Group 1 actions \U0001F34E"
      icon: mdi:numeric-4-box
      collapsed: true
      description: 'These are Group 1 actions that end with Face 4

        '
      input:
        action_slide_face_4:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Slide with
            face 4 up"
          default: []
          selector:
            action: {}
        action_doubletap_face_4:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Double
            tap with face 4 up"
          default: []
          selector:
            action: {}
        action_flipped90_face_4:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Flip 90
            degrees to face 4"
          default: []
          selector:
            action: {}
        action_flipped180_face_4:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Flip 180
            degrees to face 4"
          description: '**NOTE:** This action is trick to master, and should be used
            sparingly...'
          default: []
          selector:
            action: {}
        action_flip_from_any_to_face_4:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Flip From
            any face to face 4"
          default: []
          selector:
            action: {}
        action_rotate_cw_face_4:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Rotate
            CW with face 4 up"
          default: []
          selector:
            action: {}
        action_rotate_ccw_face_4:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Rotate
            CCW with face 4 up"
          default: []
          selector:
            action: {}
    action_side_5_group_1_actions:
      name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Side 5 Group 1 actions \U0001F34E"
      icon: mdi:numeric-5-box
      collapsed: true
      description: 'These are Group 1 actions that end with Face 5

        '
      input:
        action_slide_face_5:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Slide with
            face 5 up"
          default: []
          selector:
            action: {}
        action_doubletap_face_5:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Double
            tap with face 5 up"
          default: []
          selector:
            action: {}
        action_flipped90_face_5:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Flip 90
            degrees to face 5"
          default: []
          selector:
            action: {}
        action_flipped180_face_5:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Flip 180
            degrees to face 5"
          description: '**NOTE:** This action is trick to master, and should be used
            sparingly...'
          default: []
          selector:
            action: {}
        action_flip_from_any_to_face_5:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Flip From
            any face to face 5"
          default: []
          selector:
            action: {}
        action_rotate_cw_face_5:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Rotate
            CW with face 5 up"
          default: []
          selector:
            action: {}
        action_rotate_ccw_face_5:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Rotate
            CCW with face 5 up"
          default: []
          selector:
            action: {}
    action_side_6_group_1_actions:
      name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Side 6 Group 1 actions \U0001F34E"
      icon: mdi:numeric-6-box
      collapsed: true
      description: 'These are Group 1 actions that end with Face 6

        '
      input:
        action_slide_face_6:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Slide with
            face 6 up"
          default: []
          selector:
            action: {}
        action_doubletap_face_6:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Double
            tap with face 6 up"
          default: []
          selector:
            action: {}
        action_flipped90_face_6:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Flip 90
            degrees to face 6"
          default: []
          selector:
            action: {}
        action_flipped180_face_6:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Flip 180
            degrees to face 6"
          description: '**NOTE:** This action is trick to master, and should be used
            sparingly...'
          default: []
          selector:
            action: {}
        action_flip_from_any_to_face_6:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Flip From
            any face to face 6"
          default: []
          selector:
            action: {}
        action_rotate_cw_face_6:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Rotate
            CW with face 6 up"
          default: []
          selector:
            action: {}
        action_rotate_ccw_face_6:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 1 \U0001F34E Rotate
            CCW with face 6 up"
          default: []
          selector:
            action: {}
    action_any_side_group_2_actions:
      name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Any side Group 2 actions \U0001F352"
      icon: mdi:fruit-cherries
      collapsed: true
      description: "\U0001F352 These are a set of 6 event functions that will trigger
        on specific actions\n  on *ANY* side. **Group 2 actions \U0001F352**\n"
      input:
        action_slide_any:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 2 \U0001F352 Slide on
            any side"
          description: "Side doesn't matter on this one.\n**!!Warning!!** The automations
            for the specific side will also trigger. \U0001F34E\U0001F350\nI suggest
            using only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_doubletap_any:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 2 \U0001F352 Double
            tap on any side"
          description: "Side doesn't matter on this one.\n**!!Warning!!** The automations
            for the specific side will also trigger. \U0001F34E\U0001F350\nI suggest
            using only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_flipped90_any:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 2 \U0001F352 Flip 90
            degrees to any side"
          description: "Side doesn't matter on this one.\n**!!Warning!!** The automations
            for the specific side will also trigger. \U0001F34E\U0001F350\nI suggest
            using only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_flipped180_any:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 2 \U0001F352 Flip 180
            degrees to any side"
          description: "NOTE: This action is trick to master, and should be used sparingly...
            Side doesn't matter on this one.\n**!!Warning!!** The automations for
            the specific side will also trigger. \U0001F34E\U0001F350\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_rotate_cw_any:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 2 \U0001F352 Rotate
            CW on any side"
          description: "Side doesn't matter on this one.\n**!!Warning!!** The automations
            for the specific side will also trigger. \U0001F34E\U0001F350\nI suggest
            using only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_rotate_ccw_any:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 2 \U0001F352 Rotate
            CCW on any side"
          description: "Side doesn't matter on this one.\n**!!Warning!!** The automations
            for the specific side will also trigger. \U0001F34E\U0001F350\nI suggest
            using only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
    action_side_1_group_3_actions:
      name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Side 1 Group 3 actions \U0001F350"
      icon: mdi:numeric-1-circle
      collapsed: true
      description: "These are Group 3 actions that happen with Face 1 as the ending
        point.\n  All are flips from another side to side 1.\n"
      input:
        action_1_from_6:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 1 from side 6"
          description: "**!!Warning!!** The flip 180 automations \U0001F34E for side
            1 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_1_from_2:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 1 from side 2"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            1 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_1_from_3:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 1 from side 3"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            1 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_1_from_4:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 1 from side 4"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            1 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_1_from_5:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 1 from side 5"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            1 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
    action_side_2_group_3_actions:
      name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Side 2 Group 3 actions \U0001F350"
      icon: mdi:numeric-2-circle
      collapsed: true
      description: "These are Group 3 actions that happen with Face 2 as the ending
        point.\n  All are flips from another side to side 2.\n"
      input:
        action_2_from_1:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 2 from side 1"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            2 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_2_from_3:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 2 from side 3"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            2 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_2_from_4:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 2 from side 4"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            2 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_2_from_5:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 2 from side 5"
          description: "**!!Warning!!** The flip 180 automations \U0001F34E for side
            2 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_2_from_6:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 2 from side 6"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            2 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
    action_side_3_group_3_actions:
      name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Side 3 Group 3 actions \U0001F350"
      icon: mdi:numeric-3-circle
      collapsed: true
      description: "These are Group 3 actions that happen with Face 3 as the ending
        point.\n  All are flips from another side to side 3.\n"
      input:
        action_3_from_1:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 3 from side 1"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            3 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_3_from_2:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 3 from side 2"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            3 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_3_from_4:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 3 from side 4"
          description: "**!!Warning!!** The flip 180 automations \U0001F34E for side
            3 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_3_from_5:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 3 from side 5"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            3 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_3_from_6:
          name: "G\U0001FAF3 ACTION MODE ONLY \U0001FAF3 roup 3 \U0001F350 Flip to
            side 3 from side 6"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            3 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
    action_side_4_group_3_actions:
      name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Side 4 Group 3 actions \U0001F350"
      icon: mdi:numeric-4-circle
      collapsed: true
      description: "These are Group 3 actions that happen with Face 4 as the ending
        point.\n  All are flips from another side to side 4.\n"
      input:
        action_4_from_1:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 4 from side 1"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            4 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_4_from_2:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 4 from side 2"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            4 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_4_from_3:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 4 from side 3"
          description: "**!!Warning!!** The flip 180 automations \U0001F34E for side
            4 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_4_from_5:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 4 from side 5"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            4 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_4_from_6:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 4 from side 6"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            4 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
    action_side_5_group_3_actions:
      name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Side 5 Group 3 actions \U0001F350"
      icon: mdi:numeric-5-circle
      collapsed: true
      description: "These are Group 3 actions that happen with Face 5 as the ending
        point.\n  All are flips from another side to side 5.\n"
      input:
        action_5_from_1:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 5 from side 1"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            5 and the ANY \U0001F352 automations will also trigger. \U0001F34E\U0001F350\nI
            suggest using only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_5_from_2:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 5 from side 2"
          description: "**!!Warning!!** The flip 180 automations \U0001F34E for side
            5 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_5_from_3:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 5 from side 3"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            5 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_5_from_4:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 5 from side 4"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            5 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_5_from_6:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 5 from side 6"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            5 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
    action_side_6_group_3_actions:
      name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Side 2 Group 3 actions \U0001F350"
      icon: mdi:numeric-6-circle
      collapsed: true
      description: "These are Group 3 actions that happen with Face 6 as the ending
        point.\n  All are flips from another side to side 6.\n"
      input:
        action_6_from_1:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 6 from side 1"
          description: "**!!Warning!!** The flip 180 automations \U0001F34E for side
            6 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_6_from_2:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 6 from side 2"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            6 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_6_from_3:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 6 from side 3"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            6 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_6_from_4:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 6 from side 4"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            6 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        action_6_from_5:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Group 3 \U0001F350 Flip to
            side 6 from side 5"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            6 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
    group_4_actions:
      name: "Group 4 actions only used once (no side) \U0001F355"
      icon: mdi:pizza
      collapsed: true
      description: "These are Group 4 actions only used once (no side) \U0001F355\n
        \ they can be safely compined with any other action mode command.\n"
      input:
        action_shake:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Shake the cube \U0001F355
            Group 4"
          description: 'This trigger only occurs once in the set-up.

            It can be combined in any group.'
          default: []
          selector:
            action: {}
        action_throw:
          name: "\U0001FAF3 ACTION MODE ONLY \U0001FAF3 Throw the cube \U0001F355
            Group 4"
          description: ' You don''t actually ''Throw'' the cube. The action is as
            follows:

            > Pick up the cube firmly.

            > Make a throwing motion with it but do not motion back towards yourself.

            > Hold it there for a second.

            > The throw trigger should be sent to Z2M.


            This trigger only occurs once in the set-up.

            It can be combined in any group.'
          default: []
          selector:
            action: {}
    scene_side_1_group_1_actions:
      name: "\U0001F440 SCENE MODE ONLY \U0001F440 Side 1 Group 1 actions \U0001F34E"
      icon: mdi:numeric-1-box
      collapsed: true
      description: "These are Group 1 actions that end with Face 1\n  (the one with
        the 'Aqara' LOGO) of the cube up to start.\n"
      input:
        scene_flip_to_face_1:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 1 \U0001F34E Flip to
            face 1 from any other face"
          description: Face 1 is the one with the ''Aqara'' LOGO'
          default: []
          selector:
            action: {}
        scene_rotate_cw_face_1:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 1 \U0001F34E Rotate cube
            CW with face 1 up"
          description: Face 1 is the one with the 'Aqara' LOGO
          default: []
          selector:
            action: {}
        scene_rotate_ccw_face_1:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 1 \U0001F34E Rotate cube
            CCW with face 1 up"
          description: Face 1 is the one with the 'Aqara' LOGO
          default: []
          selector:
            action: {}
    scene_side_2_group_1_actions:
      name: "\U0001F440 SCENE MODE ONLY \U0001F440 Side 2 Group 1 actions \U0001F34E"
      icon: mdi:numeric-2-box
      collapsed: true
      description: 'These are Group 1 actions that end with Face 2

        '
      input:
        scene_flip_to_face_2:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 1 \U0001F34E Flip to
            face 2 from any other face"
          default: []
          selector:
            action: {}
        scene_rotate_cw_face_2:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 1 \U0001F34E Rotate cube
            CW with face 2 up"
          default: []
          selector:
            action: {}
        scene_rotate_ccw_face_2:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 1 \U0001F34E Rotate cube
            CCW with face 2 up"
          default: []
          selector:
            action: {}
    scene_side_3_group_1_actions:
      name: "\U0001F440 SCENE MODE ONLY \U0001F440 Side 3 Group 1 actions \U0001F34E"
      icon: mdi:numeric-3-box
      collapsed: true
      description: 'These are Group 1 actions that end with Face 3

        '
      input:
        scene_flip_to_face_3:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 1 \U0001F34E Flip to
            face 3 from any other face"
          default: []
          selector:
            action: {}
        scene_rotate_cw_face_3:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 1 \U0001F34E Rotate cube
            CW with face 3 up"
          default: []
          selector:
            action: {}
        scene_rotate_ccw_face_3:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 1 \U0001F34E Rotate cube
            CCW with face 3 up"
          default: []
          selector:
            action: {}
    scene_side_4_group_1_actions:
      name: "\U0001F440 SCENE MODE ONLY \U0001F440 Side 4 Group 1 actions \U0001F34E"
      icon: mdi:numeric-4-box
      collapsed: true
      description: 'These are Group 1 actions that end with Face 4

        '
      input:
        scene_flip_to_face_4:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 1 \U0001F34E Flip to
            face 4 from any other face"
          default: []
          selector:
            action: {}
        scene_rotate_cw_face_4:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 1 \U0001F34E Rotate cube
            CW with face 4 up"
          default: []
          selector:
            action: {}
        scene_rotate_ccw_face_4:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 1 \U0001F34E Rotate cube
            CCW with face 4 up"
          default: []
          selector:
            action: {}
    scene_side_5_group_1_actions:
      name: "\U0001F440 SCENE MODE ONLY \U0001F440 Side 5 Group 1 actions \U0001F34E"
      icon: mdi:numeric-5-box
      collapsed: true
      description: 'These are Group 1 actions that end with Face 5

        '
      input:
        scene_flip_to_face_5:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 1 \U0001F34E Flip to
            face 5 from any other face"
          default: []
          selector:
            action: {}
        scene_rotate_cw_face_5:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 1 \U0001F34E Rotate cube
            CW with face 5 up"
          default: []
          selector:
            action: {}
        scene_rotate_ccw_face_5:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 1 \U0001F34E Rotate cube
            CCW with face 5 up"
          default: []
          selector:
            action: {}
    scene_side_6_group_1_actions:
      name: "\U0001F440 SCENE MODE ONLY \U0001F440 Side 6 Group 1 actions \U0001F34E"
      icon: mdi:numeric-6-box
      collapsed: true
      description: 'These are Group 1 actions that end with Face 6

        '
      input:
        scene_flip_to_face_6:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 1 \U0001F34E Flip to
            face 6 from any other face"
          default: []
          selector:
            action: {}
        scene_rotate_cw_face_6:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 1 \U0001F34E Rotate cube
            CW with face 6 up"
          default: []
          selector:
            action: {}
        scene_rotate_ccw_face_6:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 1 \U0001F34E Rotate cube
            CCW with face 6 up"
          default: []
          selector:
            action: {}
    scene_any_side_group_2_actions:
      name: "\U0001F440 SCENE MODE ONLY \U0001F440 Any side Group 2 actions \U0001F352"
      icon: mdi:fruit-cherries
      collapsed: true
      description: "\U0001F352 These are a set of 6 event functions that will trigger
        on specific actions\n  on *ANY* side. **Group 2 actions \U0001F352**\n"
      input:
        scene_flip_to_side_any:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 2 \U0001F352 Flip to
            any side"
          description: "Side doesn't matter on this one.\n**!!Warning!!** The automations
            for the specific side will also trigger. \U0001F34E\U0001F350\nI suggest
            using only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_rotate_cw_any:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 2 \U0001F352 Rotate cube
            CW with any side"
          description: "Side doesn't matter on this one.\n**!!Warning!!** The automations
            for the specific side will also trigger. \U0001F34E\U0001F350\nI suggest
            using only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_rotate_ccw_any:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 2 \U0001F352 Rotate cube
            CCW with any side"
          description: "Side doesn't matter on this one.\n**!!Warning!!** The automations
            for the specific side will also trigger. \U0001F34E\U0001F350\nI suggest
            using only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
    scene_side_1_group_3_actions:
      name: "\U0001F440 SCENE MODE ONLY \U0001F440 Side 1 Group 3 actions \U0001F350"
      icon: mdi:numeric-1-circle
      collapsed: true
      description: "These are Group 3 actions that happen with Face 1 as the ending
        point.\n  All are flips from another side to side 1.\n"
      input:
        scene_1_from_6:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 1 from side 6"
          description: "**!!Warning!!** The flip 180 automations \U0001F34E for side
            1 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_1_from_2:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 1 from side 2"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            1 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_1_from_3:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 1 from side 3"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            1 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_1_from_4:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 1 from side 4"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            1 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_1_from_5:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 1 from side 5"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            1 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
    scene_side_2_group_3_actions:
      name: "\U0001F440 SCENE MODE ONLY \U0001F440 Side 2 Group 3 actions \U0001F350"
      icon: mdi:numeric-2-circle
      collapsed: true
      description: "These are Group 3 actions that happen with Face 2 as the ending
        point.\n  All are flips from another side to side 2.\n"
      input:
        scene_2_from_1:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 2 from side 1"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            2 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_2_from_3:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 2 from side 3"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            2 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_2_from_4:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 2 from side 4"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            2 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_2_from_5:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 2 from side 5"
          description: "**!!Warning!!** The flip 180 automations \U0001F34E for side
            2 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_2_from_6:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 2 from side 6"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            2 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
    scene_side_3_group_3_actions:
      name: "\U0001F440 SCENE MODE ONLY \U0001F440 Side 3 Group 3 actions \U0001F350"
      icon: mdi:numeric-3-circle
      collapsed: true
      description: "These are Group 3 actions that happen with Face 3 as the ending
        point.\n  All are flips from another side to side 3.\n"
      input:
        scene_3_from_1:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 3 from side 1"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            3 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_3_from_2:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 3 from side 2"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            3 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_3_from_4:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 3 from side 4"
          description: "**!!Warning!!** The flip 180 automations \U0001F34E for side
            3 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_3_from_5:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 3 from side 5"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            3 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_3_from_6:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 3 from side 6"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            3 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
    scene_side_4_group_3_actions:
      name: "\U0001F440 SCENE MODE ONLY \U0001F440 Side 4 Group 3 actions \U0001F350"
      icon: mdi:numeric-4-circle
      collapsed: true
      description: "These are Group 3 actions that happen with Face 4 as the ending
        point.\n  All are flips from another side to side 4.\n"
      input:
        scene_4_from_1:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 4 from side 1"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            4 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_4_from_2:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 4 from side 2"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            4 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_4_from_3:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 4 from side 3"
          description: "**!!Warning!!** The flip 180 automations \U0001F34E for side
            4 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_4_from_5:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 4 from side 5"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            4 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_4_from_6:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 4 from side 6"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            4 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
    scene_side_5_group_3_actions:
      name: "\U0001F440 SCENE MODE ONLY \U0001F440 Side 5 Group 3 actions \U0001F350"
      icon: mdi:numeric-5-circle
      collapsed: true
      description: "These are Group 3 actions that happen with Face 5 as the ending
        point.\n  All are flips from another side to side 5.\n"
      input:
        scene_5_from_1:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 5 from side 1"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            5 and the ANY \U0001F352 automations will also trigger. \U0001F34E\U0001F350\nI
            suggest using only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_5_from_2:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 5 from side 2"
          description: "**!!Warning!!** The flip 180 automations \U0001F34E for side
            5 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_5_from_3:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 5 from side 3"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            5 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_5_from_4:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 5 from side 4"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            5 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_5_from_6:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 5 from side 6"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            5 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
    scene_side_6_group_3_actions:
      name: "\U0001F440 SCENE MODE ONLY \U0001F440 Side 6 Group 3 actions \U0001F350"
      icon: mdi:numeric-6-circle
      collapsed: true
      description: "These are Group 3 actions that happen with Face 6 as the ending
        point.\n  All are flips from another side to side 6.\n"
      input:
        scene_6_from_1:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 6 from side 1"
          description: "**!!Warning!!** The flip 180 automations \U0001F34E for side
            6 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_6_from_2:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 6 from side 2"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            6 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_6_from_3:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 6 from side 3"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            6 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_6_from_4:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 6 from side 4"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            6 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
        scene_6_from_5:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Group 3 \U0001F350 Flip to
            side 6 from side 5"
          description: "**!!Warning!!** The flip 90 automations \U0001F34E for side
            6 and the ANY \U0001F352 automations will also trigger.\nI suggest using
            only one of the three groups of triggers, not multiple groups..."
          default: []
          selector:
            action: {}
    scene_group_4_actions:
      name: "Group 4 actions only used once (no side) \U0001F355"
      icon: mdi:pizza
      collapsed: true
      description: "These are Group 4 actions only used once (no side) \U0001F355\n
        \ they can be safely compined with any other scene mode command.\n"
      input:
        scene_hold:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Lift up the cube and hold it
            still \U0001F355"
          description: 'This trigger only occurs once in the set-up.

            It can be combined in any group.'
          default: []
          selector:
            action: {}
        scene_shake:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Shake the cube \U0001F355"
          description: 'This trigger only occurs once in the set-up.

            It can be combined in any group.'
          default: []
          selector:
            action: {}
        scene_throw:
          name: "\U0001F440 SCENE MODE ONLY \U0001F440 Throw the cube \U0001F355"
          description: ' You don''t actually ''Throw'' the cube. The action is as
            follows:

            > Pick up the cube firmly.

            > Make a throwing motion with it but do not motion back towards yourself.

            > Hold it there for a second.

            > The throw trigger should be sent to Z2M.


            This trigger only occurs once in the set-up.

            It can be combined in any group.'
          default: []
          selector:
            action: {}
triggers:
- trigger: mqtt
  topic: !input topic
variables:
  action: "{% if trigger.payload_json.action is defined %}\n  {{ trigger.payload_json.action
    }}\n{% else %}\n  none\n{% endif %}\n"
  angle: "{% if trigger.payload_json.action_angle is number %}\n  {{ trigger.payload_json.action_angle
    | float(0.0) }}\n{% else %}\n  0.0\n{% endif %}\n"
  side: "{% if trigger.payload_json.side is number %}\n  {{ trigger.payload_json.side
    | int(0) }}\n{% else %}\n  0\n{% endif %}\n"
  op_mode: "{% if trigger.payload_json.operation_mode is defined %}\n  {{ trigger.payload_json.operation_mode
    }}\n{% else %}\n  none\n{% endif %}\n"
  topic_var: !input topic
  friendly_name: '{{ topic_var.split(''/'')[1] | regex_replace("[^A-Za-z0-9_/./-]",
    "") }}'
  device_id: '{{ device_id( friendly_name ) }}'
  ieee_id_long: '{{(( device_attr( device_id, ''identifiers'') |list)[0][1]) }}'
  ieee_id: '{{ieee_id_long.split(''_'')[1] }}'
  num_name: last side
  num_ha_name: '{{ ''number.'' + friendly_name + ''_last_side'' }}'
  num_ha_val: '{{ states(num_ha_name) | default(0) | int(0) }}'
  last_side: "{# The first time it will not be there, so make sure its 0 instead of
    undefined. #} {% if not num_ha_val in [\"undefined\", \"unknown\", \"unavailable\",
    \"none\", \"null\", \"\"] %}\n  {{ num_ha_val }}\n{% else %}\n  0\n{% endif %}\n"
  mdl: Number Helper for Z2M Cube T1-Pro Integration
  mf: SirGoodenough
  sa: house
  sw: '2023-12-09'
  hw: https://github.com/SirGoodenough/HA_Blueprints/blob/master/Automations/Zigbee2MQTT-Aqara-Magic-Cube-T1-Pro-CTP-R01-Xiaomi-Lumi.yaml
  cu: https://community.home-assistant.io/t/zigbee2mqtt-aqara-magic-cube-t1-pro-ctp-r01-xiaomi-lumi-cagl02/525111
  config_topic_2: '{{ ''homeassistant/number/'' + ieee_id + ''/last_side/config''
    }}'
  topic_2: '{{ ''homeassistant/number/'' + ieee_id + ''/last_side'' }}'
conditions:
- condition: or
  conditions:
  - condition: template
    alias: Check for valid Action Mode triggers
    value_template: "{{ trigger.payload_json is defined and\n  trigger.payload_json.operation_mode
      is defined and\n  trigger.payload_json.action is defined and\n  trigger.payload_json.operation_mode
      == \"action_mode\" and\n  trigger.payload_json.action in [\"rotate_right\",
      \"rotate_left\",\n  \"flip90\", \"flip180\", \"slide\", \"tap\", \"shake\",
      \"throw\"] }}\n"
  - condition: template
    alias: Check for valid Scene Mode triggers
    value_template: "{{ trigger.payload_json is defined and\n  trigger.payload_json.operation_mode
      is defined and\n  trigger.payload_json.action is defined and\n  trigger.payload_json.operation_mode
      == \"scene_mode\" and\n  trigger.payload_json.action in [\"rotate_right\", \"rotate_left\",\n
      \ \"flip_to_side\", \"shake\", \"throw\", \"hold\"] }}\n"
- alias: User pick
  condition: !input additional_conditions
actions:
- alias: Make number helper to store last side
  action: mqtt.publish
  data:
    topic: '{{ config_topic_2 }}'
    retain: true
    payload: "{ \"name\": \"{{ num_name }}\",\n  \"avty_t\": \"homeassistant/status\",\n
      \ \"uniq_id\": \"{{ friendly_name + '-' + device_id }}\",\n  \"cmd_t\": \"{{
      topic_2 }}\",\n  \"sta_t\": \"{{ topic_2 }}\",\n  \"min\": \"0\",\n  \"max\":
      \"6\",\n  \"step\": \"1\",\n  \"mode\": \"box\",\n  \"ret\": true,\n  \"dev\":
      {\n    \"name\": \"{{ friendly_name }}\",\n    \"mdl\": \"{{ mdl }}\",\n    \"mf\":
      \"{{ mf }}\",\n    \"sa\": \"{{ sa }}\",\n    \"sw\": \"{{ sw }}\",\n    \"hw\":
      \"{{ hw }}\",\n    \"cu\": \"{{ cu }}\",\n    \"ids\": [\n      \"{{ ieee_id
      + '-' + num_name }}\"\n    ]\n  }\n}\n"
- alias: Fire Last Action event. This is for optional troubleshooting data.
  event: cube_last_action
  event_data:
    action: '{{ action }}'
    side: '{{ side }}'
    last_side: '{{ last_side }}'
    friendly_name: '{{ friendly_name }}'
    device_id: '{{ device_id }}'
    ieee_id: '{{ ieee_id }}'
    angle: '{{ angle }}'
    mode: '{{ op_mode }}'
- alias: Store the current_side as the last_side for the next trigger
  action: number.set_value
  target:
    entity_id: '{{ num_ha_name }}'
  data:
    value: '{{ side }}'
- alias: Choose Action Mode or Scene Mode
  choose:
  - conditions: '{{ op_mode == "action_mode" }}'
    sequence:
    - alias: "\U0001FAF3 ACTION MODE \U0001FAF3 Group 2 \U0001F352 and No Group \U0001F355
        These are action events for ANY Side"
      choose:
      - conditions: '{{ action == "slide" }}'
        sequence: !input action_slide_any
      - conditions: '{{ action == "tap" }}'
        sequence: !input action_doubletap_any
      - conditions: '{{ action == "rotate_right" }}'
        sequence: !input action_rotate_cw_any
      - conditions: '{{ action == "rotate_left" }}'
        sequence: !input action_rotate_ccw_any
      - conditions: '{{ action == "shake" }}'
        sequence: !input action_shake
      - conditions: '{{ action == "throw" }}'
        sequence: !input action_throw
      - conditions: '{{ action == "flip90" }}'
        sequence:
        - parallel:
          - !input action_flipped90_any
          - alias: These are flip to specific side from any side events
            choose: &id001
            - conditions: '{{ side == 1 }}'
              sequence: !input action_flip_from_any_to_face_1
            - conditions: '{{ side == 2 }}'
              sequence: !input action_flip_from_any_to_face_2
            - conditions: '{{ side == 3 }}'
              sequence: !input action_flip_from_any_to_face_3
            - conditions: '{{ side == 4 }}'
              sequence: !input action_flip_from_any_to_face_4
            - conditions: '{{ side == 5 }}'
              sequence: !input action_flip_from_any_to_face_5
            - conditions: '{{ side == 6 }}'
              sequence: !input action_flip_from_any_to_face_6
      - conditions: '{{ action == "flip180" }}'
        sequence:
        - parallel:
          - !input action_flipped180_any
          - alias: These are flip to specific side from any side events
            choose: *id001
    - alias: "\U0001FAF3 ACTION MODE \U0001FAF3 Group 1 \U0001F34E These are action
        events based on the action broken down by side"
      choose:
      - conditions: '{{ action == "slide" }}'
        sequence:
        - alias: "\U0001FAF3 ACTION MODE \U0001FAF3  Group 1 \U0001F34E These are
            slide events"
          choose:
          - conditions: '{{ side == 1 }}'
            sequence: !input action_slide_face_1
          - conditions: '{{ side == 2 }}'
            sequence: !input action_slide_face_2
          - conditions: '{{ side == 3 }}'
            sequence: !input action_slide_face_3
          - conditions: '{{ side == 4 }}'
            sequence: !input action_slide_face_4
          - conditions: '{{ side == 5 }}'
            sequence: !input action_slide_face_5
          - conditions: '{{ side == 6 }}'
            sequence: !input action_slide_face_6
      - conditions: '{{ action == "tap" }}'
        sequence:
        - alias: "\U0001FAF3 ACTION MODE \U0001FAF3  Group 1 \U0001F34E These are
            doubletap events"
          choose:
          - conditions: '{{ side == 1 }}'
            sequence: !input action_doubletap_face_1
          - conditions: '{{ side == 2 }}'
            sequence: !input action_doubletap_face_2
          - conditions: '{{ side == 3 }}'
            sequence: !input action_doubletap_face_3
          - conditions: '{{ side == 4 }}'
            sequence: !input action_doubletap_face_4
          - conditions: '{{ side == 5 }}'
            sequence: !input action_doubletap_face_5
          - conditions: '{{ side == 6 }}'
            sequence: !input action_doubletap_face_6
      - conditions: '{{ action == "flip90" }}'
        sequence:
        - alias: "\U0001FAF3 ACTION MODE \U0001FAF3  Group 1 \U0001F34E These are
            flipped90 events"
          choose:
          - conditions: '{{ side == 1 }}'
            sequence: !input action_flipped90_face_1
          - conditions: '{{ side == 2 }}'
            sequence: !input action_flipped90_face_2
          - conditions: '{{ side == 3 }}'
            sequence: !input action_flipped90_face_3
          - conditions: '{{ side == 4 }}'
            sequence: !input action_flipped90_face_4
          - conditions: '{{ side == 5 }}'
            sequence: !input action_flipped90_face_5
          - conditions: '{{ side == 6 }}'
            sequence: !input action_flipped90_face_6
      - conditions: '{{ action == "flip180" }}'
        sequence:
        - alias: "\U0001FAF3 ACTION MODE \U0001FAF3  Group 1 \U0001F34E These are
            flipped180 events"
          choose:
          - conditions: '{{ side == 1 }}'
            sequence: !input action_flipped180_face_1
          - conditions: '{{ side == 2 }}'
            sequence: !input action_flipped180_face_2
          - conditions: '{{ side == 3 }}'
            sequence: !input action_flipped180_face_3
          - conditions: '{{ side == 4 }}'
            sequence: !input action_flipped180_face_4
          - conditions: '{{ side == 5 }}'
            sequence: !input action_flipped180_face_5
          - conditions: '{{ side == 6 }}'
            sequence: !input action_flipped180_face_6
      - conditions: '{{ action == "rotate_right" }}'
        sequence:
        - alias: "\U0001FAF3 ACTION MODE \U0001FAF3  Group 1 \U0001F34E These are
            rotate CW events"
          choose:
          - conditions: '{{ side == 1 }}'
            sequence: !input action_rotate_cw_face_1
          - conditions: '{{ side == 2 }}'
            sequence: !input action_rotate_cw_face_2
          - conditions: '{{ side == 3 }}'
            sequence: !input action_rotate_cw_face_3
          - conditions: '{{ side == 4 }}'
            sequence: !input action_rotate_cw_face_4
          - conditions: '{{ side == 5 }}'
            sequence: !input action_rotate_cw_face_5
          - conditions: '{{ side == 6 }}'
            sequence: !input action_rotate_cw_face_6
      - conditions: '{{ action == "rotate_left" }}'
        sequence:
        - alias: "\U0001FAF3 ACTION MODE \U0001FAF3  Group 1 \U0001F34E These are
            rotate CCW events"
          choose:
          - conditions: '{{ side == 1 }}'
            sequence: !input action_rotate_ccw_face_1
          - conditions: '{{ side == 2 }}'
            sequence: !input action_rotate_ccw_face_2
          - conditions: '{{ side == 3 }}'
            sequence: !input action_rotate_ccw_face_3
          - conditions: '{{ side == 4 }}'
            sequence: !input action_rotate_ccw_face_4
          - conditions: '{{ side == 5 }}'
            sequence: !input action_rotate_ccw_face_5
          - conditions: '{{ side == 6 }}'
            sequence: !input action_rotate_ccw_face_6
    - alias: "\U0001FAF3 ACTION MODE \U0001FAF3 Group 3 \U0001F350 Side to side jump
        events"
      choose:
      - conditions: '{{ side == 1 }}'
        sequence:
        - alias: "\U0001FAF3 ACTION MODE \U0001FAF3 Group 3 \U0001F350 To side 1 from
            any events"
          choose:
          - conditions: '{{ last_side == 2 }}'
            sequence: !input action_1_from_2
          - conditions: '{{ last_side == 3 }}'
            sequence: !input action_1_from_3
          - conditions: '{{ last_side == 4 }}'
            sequence: !input action_1_from_4
          - conditions: '{{ last_side == 5 }}'
            sequence: !input action_1_from_5
          - conditions: '{{ last_side == 6 }}'
            sequence: !input action_1_from_6
      - conditions: '{{ side == 2 }}'
        sequence:
        - alias: "\U0001FAF3 ACTION MODE \U0001FAF3 Group 3 \U0001F350 To side 2 from
            any events"
          choose:
          - conditions: '{{ last_side == 1 }}'
            sequence: !input action_2_from_1
          - conditions: '{{ last_side == 3 }}'
            sequence: !input action_2_from_3
          - conditions: '{{ last_side == 4 }}'
            sequence: !input action_2_from_4
          - conditions: '{{ last_side == 5 }}'
            sequence: !input action_2_from_5
          - conditions: '{{ last_side == 6 }}'
            sequence: !input action_2_from_6
      - conditions: '{{ side == 3 }}'
        sequence:
        - alias: "\U0001FAF3 ACTION MODE \U0001FAF3 Group 3 \U0001F350 To side 3 from
            any events"
          choose:
          - conditions: '{{ last_side == 1 }}'
            sequence: !input action_3_from_1
          - conditions: '{{ last_side == 2 }}'
            sequence: !input action_3_from_2
          - conditions: '{{ last_side == 4 }}'
            sequence: !input action_3_from_4
          - conditions: '{{ last_side == 5 }}'
            sequence: !input action_3_from_5
          - conditions: '{{ last_side == 6 }}'
            sequence: !input action_3_from_6
      - conditions: '{{ side == 4 }}'
        sequence:
        - alias: "\U0001FAF3 ACTION MODE \U0001FAF3 Group 3 \U0001F350 To side 4 from
            any events"
          choose:
          - conditions: '{{ last_side == 1 }}'
            sequence: !input action_4_from_1
          - conditions: '{{ last_side == 2 }}'
            sequence: !input action_4_from_2
          - conditions: '{{ last_side == 3 }}'
            sequence: !input action_4_from_3
          - conditions: '{{ last_side == 5 }}'
            sequence: !input action_4_from_5
          - conditions: '{{ last_side == 6 }}'
            sequence: !input action_4_from_6
      - conditions: '{{ side == 5 }}'
        sequence:
        - alias: "\U0001FAF3 ACTION MODE \U0001FAF3 Group 3 \U0001F350 To side 5 from
            any events"
          choose:
          - conditions: '{{ last_side == 1 }}'
            sequence: !input action_5_from_1
          - conditions: '{{ last_side == 2 }}'
            sequence: !input action_5_from_2
          - conditions: '{{ last_side == 3 }}'
            sequence: !input action_5_from_3
          - conditions: '{{ last_side == 4 }}'
            sequence: !input action_5_from_4
          - conditions: '{{ last_side == 6 }}'
            sequence: !input action_5_from_6
      - conditions: '{{ side == 6 }}'
        sequence:
        - alias: "\U0001FAF3 ACTION MODE \U0001FAF3 Group 3 \U0001F350 To side 6 from
            any events"
          choose:
          - conditions: '{{ last_side == 1 }}'
            sequence: !input action_6_from_1
          - conditions: '{{ last_side == 2 }}'
            sequence: !input action_6_from_2
          - conditions: '{{ last_side == 3 }}'
            sequence: !input action_6_from_3
          - conditions: '{{ last_side == 4 }}'
            sequence: !input action_6_from_4
          - conditions: '{{ last_side == 5 }}'
            sequence: !input action_6_from_5
  - conditions: '{{ op_mode == "scene_mode" }}'
    sequence:
    - alias: "\U0001F440 SCENE MODE \U0001F440 Group 2 \U0001F352 and No Group \U0001F355
        These are action events for ANY Side"
      choose:
      - conditions: '{{ action == "flip_to_side" }}'
        sequence: !input scene_flip_to_side_any
      - conditions: '{{ action == "rotate_right" }}'
        sequence: !input scene_rotate_cw_any
      - conditions: '{{ action == "rotate_left" }}'
        sequence: !input scene_rotate_ccw_any
      - conditions: '{{ action == "hold" }}'
        sequence: !input scene_hold
      - conditions: '{{ action == "shake" }}'
        sequence: !input scene_shake
      - conditions: '{{ action == "throw" }}'
        sequence: !input scene_throw
    - alias: "\U0001F440 SCENE MODE \U0001F440 Group 1 \U0001F34E These are action
        events based on the action broken down by side"
      choose:
      - conditions: '{{ action == "flip_to_side" }}'
        sequence:
        - alias: "\U0001F440 SCENE MODE \U0001F440 Group 1 \U0001F34E These are flip_to_side
            events"
          choose:
          - conditions: '{{ side == 1 }}'
            sequence: !input scene_flip_to_face_1
          - conditions: '{{ side == 2 }}'
            sequence: !input scene_flip_to_face_2
          - conditions: '{{ side == 3 }}'
            sequence: !input scene_flip_to_face_3
          - conditions: '{{ side == 4 }}'
            sequence: !input scene_flip_to_face_4
          - conditions: '{{ side == 5 }}'
            sequence: !input scene_flip_to_face_5
          - conditions: '{{ side == 6 }}'
            sequence: !input scene_flip_to_face_6
      - conditions: '{{ action == "rotate_right" }}'
        sequence:
        - alias: "\U0001F440 SCENE MODE \U0001F440 Group 1 \U0001F34E These are rotate
            CW events"
          choose:
          - conditions: '{{ side == 1 }}'
            sequence: !input scene_rotate_cw_face_1
          - conditions: '{{ side == 2 }}'
            sequence: !input scene_rotate_cw_face_2
          - conditions: '{{ side == 3 }}'
            sequence: !input scene_rotate_cw_face_3
          - conditions: '{{ side == 4 }}'
            sequence: !input scene_rotate_cw_face_4
          - conditions: '{{ side == 5 }}'
            sequence: !input scene_rotate_cw_face_5
          - conditions: '{{ side == 6 }}'
            sequence: !input scene_rotate_cw_face_6
      - conditions: '{{ action == "rotate_left" }}'
        sequence:
        - alias: "\U0001F440 SCENE MODE \U0001F440 Group 1 \U0001F34E These are rotate
            CCW events"
          choose:
          - conditions: '{{ side == 1 }}'
            sequence: !input scene_rotate_ccw_face_1
          - conditions: '{{ side == 2 }}'
            sequence: !input scene_rotate_ccw_face_2
          - conditions: '{{ side == 3 }}'
            sequence: !input scene_rotate_ccw_face_3
          - conditions: '{{ side == 4 }}'
            sequence: !input scene_rotate_ccw_face_4
          - conditions: '{{ side == 5 }}'
            sequence: !input scene_rotate_ccw_face_5
          - conditions: '{{ side == 6 }}'
            sequence: !input scene_rotate_ccw_face_6
    - alias: "\U0001F440 SCENE MODE \U0001F440 Group 3 \U0001F350 Side to side jump
        events"
      choose:
      - conditions: '{{ side == 1 }}'
        sequence:
        - alias: "\U0001F440 SCENE MODE \U0001F440 Group 3 \U0001F350 To side 1 from
            specific events"
          choose:
          - conditions: '{{ last_side == 2 }}'
            sequence: !input scene_1_from_2
          - conditions: '{{ last_side == 3 }}'
            sequence: !input scene_1_from_3
          - conditions: '{{ last_side == 4 }}'
            sequence: !input scene_1_from_4
          - conditions: '{{ last_side == 5 }}'
            sequence: !input scene_1_from_5
          - conditions: '{{ last_side == 6 }}'
            sequence: !input scene_1_from_6
      - conditions: '{{ side == 2 }}'
        sequence:
        - alias: "\U0001F440 SCENE MODE \U0001F440 Group 3 \U0001F350 To side 2 from
            specific events"
          choose:
          - conditions: '{{ last_side == 1 }}'
            sequence: !input scene_2_from_1
          - conditions: '{{ last_side == 3 }}'
            sequence: !input scene_2_from_3
          - conditions: '{{ last_side == 4 }}'
            sequence: !input scene_2_from_4
          - conditions: '{{ last_side == 5 }}'
            sequence: !input scene_2_from_5
          - conditions: '{{ last_side == 6 }}'
            sequence: !input scene_2_from_6
      - conditions: '{{ side == 3 }}'
        sequence:
        - alias: "\U0001F440 SCENE MODE \U0001F440 Group 3 \U0001F350 To side 3 from
            specific events"
          choose:
          - conditions: '{{ last_side == 1 }}'
            sequence: !input scene_3_from_1
          - conditions: '{{ last_side == 2 }}'
            sequence: !input scene_3_from_2
          - conditions: '{{ last_side == 4 }}'
            sequence: !input scene_3_from_4
          - conditions: '{{ last_side == 5 }}'
            sequence: !input scene_3_from_5
          - conditions: '{{ last_side == 6 }}'
            sequence: !input scene_3_from_6
      - conditions: '{{ side == 4 }}'
        sequence:
        - alias: "\U0001F440 SCENE MODE \U0001F440 Group 3 \U0001F350 To side 4 from
            specific events"
          choose:
          - conditions: '{{ last_side == 1 }}'
            sequence: !input scene_4_from_1
          - conditions: '{{ last_side == 2 }}'
            sequence: !input scene_4_from_2
          - conditions: '{{ last_side == 3 }}'
            sequence: !input scene_4_from_3
          - conditions: '{{ last_side == 5 }}'
            sequence: !input scene_4_from_5
          - conditions: '{{ last_side == 6 }}'
            sequence: !input scene_4_from_6
      - conditions: '{{ side == 5 }}'
        sequence:
        - alias: "\U0001F440 SCENE MODE \U0001F440 Group 3 \U0001F350 To side 5 from
            specific events"
          choose:
          - conditions: '{{ last_side == 1 }}'
            sequence: !input scene_5_from_1
          - conditions: '{{ last_side == 2 }}'
            sequence: !input scene_5_from_2
          - conditions: '{{ last_side == 3 }}'
            sequence: !input scene_5_from_3
          - conditions: '{{ last_side == 4 }}'
            sequence: !input scene_5_from_4
          - conditions: '{{ last_side == 6 }}'
            sequence: !input scene_5_from_6
      - conditions: '{{ side == 6 }}'
        sequence:
        - alias: "\U0001F440 SCENE MODE \U0001F440 Group 3 \U0001F350 To side 6 from
            specific events"
          choose:
          - conditions: '{{ last_side == 1 }}'
            sequence: !input scene_6_from_1
          - conditions: '{{ last_side == 2 }}'
            sequence: !input scene_6_from_2
          - conditions: '{{ last_side == 3 }}'
            sequence: !input scene_6_from_3
          - conditions: '{{ last_side == 4 }}'
            sequence: !input scene_6_from_4
          - conditions: '{{ last_side == 5 }}'
            sequence: !input scene_6_from_5
- alias: Delay ⏱ for debounce so toggle functions work. Also blueprint is in single
    mode.
  delay: 00:00:01
mode: single
max_exceeded: silent
