Custom vacuum-card for Home Assistant

I figured out the image thing, so that is all set. It took me a while, but I finally figured out why the litter level was not showing for my LitterBot. In my stats section, I only had attribute called out (because I was just modifying the default code) and entity_id in the cleaning section below.

I thought I might have to use both of the names, so I added entity_id in the default section. That made my level show properly. To show how the code was reacting, I wanted to get some screenshots of:

  • attribute only
  • entity_id only
  • attribute & entity_id

When I commented out entity_id, I lost the display. When I restored entity_id, the display came back. When I commented out attribute, the data stayed. So, it looks like only entity_id should be used to display.By themselves, I was not getting any display.

This is what my config code looks like:

type: custom:vacuum-card
entity: vacuum.halpoo_litter_box
image: /local/images/litter.png
stats:
  default:
    - entity_id: sensor.halpoo_waste_drawer
      unit: "%"
      subtitle: Poo Level
  show_toolbar: true
show_status: true
show_name: true
compact_view: false

Love the card! I was wondering if there is a way I could add a binary sensor up at the top left next to the fan and battery? My Deebot X1 Omni has mop pads and a binary sensor shows on or off when they are installed. Id like to be able to show different icons for its state. I added the sensor to the default stats section successfully but its in text and think a nice small icon up top would look better.

Side note the map the camera gives is really bad, anyone have any tricks for making it look better?

Hi,
Thank you for developing this custom card!

I have a Roomba 960, and the amount of attributes I’m getting from the Roomba integration is rather limited. So I’ve kept my card rather simple.

However, I do have one question: the “bin full” sensor is a binary sensor. It shows as “on” or “off”. However, it would make sense if I could change it to “yes/no”. Where can I do that?

type: custom:vacuum-card
entity: vacuum.roomba
compact_view: false
show_name: true
show_toolbar: true
show_status: true
stats:
  cleaning:
    - attribute: cleaning_time
      unit: minutes
      subtitle: Stofzuig tijd
    - attribute: cleaned_area
      unit: mÂČ
      subtitle: Oppervlakte
    - attribute: bin_full
      entity_id: binary_sensor.roomba_bin_full
      unit: null
      subtitle: Vuilbak vol?
  default:
    - attribute: bin_full
      entity_id: binary_sensor.roomba_bin_full
      unit: null
      subtitle: Vuilbak vol?

Shortcuts scripts dont launch, instead I get 'failed to call service script/clea
connection lost " the script work fine when I call them under scripts. card config below, thank you!

type: custom:vacuum-card
entity: vacuum.bob
actions:
start:
service: dreame_vacuum.vacuum_clean_segment
service_data:
entity_id: vacuum.bob
segments:

  • 9
  • 7
  • 11
  • 10
  • 4
  • 6
    stats:
    default:
  • attribute: filter_left
    unit: hours
    subtitle: Filter
  • attribute: side_brush_left
    unit: hours
    subtitle: Side brush
  • attribute: main_brush_left
    unit: hours
    subtitle: Main brush
  • attribute: sensor_dirty_left
    unit: hours
    subtitle: Sensors
    cleaning:
  • entity_id: sensor.bob_main_brush_left
    value_template: ‘{{ (value float(0) / 3600) round(1) }}’
    subtitle: Main brush
    unit: hours
  • attribute: cleaning_time
    unit: minutes
    subtitle: Cleaning time
    shortcuts:
  • name: Clean Living Room
    service: script.clean_living_room
    icon: mdi:sofa
  • name: Clean Master bedroom
    service: script.clean_master
    icon: mdi:bed-empty
  • name: Clean Kitchen
    service: script.clean_kitchen
    icon: mdi:silverware-fork-knife
  • name: Clean Bathroom
    service: script.clean_bathroom
    icon: mdi:bathtub
  • name: Auto Empty
    service: script.auto_empty
    icon: mdi:trash-can

To rise the chances to get help you should format the code you have pasted correctly:

sensor:
  - platform: template
    sensors:
      roomba_bin_full:
        friendly_name: "Roomba Dust Bin Status"
        value_template: >
          {% if is_state('binary_sensor.roomba_bin_full', 'on') %}
          Yes
          {% else %}
          No
          {% endif %}

In your configuration.yaml

made this roomba 960 icon if anyone wants it:

roomba960

How did you get the Deebot X1 Omni added to HA?

I just started noticing this behavior on last weeks update. Did you ever get fix?

I just got this card the other day, I’m experiencing the same thing. Completely vanishes in HA no matter what device I’m using!

Did you ever find the info on getting history stats for brush hours?

UPDATE:
So i noticed that on Oct 11th an issue/bug was opened that may be related:
Github issues

So I am beating my head against the screen trying to figure out why I cannot get shortcuts to show in the custom:vacuum-card configuration. What I am doing is having the vacuum card open as a popup using browser-mod when I click on an entity in a glance card. I have no problem getting the vacuum card to open and have even added a stats attribute to test. Unfortunately, I cannot get a shortcut to appear. I am trying to call a nodered trigger that would start a flow. I even tried just creating a basic script in HA to run so I could make sure my YAML configuration mirrored that on the github examples. I am not quite sure what I am doing wrong here, although I am sure I am doing something wrong!

Here is the glance card YAML
 the second vacuum card call (the one for roomba) is the one I am having issues with:

            type: glance
            entities:
              - entity: sensor.hal_waste_drawer
                name: Hal
                tap_action:
                  action: fire-dom-event
                  browser_mod:
                    service: browser_mod.popup
                    data:
                      title: Hal Litter Robot
                      content:
                        type: custom:vacuum-card
                        entity: vacuum.hal_litter_box
              - entity: vacuum.roomba
                name: Roomba
                tap_action:
                  action: fire-dom-event
                  browser_mod:
                    service: browser_mod.popup
                    data:
                      title: Roomba
                      content:
                        type: custom:vacuum-card
                        entity: vacuum.roomba
                        stats:
                          default:
                            - attribute: battery_level
                              unit: '%'
                              subtitle: Battery Level
                        shortcuts:
                          - name: Clean Living Room
                            service: nodered.trigger
                            service_data:
                              entity_id: button.roomba_node_red_room_trigger
                              payload:
                                room: living_room
                            icon: mdi:sofa

Any help would be appreciated!

@thetastate – I cobbled this together. I created input_datetime entities to mark when the part was last replaced or serviced.

sensor:
  - platform: history_stats
    name: Shark Vacuum left brush running time
    entity_id: vacuum.shark
    state:
      - cleaning
      - returning
    type: time
    start: "{% set value = states('input_datetime.shark_vacuum_left_brush_running_time') %}{{ value if value != 'unknown' else as_datetime(0) | default(as_datetime(0))}}"
    end: "{{ now() }}"
  
  - platform: history_stats
    name: Shark Vacuum right brush running time
    entity_id: vacuum.shark
    state:
      - cleaning
      - returning
    type: time
    start: "{% set value = states('input_datetime.shark_vacuum_right_brush_running_time') %}{{ value if value != 'unknown' else as_datetime(0) | default(as_datetime(0))}}"
    end: "{{ now() }}"
  
  - platform: history_stats
    name: Shark Vacuum filter running time
    entity_id: vacuum.shark
    state:
      - cleaning
      - returning
    type: time
    start: "{% set value = states('input_datetime.shark_vacuum_filter_running_time') %}{{ value if value != 'unknown' else as_datetime(0) | default(as_datetime(0))}}"
    end: "{{ now() }}"
  
  - platform: history_stats
    name: Shark Vacuum roller running time
    entity_id: vacuum.shark
    state:
      - cleaning
      - returning
    type: time
    start: "{% set value = states('input_datetime.shark_vacuum_roller_running_time') %}{{ value if value != 'unknown' else as_datetime(0) | default(as_datetime(0))}}"
    end: "{{ now() }}"
1 Like

Hey, thanks for adding this card. I add it with my old neato and I see the map and can start the clean and localization (?). But how can I add the actions: Spot cealning and return to base? The actions are showed, when I click at the battery but how can add them into the bottom bar?

Hey. Took some time to figure it out (noob here), but here is the code for a transparent background and smaller font size for the vacuum card.

type: custom:mod-card
card_mod:
  style: |
	ha-card {
	  font-size: 12px !important;
	  --ha-card-background: transparent !important;
	}
card:
  type: custom:vacuum-card
  entity: vacuum.vacuum_mop_pro
  image: default
  compact_view: false
  show_status: true
  show_name: true
  show_toolbar: true

2 Likes

I’m trying to remove the fan speed selector at the top left of my dashboard. I have it configured so that all speeds are at the middle section at the bottom and now I don’t need the controls in the vacuum card itself. I can’t find any “hide” controls on the Github page.

PS: I included the Roborock S7 image that I designed myself for my setup in case anyone wants it. Popular device héhé.

1 Like

Can i get rid of the ‘.header’ element? I don’t need that bar. But card-mod doesn’t work in this case, it seems.

thanks!

For anyone struggling with getting a custom robot image like the one above working by first uploading it to their Home Assistant Media library, I couldn’t find a way to get the image: link working due to permission errors.

What did work though was converting the image to a data URI with an online converter like this and pasting that as such: image: data:image/png;base64,iVBORw0KGg....

Only downside is that editing the card is a bit sluggish due to the large amount of embedded data.

For some reason I am really struggling to get this awesome looking card to match the rest of my IOS theme. I’ve been playing with Card_Mod but no matter what I do I can’t seem to match the opacity of the other cards.

In theory, after looking at the theme files, the following code should do it, but it’s still much darker / less opaque than everything else. Any ideas?

type: custom:vacuum-card
card_mod:
  style: |
    ha-card {
      --ha-card-background: var(--ha-card-background);
    }
entity: vacuum.roborock_q_revo
actions:
  start:
    service: vacuum.roborock_q_revo.start
    service_data:
      entity_id: vacuum.roborock_q_revo

Is it possible to download what is photographed in the picture?
Screenshot 2024-04-23 144115

How do I change the picture? can you explain please