select preset
guensen0 opened this issue · comments
Description
Hi,
perfect work! I have 3 presets in my vacuum card and if I selected one of the additional presets and go to another view and back the card automatically jumps back to the 1st preset (keeping the map and specific floor dependent button cards). In principle everything works, just the fact that the selection if not synchronized... for example, to get back to 1st preview, you have to go to another preview and back... kind of cosmetic issue, but still raising questions in family ;-)
I have a variable that defines which floor is loaded, so I could jump easily to the current tab, if there would be a option (or may I have overseen something?)
Solution
option to select which preset should be shown...
Alternatives
No response
Context
No response
You can configure conditions
section for every preset, will this resolve your problem?
not really... as I understand that would allow to show the card page that is currently used, but how to go to another page then? Only option: 3 additional buttons that reset the variable, but the question is whether the card then reload?
Can you show your current config?
for the whole card?
Part related to switching presets should be enough
this is the main card:
cards:
- type: custom:xiaomi-vacuum-map-card
title: ''
preset_name: EG
entity: vacuum.roborock_s5_max
activate_on_switch: true
activate:
service: script.vac_test
service_data:
map: '0'
vacuum_platform: default
map_locked: true
...
the 2nd card:
additional_presets:
- preset_name: Obergeschoss (Vorn)
entity: vacuum.roborock_s5_max
activate_on_switch: true
activate:
service: script.vac_test
service_data:
map: '2'
map_source:
camera: camera.xiaomi_cloud_map_extractor
that's the script that is called:
alias: Vac_Test
fields:
map:
description: Which Map to select
example: 1
sequence:
- service: vacuum.send_command
data:
command: load_multi_map
params: "{{ map }}"
target:
device_id: xxxxxxx
- service: python_script.set_state
data:
entity_id: sensor.vac_map
state: "{{ map }}"
mode: single
Ok, at this moment my suggestion would be to add conditions to all 3 presets (including default one) and add 2 icons to every preset (to change a map to a different one).
Ok, at this moment my suggestion would be to add conditions to all 3 presets (including default one) and add 2 icons to every preset (to change a map to a different one).
but is the card updating automatically?
Yes, when you add conditions the preset will be chosen automatically
ok... then I will try that next days... thanks for your time.
Looks good 👍