Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {# ----------------- PROVIDE YOUR OWN ENTITY IDS HERE ----------------- #}
- {% set camera_entity = "camera.xiaomi_cloud_map_extractor" %}
- {% set vacuum_entity = "vacuum.xiaomi_vacuum" %}
- {# ------------------- DO NOT CHANGE ANYTHING BELOW ------------------- #}
- {% set attributes = states[camera_entity].attributes %}
- type: custom:xiaomi-vacuum-map-card
- entity: {{ vacuum_entity }}
- map_source:
- camera: {{ camera_entity }}
- calibration_source:
- camera: true
- map_modes:
- - template: vacuum_goto
- - template: vacuum_clean_zone
- - template: vacuum_clean_segment
- predefined_selections:
- {%- for room_id in attributes.rooms %}
- {%- set room = attributes.rooms[room_id] %}
- - id: {{room_id}}
- icon:
- name: "mdi:broom"
- {%- if "." in (room["x0"] | string) %}
- x: {{ ([room["x0"], room["x1"]] | sum / 2) }}
- y: {{ ([room["y0"], room["y1"]] | sum / 2) }}
- {%- else %}
- x: {{ ([room["x0"], room["x1"]] | sum / 2) | int }}
- y: {{ ([room["y0"], room["y1"]] | sum / 2) | int }}
- {%- endif %}
- {%- endfor %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement