Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom battery tile icon template #255

Closed
3 tasks done
kmlucy opened this issue Dec 10, 2021 · 3 comments
Closed
3 tasks done

Custom battery tile icon template #255

kmlucy opened this issue Dec 10, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@kmlucy
Copy link

kmlucy commented Dec 10, 2021

Checklist

  • I have updated the card to the latest version available
  • I have cleared the cache of my browser
  • I have checked if the problem is already reported

The problem

I am attempting to replace the auto-generated tiles. The status and fan tiles are easy, but I'm not able to keep the dynamic battery icon from the battery tile. I tried the tile block below, but that just results in a missing icon.

What version of a card has described problem?

v2.0.8

What was the last working version card?

No response

What vacuum model do you have problems with?

roborock.vacuum.a15

Which integration do you use to control your vacuum (link)?

https://www.home-assistant.io/integrations/xiaomi_miio/

What browser (browsers/apps) does have this problem?

Chrome, Android App

What version of Home Assistant do you use?

2021.11.5

What type of installation are you running?

Home Assistant Container

Card's configuration

- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: '{{ states.vacuum.roborock_s7.attributes.battery_icon }}'
  unit: "%"

Javascript errors shown in the browser's console (if applicable)

None

Additional information

No response

@kmlucy kmlucy added the bug Something isn't working label Dec 10, 2021
@PiotrMachowski
Copy link
Owner

Currently you can achieve it by adding multiple tiles with different icons and conditions that will make only one of them visible.

I will try to make icon temptable in the future versions

@PiotrMachowski PiotrMachowski added enhancement New feature or request and removed bug Something isn't working labels Dec 11, 2021
@kmlucy
Copy link
Author

kmlucy commented Dec 11, 2021

That's a good idea for now. For anyone else who is looking for this, here is what I came up with:

- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-unknown
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-unknown"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-outline
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-outline"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-alert
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-alert"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-charging-10
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-charging-10"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-charging-20
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-charging-20"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-charging-30
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-charging-30"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-charging-40
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-charging-40"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-charging-50
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-charging-50"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-charging-60
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-charging-60"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-charging-70
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-charging-70"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-charging-80
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-charging-80"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-charging-90
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-charging-90"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-charging-100
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-charging-100"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-10
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-10"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-20
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-20"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-30
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-30"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-40
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-40"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-50
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-50"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-60
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-60"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-70
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-70"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-80
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-80"
- entity: vacuum.roborock_s7
  label: Battery
  attribute: battery_level
  icon: mdi:battery-90
  unit: "%"
  tap_action: none
  conditions:
    - entity: vacuum.roborock_s7
      attribute: battery_icon
      value: "mdi:battery-90"

@PiotrMachowski
Copy link
Owner

Done in v2.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants