Passend zu Simons Thema will ich hier meine backup card teilen.
Es werden die mushroom cards benötigt, hier benutze ich die template card.
Sie zeigt alles wichtige an, bei einem Klick auf die Karte wird ein manuelles Backup gestartet. Bei “hold” wird das addon neu gestartet.
Je nach Zustand ändert sich das icon und die Farbe. Samba Backup stell iwan immer auf idel um, somit ist ein Fehler leider nur durch die stats ersichtlich, da die icon iwan auf idle umstellen.
type: custom:mushroom-template-card
primary: >-
Last backup: {{ state_attr('sensor.samba_backup', 'last_backup') |
as_timestamp | timestamp_custom('%d.%m.%Y - %H:%M') }}
secondary: >-
NAS: {{state_attr('sensor.samba_backup','backups_remote')}} | Local: {{
state_attr('sensor.samba_backup','backups_local') }} | Check:
{{state_attr('sensor.samba_backup','total_backups_succeeded')}} | Failed:
{{state_attr('sensor.samba_backup','total_backups_failed')}}
icon: |-
{% if is_state('sensor.samba_backup', 'RUNNING') %}
mdi:progress-check
{% elif is_state('sensor.samba_backup', 'FAILED') %}
mdi:alert-circle-outline
{% elif is_state('sensor.samba_backup', 'SUCCESSFUL') %}
mdi:check-circle-outline
{% else %}
mdi:sleep
{% endif %}
icon_color: |-
{% if is_state('sensor.samba_backup', 'FAILED') %}
red
{% elif is_state('sensor.samba_backup', 'SUCCESSFUL') %}
green
{% elif is_state('sensor.samba_backup', 'RUNNING') %}
orange
{% else %}
blue
{% endif %}
multiline_secondary: false
fill_container: false
tap_action:
action: call-service
service: hassio.addon_stdin
data:
addon: 15d21743_samba_backup
input: trigger
hold_action:
action: call-service
service: hassio.addon_restart
data:
addon: 15d21743_samba_backup
target: {}
entity: sensor.samba_backup