Is there a better way to use a switch device that doesn't have entities?

Hi, I’m using a xiaomi push button that provides those actions in the device:

Those are 8 “actions” possible for the button.

I can create 8 seperate automations to do different stuff but I hate multiplying all those automations.

I wish I could trigger an “event” just when any one of those 8 are triggered, then I could derive an input select for example.

The below code doesn’t make sense but I’m so wanting to have devices from that entity. Might be a bit OCD on this :wink:

Any suggestions I haven’t thought of?

alias: Pushing this button
description: ''
mode: single
trigger:
  - device_id: 1257adde0d5011ebb75103825dfc9901
    domain: deconz
    platform: device
    
    type: ALL ACTIONS TRIGGER THIS

condition: []
action:
  - choose:
      - conditions:
          - condition: ONE PRESS HAS HAPPEND
        sequence:
          - service: input_select.select_option
            data:
              option: 1
            entity_id: input_select.lloyd_switch_bed
  - choose:
      - conditions:
          - condition: TWO PRESS HAS HAPPEND
        sequence:
          - service: input_select.select_option
            data:
              option: 2
            entity_id: input_select.lloyd_switch_bed
    default: []

You can use the events that the remotes issue when a button is pressed.

Take a look here and here.

You can also take a look at some blueprints for renotes as they use the same principle.

Thanks for pointing me to the the blueprints. This one is precisely what I was looking for!

1 Like