of course
this is from Mattias_Persson.
Here a Popup yaml:
action: fire-dom-event
browser_mod:
command: popup
title: Staubsauger
style:
.: |
:host .content {
width: calc(385px + 300px + 300px);
max-width: 90vw;
}
layout-card$grid-layout:
$: |
hui-vertical-stack-card {
animation: border 1s forwards;
}
@keyframes border {
0%, 100% {
border-right: 1.5px solid rgba(0, 0, 0, 0.2);
}
}
/* phone */
@media screen and (max-width: 800px) {
hui-vertical-stack-card {
border-bottom: 1.5px solid rgba(0, 0, 0, 0.2);
padding-right: 0;
animation: none;
}
}
$hui-vertical-stack-card:
$: |
hui-horizontal-stack-card {
padding: 0em 2em 2.3em 2em;
}
$hui-entities-card$: |
.card-content {
padding: var(--card-content-padding);
}
$hui-horizontal-stack-card$: |
#root {
justify-content: space-evenly;
}
$hui-picture-elements-card$: |
#root {
animation: fadein 0.9s both;
}
@keyframes fadein {
0% {
opacity: 0;
}
75% {
opacity: 0;
}
100% {
opacity: 1;
}
}
card:
type: custom:layout-card
layout_type: custom:grid-layout
layout:
grid-template-columns: 385px repeat(2, 300px)
grid-template-rows: 1fr
grid-template-areas: |
"info map map"
mediaquery:
#phone
"(max-width: 800px)":
grid-template-columns: 1fr
grid-template-rows: repeat(2, 1fr)
grid-template-areas: |
"info"
"map"
cards:
#################################################
# #
# Einstellungen #
# #
#################################################
- type: vertical-stack
cards:
- type: entities
view_layout:
grid-area: info
title: Einstellungen
card_mod:
class: header
entities:
- entity: vacuum.roboter_staubsauger
- entity: sensor.roboter_staubsauger_last_clean_end
- type: custom:bar-card
width: 55%
height: 2em
decimal: 0
unit_of_measurement: '%'
positions:
icon: outside
indicator: 'off'
name: outside
severity:
- color: '#303435'
from: 11
to: 100
- color: '#6d2525'
from: 0
to: 10
entity_row: true
entities:
- entity: vacuum.roboter_staubsauger
attribute: battery_level
name: Batterie
icon: mdi:battery
- entity: sensor.template_vacuum_filter
- entity: sensor.template_vacuum_mainbrush
- entity: sensor.template_vacuum_sidebrush
- entity: sensor.template_vacuum_sensors
- entity: input_select.fan_speed
- type: horizontal-stack
cards:
- type: custom:button-card
entity: vacuum.roboter_staubsauger
icon: mdi:play-pause
tap_action:
action: call-service
service: >
[[[
return entity.state === 'docked' || entity.state === 'paused'
? 'vacuum.start'
: 'vacuum.pause';
]]]
service_data:
entity_id: >
[[[ return entity.entity_id; ]]]
template: icon_only
- type: custom:button-card
entity: vacuum.roboter_staubsauger
icon: mdi:battery-charging
tap_action:
action: call-service
service: vacuum.return_to_base
service_data:
entity_id: >
[[[ return entity.entity_id; ]]]
template: icon_only
- type: custom:button-card
icon: mdi:map-marker-question
tap_action:
action: call-service
service: vacuum.locate
service_data:
entity_id: vacuum.roboter_staubsauger
template: icon_only
#################################################
# #
# Karte #
# #
#################################################
- type: picture-elements
title: Karte
view_layout:
grid-area: map
image: /local/transparent_1to1.png
card_mod:
class: header
style: |
#root {
animation: fade 1s both;
}
.card-header {
margin: -0.05em 0 0 0.75em;
}
@keyframes fade {
0% {
opacity: 0;
}
50% {
opacity: 0;
}
100% {
opacity: 1;
}
}
elements:
- type: image
camera_image: camera.roborock_s50
style:
top: 40%
left: 50%
width: 40%
cursor: default
background-position: center
background-repeat: no-repeat
background-size: cover
transform: translate(-50%,-50%) scale(2.38,2.42)
- type: custom:button-card
name: Esszimmer
tap_action:
action: call-service
service: script.turn_on
service_data:
entity_id: script.esszimmer
show_label: false
show_icon: false
styles: &button-card-styles
card:
- padding: 3em
- background: none
name:
- font-size: 0.9em
- letter-spacing: 0.003em
- color: '#aeb0b0'
- background: '#191c1d80'
- padding: 0.48em 0.78em 0.48em 0.78em
- border-radius: 0.6em
- overflow: visible
style:
left: 74%
top: 25%
- type: custom:button-card
name: Spielzimmer
tap_action:
action: call-service
service: script.turn_on
service_data:
entity_id: script.kinderzimmer
show_label: false
show_icon: false
styles: *button-card-styles
style:
left: 48%
top: 60%
- type: custom:button-card
name: Wohnzimmer
tap_action:
action: call-service
service: script.turn_on
service_data:
entity_id: script.wohnzimmer
show_label: false
show_icon: false
styles: *button-card-styles
style:
left: 75%
top: 60%
- type: custom:button-card
name: KĂźche
tap_action:
action: call-service
service: script.turn_on
service_data:
entity_id: script.kueche
show_label: false
show_icon: false
styles: *button-card-styles
style:
left: 49%
top: 25%
- type: custom:button-card
name: Bad
tap_action:
action: call-service
service: script.turn_on
service_data:
entity_id: script.badezimmer
show_label: false
show_icon: false
styles: *button-card-styles
style:
left: 31%
top: 25%
- type: custom:button-card
name: Gästezimmer
tap_action:
action: call-service
service: script.turn_on
service_data:
entity_id: script.schlafzimmer
show_label: false
show_icon: false
styles: *button-card-styles
style:
left: 20%
top: 60%
- type: custom:button-card
name: Flur
tap_action:
action: call-service
service: script.turn_on
service_data:
entity_id: script.flur
show_label: false
show_icon: false
styles: *button-card-styles
style:
left: 43%
top: 41%
- type: custom:button-card
name: Eingang
tap_action:
action: call-service
service: script.turn_on
service_data:
entity_id: script.eingang
show_label: false
show_icon: false
styles: *button-card-styles
style:
left: 15%
top: 41%
Lovelace:
#################################################
# #
# SIDEBAR #
# #
#################################################
- type: vertical-stack
view_layout:
grid-area: sidebar
cards:
- type: custom:button-card
entity: sensor.template_sidebar
template: sidebar_template
- type: grid
cards:
- type: button
icon: custom:roborock-vacuum
tap_action:
!include popup/vacuum.yaml
hold_action:
action: none
script(rooms):
script:
'esszimmer':
alias: esszimmer
sequence:
- data: {}
entity_id: vacuum.roboter_staubsauger
service: vacuum.pause
- delay: 00:00:01
- data:
command: app_segment_clean
entity_id: vacuum.roboter_staubsauger
params:
- 17
entity_id: vacuum.roboter_staubsauger
service: vacuum.send_command
'wohnzimmer':
alias: wohnzimmer
sequence:
- data: {}
entity_id: vacuum.roboter_staubsauger
service: vacuum.pause
- delay: 00:00:01
- data:
command: app_segment_clean
entity_id: vacuum.roboter_staubsauger
params:
- 16
entity_id: vacuum.roboter_staubsauger
service: vacuum.send_command
'kueche':
alias: kueche
sequence:
- data: {}
entity_id: vacuum.roboter_staubsauger
service: vacuum.pause
- delay: 00:00:01
- data:
command: app_segment_clean
entity_id: vacuum.roboter_staubsauger
params:
- 20
entity_id: vacuum.roboter_staubsauger
service: vacuum.send_command
'kinderzimmer':
alias: kinderzimmer
sequence:
- data: {}
entity_id: vacuum.roboter_staubsauger
service: vacuum.pause
- delay: 00:00:01
- data:
command: app_segment_clean
entity_id: vacuum.roboter_staubsauger
params:
- 1
entity_id: vacuum.roboter_staubsauger
service: vacuum.send_command
'schlafzimmer':
alias: schlafzimmer
sequence:
- data: {}
entity_id: vacuum.roboter_staubsauger
service: vacuum.pause
- delay: 00:00:01
- data:
command: app_segment_clean
entity_id: vacuum.roboter_staubsauger
params:
- 22
entity_id: vacuum.roboter_staubsauger
service: vacuum.send_command
'badezimmer':
alias: badezimmer
sequence:
- data: {}
entity_id: vacuum.roboter_staubsauger
service: vacuum.pause
- delay: 00:00:01
- data:
command: app_segment_clean
entity_id: vacuum.roboter_staubsauger
params:
- 18
entity_id: vacuum.roboter_staubsauger
service: vacuum.send_command
'eingang':
alias: eingang
sequence:
- data: {}
entity_id: vacuum.roboter_staubsauger
service: vacuum.pause
- delay: 00:00:01
- data:
command: app_segment_clean
entity_id: vacuum.roboter_staubsauger
params:
- 2
entity_id: vacuum.roboter_staubsauger
service: vacuum.send_command
'flur':
alias: flur
sequence:
- data: {}
entity_id: vacuum.roboter_staubsauger
service: vacuum.pause
- delay: 00:00:01
- data:
command: app_segment_clean
entity_id: vacuum.roboter_staubsauger
params:
- 19
entity_id: vacuum.roboter_staubsauger
service: vacuum.send_command
config map:
camera:
- platform: xiaomi_cloud_map_extractor
host: !secret xiaomi_vacuum_host
token: !secret xiaomi_vacuum_token
username: !secret xiaomi_cloud_username
password: !secret xiaomi_cloud_password
country: de
name: "Roborock S50"
colors:
color_map_outside: [0, 0, 0, 0]
color_map_wall: [0, 0, 0, 0]
color_map_wall_v2: [34, 35, 36]
color_path: [84, 151, 240]
color_charger: [8, 120, 36]
color_robo: [255, 0, 0]
color_scan: [0, 0, 0, 0]
color_unknown: [0, 0, 0, 0]
color_obstacle: [0, 0, 0, 0]
color_grey_wall: [0, 0, 0, 0]
color_ignored_obstacle: [0, 0, 0, 0]
color_zones: [109, 37, 37]
color_zones_outline: [0, 0, 0, 0]
color_virtual_walls: [109, 37, 37]
color_no_go_zones: [109, 37, 37]
color_no_go_zones_outline: [0, 0, 0, 0]
color_no_mop_zones: [109, 37, 37]
color_no_mop_zones_outline: [0, 0, 0, 0]
room_colors:
1: [48, 52, 53]
2: [48, 52, 53]
16: [48, 52, 53]
17: [48, 52, 53]
18: [48, 52, 53]
19: [48, 52, 53]
20: [48, 52, 53]
22: [48, 52, 53]
draw:
- charger
- path
- goto_path
- predicted_path
- no_go_zones
- no_mopping_zones
- vacuum_position
- virtual_walls
- zones
map_transformation:
scale: 3
trim:
top: 10
bottom: 20
left: 20
right: 20
scan_interval:
seconds: 10
auto_update: true
Edit:
templates:
- unique_id: vacuum_filter
icon: custom:roborock-filter
unit_of_measurement: '%'
state: >
{{ (states('sensor.roboter_staubsauger_filter_left') | int(default=0) / 5400) | int(default=0) }}
attributes:
friendly_name: Filter
- unique_id: vacuum_mainbrush
icon: custom:roborock-mainbrush
unit_of_measurement: '%'
state: >
{{ (states('sensor.roboter_staubsauger_main_brush_left') | int(default=0) / 10800) | int(default=0) }}
attributes:
friendly_name: KopfbĂźrste
- unique_id: vacuum_sensors
icon: custom:roborock-sensor
unit_of_measurement: '%'
state: >
{{ (states('sensor.roboter_staubsauger_sensor_dirty_left') | int(default=0) / 1080) | int(default=0) }}
attributes:
friendly_name: Sensoren
- unique_id: vacuum_sidebrush
icon: custom:roborock-sidebrush
unit_of_measurement: '%'
state: >
{{ (states('sensor.roboter_staubsauger_side_brush_left') | int(default=0) / 7200) | int(default=0) }}
attributes:
friendly_name: SeitenbĂźrste