Perform own action for custom:mushroom-vacuum-card

Is there a chance to perform and show own action in custom:mushroom-vacuum-card?

i just see, but can I add own action here. I have a own action script.robock_clean which I want to execute instead of start_pause
commands list [] List of commands to display (start_pause, stop, locate, clean_spot, return_home)

I am fairly sure it’s possible, please share your current card code.

1 Like

Here:

        type: custom:mushroom-vacuum-card
        entity: vacuum.foo
        icon_animation: true
        commands:
          - start_pause
          - return_home
        tap_action:
          action: navigate
          navigation_path: /lovelace/r

Give me a day or so. I need to test mods on the Mushroom Vacuum Card or we may have to go with the Mushroom Template Card.

I give you all the time you need :heart:.
With card mod you can also manipulate actions or do you test general some mods?

One option is to use the vacuum template. It will pull the information you want from your integrated vacuum vacuum.foo, but allow you to specify the actions.

When the templated vacuum is used in the Mushroom Vacuum Card, the start_pause button will activate your script.

Something like this

vacuum:
  - platform: template
    vacuums:
      living_room_vacuum:
        friendly_name: "Template Vacuum"
        unique_id: vac_template
        value_template: "{{ states('vacuum.foo') }}"
        battery_level_template: "{{ states('sensor.vacuum.foo_battery')|int }}"
        fan_speed_template: "{{ state_attr('vacuum.vacuum.foo','fan_speed') }}"
        start:
            action: script.robock_clean
        return_to_base:
            action: script.return_home

It would require a second script for your return home command, but that is simply something like this.

If you want to have the main vacuum accessible in the Mushroom Card, you can use this format.

type: custom:vertical-stack-in-card
cards:
  - type: custom:mushroom-vacuum-card
    icon: mdi:robot-vacuum
    primary_info: name
    secondary_info: state
    icon_type: icon
    entity: vacuum.roborock_s6_maxv
  - type: custom:gap-card
    height: 10
  - type: custom:mushroom-vacuum-card
    commands:
      - return_home
      - start_pause
    primary_info: none
    secondary_info: none
    icon_type: none
    entity: vacuum.living_room_vacuum

Green highlighted area will interact with your integrated vac. Yellow highlighted buttons will activate your scripts.

1 Like

Ok I can test this next week. I have to check my complete code. As far as I remember I already use vacuum template together with mushroom card.

So in second solution you created a wrapper? Or what is the second living room vacuum? Not sure how the standard actions are overriden.

The solutions I proposed have been tested and work. Try them out and let me know.

The second vacuum is the template vacuum that simply calls your scripts and mimics your real vacuum . It’s an easy way to still use the Mushroom Vacuum Card without a lot of customization.

1 Like