Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vacuum:
- variables:
- entity: vacuum.default
- name: Default name
- styles:
- card:
- - border-radius: 20px
- - box-shadow: var(--box-shadow)
- - padding: 12px
- grid:
- - grid-template-areas: '"item1" "item2"'
- - grid-template-columns: 1fr
- - grid-template-rows: min-content min-content
- - row-gap: 12px
- custom_fields:
- item1:
- card:
- template: list_items_only_one
- type: custom:button-card
- custom_fields:
- item1:
- card:
- entity: '[[[ return variables.entity ]]]'
- name: '[[[ return variables.name ]]]'
- tap_action:
- action: more-info
- template:
- - icon_info
- # - vacuum_info
- type: custom:button-card
- item2:
- card:
- template: list_items
- type: custom:button-card
- custom_fields:
- item1:
- card:
- icon: mdi:pause
- tap_action:
- action: call-service
- service: script.turn_on
- service_data:
- entity_id: script.aspiro_stop
- type: custom:button-card
- template: widget_icon
- item2:
- card:
- icon: mdi:battery-charging
- tap_action:
- action: call-service
- service: script.turn_on
- service_data:
- entity_id: script.aspiro_charge
- type: custom:button-card
- template: widget_icon
- item3:
- card:
- icon: mdi:map-marker-path
- tap_action:
- action: call-service
- service: persistent_notification.create
- service_data:
- message: 2nd line - 3rd button
- title: Debug Vacuum Card
- notification_id: '{{ (range(1, 9999)|random) }}'
- type: custom:button-card
- template: widget_icon
- list_items_only_one:
- styles:
- card:
- - box-shadow: none
- - padding: 0px
- grid:
- - grid-template-areas: '"item1"'
- - grid-template-columns: 1fr
- - grid-template-rows: min-content
- - column-gap: 7px
- vacuum_info:
- tap_action:
- action: none
- icon: mdi:robot-vacuum
- label: |-
- [[[
- if (entity.state == 'docked' && entity.attributes.battery_level == '100'){
- return 'on its base';
- }
- else if (entity.attributes.status.toUpperCase() == 'charging'){
- return 'in charge';
- }
- else if (entity.state.toUpperCase() == 'cleaning'){
- return 'cleaning in progress';
- }
- else if (entity.state == 'docked' && 'retuning home'){
- return 'back to its base';
- }
- else if (entity.attributes.status.toUpperCase() == 'pause'){
- return 'on break';
- }
- else{
- return '❓ unknown ❓' ;
- }
- ]]]
- styles:
- icon:
- - color: |-
- [[[
- if (entity.state == 'docked' && entity.attributes.battery_level == '100'){
- return 'rgba(var(--couleur-gris),1)';
- }
- else if (entity.attributes.status.toUpperCase() == 'charging'){
- return 'rgba(var(--couleur-vert),1)';
- }
- else if (entity.state.toUpperCase() == 'cleaning'){
- return 'rgba(var(--couleur-jaune),1)';
- }
- else if (entity.attributes.status.toUpperCase() == 'retuning home'){
- return 'rgba(var(--couleur-violet),1)';
- }
- else if (entity.attributes.status.toUpperCase() == 'pause'){
- return 'rgba(var(--couleur-bleu),1)';
- }
- else{
- return 'rgba(var(--couleur-gris),1)';
- }
- ]]]
- img_cell:
- - background-color: |-
- [[[
- if (entity.state == 'docked' && entity.attributes.battery_level == '100'){
- return 'rgba(var(--couleur-gris),0.2)';
- }
- else if (entity.attributes.status.toUpperCase() == 'charging'){
- return 'rgba(var(--couleur-vert),0.2)';
- }
- else if (entity.state.toUpperCase() == 'cleaning'){
- return 'rgba(var(--couleur-jaune),0.2)';
- }
- else if (entity.attributes.status.toUpperCase() == 'retuning home'){
- return 'rgba(var(--couleur-violet),0.2)';
- }
- else if (entity.attributes.status.toUpperCase() == 'pause'){
- return 'rgba(var(--couleur-bleu),0.2)';
- }
- else{
- return 'rgba(var(--couleur-gris),0.2)';
- }
- ]]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement