Skip to content

Instantly share code, notes, and snippets.

@VirtualL
Last active August 3, 2018 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VirtualL/61e4df39dfac7203757c514a8f8328ad to your computer and use it in GitHub Desktop.
Save VirtualL/61e4df39dfac7203757c514a8f8328ad to your computer and use it in GitHub Desktop.
- type: picture-elements
image: /local/MyEntities/vacuum_card.jpg
elements:
- type: icon
icon: mdi:camera-metering-spot
tap_action: call-service
entity: vacuum.xiaomi_vacuum
service: vacuum.clean_spot
style:
top: 80%
left: 80%
"--paper-item-icon-color": rgb(115, 122, 130)
- type: icon
title: שואב אבק
tap_action: more-info
icon: mdi:robot-vacuum
style:
top: 10%
left: 50%
"--paper-item-icon-color": rgb(115, 122, 130)
- type: icon
title: חזור לעמדת הטענה
tap_action: call-service
icon: mdi:home
entity: vacuum.xiaomi_vacuum
service: vacuum.return_to_base
style:
top: 80%
left: 60%
"--paper-item-icon-color": rgb(115, 122, 130)
- type: icon
title: התחל או השהה פעילות
icon: mdi:play-pause
tap_action: call-service
entity: vacuum.xiaomi_vacuum
service: vacuum.start_pause
style:
top: 80%
left: 40%
"--paper-item-icon-color": rgb(115, 122, 130)
- type: icon
title: עצור שאיבה
icon: mdi:stop
tap_action: call-service
entity: vacuum.xiaomi_vacuum
service: vacuum.stop
style:
top: 80%
left: 20%
"--paper-item-icon-color": rgb(115, 122, 130)
- type: state-label
entity: sensor.vacuum_status
style:
top: 10%
right: 5%
color: rgb(255, 255, 255)
transform: translate(0%,-50%)
pointer-events: none
text-shadow: 1px 1px black
font-family: Trebuchet MS
font-size: 90%
font-weight: bold
border-left-style: solid
border-color: rgb(34, 154, 210)
background-color: rgb(54, 65, 78)
opacity: 0.8
- type: state-label
entity: sensor.vacuum_battery
style:
top: 10%
left: 5%
color: rgb(255, 255, 255)
transform: translate(0%,-50%)
pointer-events: none
text-shadow: 1px 1px black
font-family: Trebuchet MS
font-size: 90%
font-weight: bold
border-right-style: solid
border-color: rgb(34, 154, 210)
background-color: rgb(54, 65, 78)
opacity: 0.8
#in Sensors###################################### https://sharethelove.io/xiaomi-vacuum-card #######################################
- platform: template
sensors:
vacuum_status:
friendly_name: "Vacuum - Status"
# value_template: "{{ states.vacuum.xiaomi_vacuum.attributes.status }}:מצב"
value_template: >-
{%if states.vacuum.xiaomi_vacuum.attributes.status == 'Charging' %}מצב:בטעינה
{% elif states.vacuum.xiaomi_vacuum.attributes.status == 'Cleaning' %}מצב:מנקה
{% elif states.vacuum.xiaomi_vacuum.attributes.status == 'Spot cleaning' %}מצב:מנקה נקודתי
{% elif states.vacuum.xiaomi_vacuum.attributes.status == 'Returning home' %}מצב:בחזרה לבסיס
{% elif states.vacuum.xiaomi_vacuum.attributes.status == 'Idle' %}מצב:לא פעיל
{%- else -%}
{{states.vacuum.xiaomi_vacuum.attributes.status}}:מצב
{% endif %}
- platform: template
sensors:
vacuum_battery:
friendly_name: "Vacuum - Battery"
value_template: "{{ states.vacuum.xiaomi_vacuum.attributes.battery_level }}%:סוללה"
device_class: battery
# unit_of_measurement: '%'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment