From 0b1d88c9ca184bda2e3790f426bce3a217649f8a Mon Sep 17 00:00:00 2001 From: jumping2000 Date: Thu, 24 Aug 2023 19:38:02 +0200 Subject: [PATCH] added card_router --- .../card_elettrodomestici/card_router.yaml | 825 ++++++++++++++++++ 1 file changed, 825 insertions(+) create mode 100644 elettrodomestici_2023/lovelace/card_elettrodomestici/card_router.yaml diff --git a/elettrodomestici_2023/lovelace/card_elettrodomestici/card_router.yaml b/elettrodomestici_2023/lovelace/card_elettrodomestici/card_router.yaml new file mode 100644 index 0000000..15048ea --- /dev/null +++ b/elettrodomestici_2023/lovelace/card_elettrodomestici/card_router.yaml @@ -0,0 +1,825 @@ +type: custom:button-card +styles: + card: + - padding: 0 + - border: none + name: + - padding: 0 + - width: 100% + - font-weight: bold + grid: + - grid-template-areas: '"i" "n" "pictures" "buttons"' + - grid-template-columns: 1fr + - grid-template-rows: min-content min-content min-content + custom_fields: + pictures: + - background-color: transparent + buttons: + - background-color: transparent +custom_fields: + pictures: + card: + type: picture-elements + style: | + ha-card { + border-radius: 0px 0px 0px 0px; + } + image: /local/images/devices/sfondo_black.png + elements: + - type: image + entity: TAG_4 + image: /local/hassiohelp/pkg_elettrodomestici/fritzbox.png + state_filter: + 'off': brightness(96%) saturate(0.5) opacity(1.0) + 'on': null + style: + left: 25% + top: 18% + width: 44% + tap_action: + action: fire-dom-event + browser_mod: + service: browser_mod.popup + data: + style: |- + --popup-min-width: 950px; + --popup-max-width: 1050px; + --popup-border-radius: var(--ha-card-border-radius); + title: Dati Adguard + content: + type: custom:layout-card + layout_type: grid + layout: + grid-template-columns: 50% 50% + grid-template-rows: auto + margin: 0px 0px 0px 0px + grid-template-areas: | + "colonna1 colonna2" + mediaquery: + '(max-width: 600px)': + grid-template-columns: 100% + grid-template-areas: | + "colonna1" + "colonna2" + cards: + - type: vertical-stack + view_layout: + grid-area: colonna1 + cards: + - type: entities + show_header_toggle: false + state_color: true + entities: + - type: section + label: Statistiche AdGuard + - entity: sensor.adguard_dns_queries + type: custom:multiple-entity-row + show_state: false + name: DNS Queries + icon: mdi:shield-plus + entities: + - entity: sensor.adguard_dns_queries + name: Queries + - entity: sensor.adguard_dns_queries_blocked + name: Blocked + - entity: sensor.adguard_dns_queries_blocked_ratio + name: Ratio + - entity: sensor.adguard_safe_browsing_blocked + type: custom:multiple-entity-row + show_state: false + name: Safe Browsing + icon: mdi:safe-square + entities: + - entity: sensor.adguard_safe_browsing_blocked + name: Blocked + - entity: sensor.adguard_safe_searches_enforced + name: Enforced + - entity: sensor.adguard_parental_control_blocked + name: Parental + - entity: sensor.adguard_rules_count + - entity: sensor.adguard_average_processing_speed + - type: divider + - type: button + icon: mdi:restore-alert + name: Refresh Adguard + action_name: Refresh + tap_action: + action: call-service + service: adguard.refresh + - type: vertical-stack + view_layout: + grid-area: colonna2 + cards: + - type: entities + show_header_toggle: false + state_color: true + entities: + - type: section + label: DNS Filter + - entity: switch.adguard_protection + - entity: switch.adguard_filtering + - entity: switch.adguard_parental_control + - type: divider + - entity: switch.adguard_query_log + - entity: switch.adguard_safe_browsing + - entity: switch.adguard_safe_search + - type: image + entity: TAG_4 + image: /local/hassiohelp/pkg_elettrodomestici/fritzbox_led1.png + state_filter: + 'off': brightness(100%) saturate(0.9) + 'on': opacity(0) + style: + left: 28.5% + pointer-events: none + top: 21% + width: 1.5% + - type: image + entity: TAG_8 + image: /local/hassiohelp/pkg_elettrodomestici/fritzbox_led2.png + state_filter: + 'off': brightness(100%) saturate(0.9) + 'on': opacity(0) + style: + left: 31.5% + pointer-events: none + top: 21% + width: 1.5% + - type: state-label + entity: TAG_5 + prefix: '? Portante: ' + style: + top: '-4%' + left: 42% + pointer-events: none + transform: initial + font-size: 12px + line-height: 32px + padding: 4px 35px + - type: state-label + entity: TAG_4 + prefix: '?? IP: ' + style: + top: 6% + left: 42% + pointer-events: none + transform: initial + font-size: 12px + line-height: 32px + padding: 4px 35px + - type: state-label + entity: TAG_2 + prefix: '?? IP: ' + style: + top: 16% + left: 42% + pointer-events: none + transform: initial + font-size: 12px + line-height: 32px + padding: 4px 35px + - type: state-label + entity: sensor.fritz_download_throughput + prefix: '? ' + style: + top: 26% + left: 42% + pointer-events: none + transform: initial + font-size: 12px + line-height: 32px + padding: 4px 35px + - type: state-label + entity: sensor.fritz_upload_throughput + prefix: '? ' + style: + top: 26% + left: 68% + pointer-events: none + transform: initial + font-size: 12px + line-height: 32px + padding: 4px 35px + - type: state-label + entity: TAG_3 + prefix: '? ' + style: + top: 34% + left: '-4%' + pointer-events: none + transform: initial + font-size: 12px + line-height: 24px + padding: 0px 14px + - type: custom:bar-card + style: + '--card-background-color': transparent + '--ha-card-border-radius': 5px + '--ha-card-box-shadow': none + top: 72% + left: 5% + width: 60px + height: 120px + stack: horizontal + direction: up + positions: + name: 'off' + value: 'off' + indicator: 'off' + minmax: 'off' + icon: 'off' + name: Ping + columns: 1 + entities: + - entity: TAG_3 + max: 70 + severity: + - color: '#27b376' + from: 0 + to: 19 + - color: '#f9a73e' + from: 20 + to: 39 + - color: '#bf212f' + from: 40 + to: 70 + - type: state-label + entity: TAG_1 + prefix: ? + style: + top: 34% + left: 10% + pointer-events: none + transform: initial + font-size: 12px + line-height: 24px + padding: 0px 14px + - type: custom:bar-card + style: + '--card-background-color': transparent + '--ha-card-border-radius': 5px + '--ha-card-box-shadow': none + top: 72% + left: 20% + width: 60px + height: 120px + stack: horizontal + direction: up + positions: + name: 'off' + value: 'off' + indicator: 'off' + minmax: 'off' + icon: 'off' + name: Ping + columns: 1 + entities: + - entity: TAG_1 + max: 70 + severity: + - color: '#27b376' + from: 50 + to: 69 + - color: '#f9a73e' + from: 20 + to: 49.9 + - color: '#bf212f' + from: 0 + to: 19.9 + - type: state-label + entity: TAG_0 + prefix: ? + style: + top: 34% + left: 28% + pointer-events: none + transform: initial + font-size: 12px + line-height: 24px + padding: 0px 14px + - type: custom:bar-card + style: + '--card-background-color': transparent + '--ha-card-border-radius': 5px + '--ha-card-box-shadow': none + top: 72% + left: 35% + width: 60px + height: 120px + stack: horizontal + direction: up + positions: + name: 'off' + value: 'off' + indicator: 'off' + minmax: 'off' + icon: 'off' + name: Ping + columns: 1 + entities: + - entity: TAG_0 + max: 70 + severity: + - color: '#27b376' + from: 15 + to: 29 + - color: '#f9a73e' + from: 9 + to: 14.9 + - color: '#bf212f' + from: 0 + to: 8.9 + - type: custom:apexcharts-card + style: + '--card-background-color': rgba(0, 0, 0, 0.0) + '--ha-card-border-width': 0px + top: 75% + left: 70% + width: 54% + font-size: 10px + experimental: + color_threshold: true + apex_config: + chart: + height: 120px + tooltip: + enabled: true + title: + style: + fontSize: 10px + fontFamily: Segoe UI Light + yaxis: + forceNiceScale: true + labels: + style: + fontSize: 10px + fontFamily: Segoe UI Light + xaxis: + axisBorder: + show: true + labels: + show: false + style: + fontSize: 10px + fontFamily: Segoe UI Light + legend: + show: false + grid: + show: true + borderColor: rgba(112, 135, 164, 0.5) + graph_span: 6h + span: + start: minute + offset: '-6h' + show: + last_updated: false + header: + standard_format: false + show: false + show_states: true + colorize_states: true + title: '' + all_series_config: + type: column + stroke_width: 2 + group_by: + func: last + fill: last + duration: 5m + show: + header_color_threshold: true + extremas: true + name_in_header: false + legend_value: false + opacity: 0.8 + series: + - entity: sensor.fritz_download_throughput + - entity: sensor.fritz_upload_throughput + invert: true + buttons: + card: + type: custom:mod-card + card_mod: + style: | + :host { + --grid-card-gap: 0px; + } + card: + type: grid + columns: 5 + square: false + cards: + - type: custom:button-card + name: Info + icon: mdi:information + show_state: false + show_label: false + styles: + card: + - background-color: var('--background-color') + - padding: 1% + - margin-bottom: 0 + - margin-top: 0 + - border-width: 1px + - border-radius: 0px 0px 0px 20px + - height: 60px + - border-color: '#4a4a4a' + - font-size: 0.85em + icon: + - justify-self: center + grid: + - grid-template-areas: '"i" "n" "s"' + - grid-template-columns: 1fr + - grid-template-rows: 50% auto auto + tap_action: + action: fire-dom-event + browser_mod: + service: browser_mod.popup + data: + style: |- + --popup-min-width: 950px; + --popup-max-width: 1050px; + --popup-border-radius: var(--ha-card-border-radius); + title: Dati Router + content: + type: custom:layout-card + layout_type: grid + layout: + grid-template-columns: 50% 50% + grid-template-rows: auto + margin: 0px 0px 0px 0px + grid-template-areas: | + "colonna1 colonna2" + mediaquery: + '(max-width: 600px)': + grid-template-columns: 100% + grid-template-areas: | + "colonna1" + "colonna2" + cards: + - type: vertical-stack + view_layout: + grid-area: colonna1 + cards: + - type: entities + show_header_toggle: false + state_color: true + entities: + - type: section + label: Statistiche Router + - entity: TAG_14 + type: custom:multiple-entity-row + show_state: false + name: Download + icon: mdi:download + entities: + - entity: >- + TAG_14 + name: Link + - entity: >- + TAG_16 + name: Rumore + - entity: >- + TAG_18 + name: Att + - entity: TAG_13 + type: custom:multiple-entity-row + show_state: false + name: Upload + icon: mdi:upload + entities: + - entity: >- + TAG_13 + name: Link + - entity: >- + TAG_15 + name: Rumore + - entity: >- + TAG_17 + name: Att + - entity: TAG_20 + type: custom:multiple-entity-row + show_state: false + name: GB inviati / ricevuti + entities: + - entity: TAG_19 + name: GB inviati + - entity: TAG_20 + name: GB ricevuti + - type: divider + - entity: TAG_21 + name: Pulisci entit� HA + - entity: TAG_22 + name: Update firmware + - entity: TAG_23 + name: Reboot router + - entity: TAG_24 + name: Riconetti linea + - type: button + icon: mdi:restore-alert + name: Reload Speedtest integration + action_name: Reload + tap_action: + action: call-service + service: script.reload_speedtest_integration + - type: vertical-stack + view_layout: + grid-area: colonna2 + cards: + - type: entities + show_header_toggle: false + state_color: true + entities: + - type: section + label: Firmware & Uptime + - entity: update.fritz_box_7530_fritz_os + type: custom:multiple-entity-row + show_state: false + name: Firmware + entities: + - entity: update.fritz_box_7530_fritz_os + name: Aggiornamento + - entity: update.fritz_box_7530_fritz_os + attribute: installed_version + name: Installato + - entity: update.fritz_box_7530_fritz_os + attribute: latest_version + name: Disponibile + - entity: TAG_6 + name: Uptime connessione + - entity: TAG_7 + name: Uptime router + - type: divider + - entity: TAG_2 + name: IP WAN + - entity: sensor.vdsl_distance + name: Distanza da cabinet + - entity: TAG_4 + name: Stato connessione IP + - entity: TAG_5 + name: Stato connessione link + - type: custom:button-card + entity: TAG_8 + icon: mdi:wifi + name: WiFi 2.4 Ghz + show_icon: true + show_state: false + show_label: false + styles: + icon: + - color: | + [[[ + if (states['TAG_8'].state== 'on') + return "#27b376"; + return "#bf212f"; + ]]] + card: + - background-color: var('--background-color') + - padding: 1% + - margin-bottom: 0 + - margin-top: 0 + - border-width: 1px + - border-radius: 0px 0px 0px 0px + - height: 60px + - border-color: '#4a4a4a' + - font-size: 0.85em + grid: + - grid-template-areas: '"i" "n" "s"' + - grid-template-columns: 1fr + - grid-template-rows: 50% auto auto + - type: custom:button-card + entity: TAG_9 + icon: mdi:wifi-strength-4 + name: WiFi 5 Ghz + show_state: false + show_label: false + styles: + icon: + - color: | + [[[ + if (states['TAG_9'].state== 'on') + return "#27b376"; + return "#bf212f"; + ]]] + card: + - background-color: var('--background-color') + - padding: 1% + - margin-bottom: 0 + - margin-top: 0 + - border-width: 1px + - border-radius: 0px 0px 0px 0px + - height: 60px + - border-color: '#4a4a4a' + - font-size: 0.85em + grid: + - grid-template-areas: '"i" "n" "s"' + - grid-template-columns: 1fr + - grid-template-rows: 50% auto auto + - type: custom:button-card + entity: TAG_10 + icon: mdi:account-multiple-plus + name: WiFi Guest + show_state: false + show_label: false + styles: + icon: + - color: | + [[[ + if (states['TAG_10'].state== 'on') + return "#27b376"; + return "#bf212f"; + ]]] + card: + - background-color: var('--background-color') + - padding: 1% + - margin-bottom: 0 + - margin-top: 0 + - border-width: 1px + - border-radius: 0px 0px 0px 0px + - height: 60px + - border-color: '#4a4a4a' + - font-size: 0.85em + grid: + - grid-template-areas: '"i" "n" "s"' + - grid-template-columns: 1fr + - grid-template-rows: 50% auto auto + - type: custom:button-card + icon: mdi:router-network + name: Router + show_state: false + show_label: false + styles: + card: + - background-color: var('--background-color') + - padding: 1% + - margin-bottom: 0 + - margin-top: 0 + - border-width: 1px + - border-radius: 0px 0px 20px 0px + - height: 60px + - border-color: '#4a4a4a' + - font-size: 0.85em + icon: + - color: | + [[[ + if (states['TAG_4'].state== 'on') + return "#27b376"; + return "#bf212f"; + ]]] + - justify-self: center + grid: + - grid-template-areas: '"i" "n" "s"' + - grid-template-columns: 1fr + - grid-template-rows: 50% auto auto + tap_action: + action: fire-dom-event + browser_mod: + service: browser_mod.popup + data: + style: |- + --popup-min-width: 950px; + --popup-max-width: 1050px; + --popup-border-radius: var(--ha-card-border-radius); + title: Statistiche WAN + content: + type: vertical-stack + cards: + - type: custom:bar-card + style: | + ha-card { + border-radius: 0px; + box-shadow: none; + background-image: none; + background-color: transparent; + color: black + } + positions: + name: inside + value: inside + minmax: 'off' + icon: 'off' + height: 40px + columns: 4 + entities: + - entity: sensor.fritz_download_throughput + name: Download + max: 65 + severity: + - color: '#bf212f' + from: 0 + to: 29 + - color: '#f9a73e' + from: 30 + to: 49 + - color: '#006f3c' + from: 50 + to: 65 + - entity: sensor.fritz_upload_throughput + name: Upload + max: 25 + severity: + - color: '#bf212f' + from: 0 + to: 9 + - color: '#f9a73e' + from: 10 + to: 15 + - color: '#006f3c' + from: 16 + to: 25 + - entity: TAG_1 + name: Speed Download + max: 65 + severity: + - color: '#bf212f' + from: 0 + to: 29 + - color: '#f9a73e' + from: 30 + to: 49 + - color: '#006f3c' + from: 50 + to: 65 + - entity: TAG_0 + name: Speed Upload + max: 25 + severity: + - color: '#bf212f' + from: 0 + to: 9 + - color: '#f9a73e' + from: 10 + to: 15 + - color: '#006f3c' + from: 16 + to: 25 + - type: custom:apexcharts-card + experimental: + color_threshold: true + apex_config: + chart: + height: 280px + title: + style: + fontSize: 10px + fontFamily: Segoe UI Light + yaxis: + forceNiceScale: true + decimalsInFloat: 0 + labels: + style: + fontSize: 10px + fontFamily: Segoe UI Light + title: + text: Mbps + style: + fontSize: 12px + fontFamily: Segoe UI Light + fontWeight: 300 + xaxis: + axisBorder: + show: true + labels: + show: false + style: + fontSize: 10px + fontFamily: Segoe UI Light + grid: + show: true + borderColor: rgba(112, 135, 164, 0.5) + graph_span: 12h + show: + last_updated: false + header: + standard_format: false + show: true + show_states: true + colorize_states: true + title: Throghput Download / Upload + span: + start: minute + offset: '-12h' + all_series_config: + type: line + stroke_width: 2 + show: + header_color_threshold: true + extremas: true + name_in_header: false + legend_value: false + group_by: + func: last + fill: last + duration: 10s + opacity: 0.8 + series: + - entity: sensor.fritz_download_throughput + color: '#264b96' + - entity: sensor.fritz_upload_throughput + color: '#006f3c' + invert: true + - entity: TAG_1 + name: Speedtest Download + - entity: TAG_0 + name: Speedtest Upload + invert: true