diff --git a/dashboards/views/01_home.yaml b/dashboards/views/01_home.yaml index 61d64bf..c87c7f3 100644 --- a/dashboards/views/01_home.yaml +++ b/dashboards/views/01_home.yaml @@ -155,14 +155,49 @@ cards: target: entity_id: button.roborock_s8_pro_ultra_vac_followed_by_mop - - type: button - name: Gå til dock - icon: mdi:home-import-outline + - type: custom:button-card + entity: vacuum.roborock_s8_pro_ultra + name: Start + icon: mdi:robot-vacuum tap_action: action: call-service - service: vacuum.return_to_base + service: vacuum.start target: entity_id: vacuum.roborock_s8_pro_ultra + state: + - value: cleaning + name: Dock + styles: + card: + - background-color: rgba(255, 200, 0, 0.25) + - border: 1px solid rgba(255, 200, 0, 0.8) + tap_action: + action: call-service + service: vacuum.return_to_base + target: + entity_id: vacuum.roborock_s8_pro_ultra + - value: returning + name: Dock + styles: + card: + - background-color: rgba(255, 200, 0, 0.25) + - border: 1px solid rgba(255, 200, 0, 0.8) + tap_action: + action: call-service + service: vacuum.return_to_base + target: + entity_id: vacuum.roborock_s8_pro_ultra + - value: paused + name: Dock + styles: + card: + - background-color: rgba(255, 200, 0, 0.25) + - border: 1px solid rgba(255, 200, 0, 0.8) + tap_action: + action: call-service + service: vacuum.return_to_base + target: + entity_id: vacuum.roborock_s8_pro_ultra # 🏎️ Plæneklipper - type: horizontal-stack @@ -171,8 +206,25 @@ cards: entity: input_datetime.ploeneklipper_sidst_koert show_icon: false show_name: true - show_state: true + show_state: false + show_label: true name: Sidst klippet + label: > + [[[ + const s = entity.state; + if (!s || s === 'unknown') return 'Ukendt'; + const d = new Date(s.replace(' ', 'T')); + if (isNaN(d)) return s; + const now = new Date(); + const isToday = d.toDateString() === now.toDateString(); + const yesterday = new Date(now); + yesterday.setDate(now.getDate() - 1); + const isYesterday = d.toDateString() === yesterday.toDateString(); + const t = d.toLocaleTimeString('da-DK', {hour: '2-digit', minute: '2-digit'}); + if (isToday) return 'I dag ' + t; + if (isYesterday) return 'I g\u00e5r ' + t; + return d.toLocaleDateString('da-DK', {day: 'numeric', month: 'short'}) + ' ' + t; + ]]] tap_action: action: none styles: @@ -182,14 +234,15 @@ cards: - font-size: 11px - color: var(--secondary-text-color) - padding-bottom: 4px - state: + label: - white-space: normal - word-break: break-word - line-height: 1.2 - font-size: 13px - text-align: center - - type: button + - type: custom:button-card + entity: lawn_mower.husqvarna_automower name: Klip icon: mdi:robot-mower tap_action: @@ -197,15 +250,18 @@ cards: service: lawn_mower.start_mowing target: entity_id: lawn_mower.husqvarna_automower - - - type: button - name: Stop - icon: mdi:home-import-outline - tap_action: - action: call-service - service: lawn_mower.dock - target: - entity_id: lawn_mower.husqvarna_automower + state: + - value: mowing + name: Stop + styles: + card: + - background-color: rgba(255, 200, 0, 0.25) + - border: 1px solid rgba(255, 200, 0, 0.8) + tap_action: + action: call-service + service: lawn_mower.dock + target: + entity_id: lawn_mower.husqvarna_automower # 💡 Lys kontrol - type: horizontal-stack