Hallo zusammen,
ich hänge hier grad in der Luft. Kann mir irgendwer sagen, warum der Code einmal funktioniert und die Karte mit allem drum und dran angezeigt wird, aber danach nicht wieder. Nach reload usw. erscheint nur der Header.
type: custom:auto-entities
card:
type: custom:flex-table-card
title: Proxmox – LXCs & VMs
auto_format: true
trigger_update: all
columns:
- name: ID
data: entity_id
modify: |
x.split('_').slice(-2, -1)[0]
- name: Name
data: name
modify: |
x
.replace(/^LXC\s+/i, "")
.replace(/^QEMU\s+/i, "")
.replace(/\s*\(.*?\)\s*Status$/i, "")
- name: Status
data: entity_id
modify: |
hass.states[x].state === "on" ? "in Betrieb" : "außer Betrieb"
style: |
hass.states[x].state === "on"
? "color: var(--success-color); font-weight:600;"
: "color: var(--error-color); font-weight:600;"
- name: start_btn
hidden: true
data: entity_id
modify: |
x.replace("binary_sensor.", "button.").replace("_status", "_starten")
- name: stop_btn
hidden: true
data: entity_id
modify: |
x.replace("binary_sensor.", "button.").replace("_status", "_stoppen")
- name: restart_btn
hidden: true
data: entity_id
modify: |
x.replace("binary_sensor.", "button.").replace("_status", "_neustart")
- name: shutdown_btn
hidden: true
data: entity_id
modify: >
x.replace("binary_sensor.", "button.").replace("_status",
"_herunterfahren")
- name: ▶
data: entity_id
modify: >
'<ha-icon icon="mdi:play-circle"
style="color:var(--success-color);"></ha-icon>'
tap_action:
action: perform-action
perform_action: button.press
target:
entity_id: col[3]
- name: ⏹
data: entity_id
modify: >
'<ha-icon icon="mdi:stop-circle"
style="color:var(--error-color);"></ha-icon>'
tap_action:
action: perform-action
perform_action: button.press
target:
entity_id: col[4]
- name: 🔄
data: entity_id
modify: >
'<ha-icon icon="mdi:restart"
style="color:var(--primary-color);"></ha-icon>'
tap_action:
action: perform-action
perform_action: button.press
target:
entity_id: col[5]
- name: ⏻
data: entity_id
modify: >
'<ha-icon icon="mdi:power"
style="color:var(--warning-color);"></ha-icon>'
tap_action:
action: perform-action
perform_action: button.press
target:
entity_id: col[6]
filter:
include:
- domain: binary_sensor
entity_id: binary_sensor.lxc_*_status
- domain: binary_sensor
entity_id: binary_sensor.qemu_*_status
sort:
method: entity_id
grid_options:
columns: full
Ich bin leider auch nicht so geübt in yaml & Co
Hoffe jemand hat da eine Idee
Danke
Marcus