diff --git a/config/README.md b/config/README.md index 7c9fbc1..71c9cfe 100644 --- a/config/README.md +++ b/config/README.md @@ -37,13 +37,13 @@ https://github.com/ngocjohn/hass-config/assets/96962827/acc1a4db-b92e-4ab1-ac9d- - 34,023 - 32 - 163 + 34,946 + 34 + 164 63 - 53 + 54 32 - 1083 + 1063 215 38 @@ -62,6 +62,7 @@ https://github.com/ngocjohn/hass-config/assets/96962827/acc1a4db-b92e-4ab1-ac9d- - Advanced SSH & Web Terminal - ArgonOne Active Linear Cooling - Cloudflared +- DbStats - eufy-security-ws - Glances - go2rtc @@ -138,7 +139,6 @@ https://github.com/ngocjohn/hass-config/assets/96962827/acc1a4db-b92e-4ab1-ac9d- - [Mushroom](https://github.com/piitaya/lovelace-mushroom) - [Polr Ytube Media Card](https://github.com/pathofleastresistor/polr-ytube-media-card) - [Purifier Card](https://github.com/denysdovhan/purifier-card) -- [Restriction Card](https://github.com/iantrich/restriction-card) - [Rpi Monitor Card](https://github.com/ironsheep/lovelace-rpi-monitor-card) - [Simple Thermostat](https://github.com/nervetattoo/simple-thermostat) - [Slider Button Card](https://github.com/custom-cards/slider-button-card) diff --git a/config/automations.yaml b/config/automations.yaml index a0978ee..8e17c7f 100644 --- a/config/automations.yaml +++ b/config/automations.yaml @@ -625,8 +625,8 @@ actions: - parallel: - data: - message: Memory {{ states.sensor.system_monitor_memory_usage.state }}% - CPU - {{ states.sensor.system_monitor_processor_use.state }}% + message: Memory {{ states.sensor.ha_system_memory_usage.state }}% - CPU {{ + states.sensor.ha_system_cpu_usage.state }}% title: System action: notify.notify mode: single @@ -656,26 +656,55 @@ - id: '1701556784590' alias: Update YouTube Sensor description: '' - trigger: - - platform: state - entity_id: + triggers: + - entity_id: - media_player.living_room_tv - media_player.bedroom_tv attribute: media_title - condition: - - condition: or - conditions: - - condition: template - value_template: '{{ is_state_attr(''media_player.living_room_tv'', ''app_id'', - ''com.google.ios.youtube'') and state_attr(''media_player.living_room_tv'', - ''media_title'') != state_attr(''sensor.youtube_thumbnail'', ''title'') }}' - - condition: template - value_template: '{{ is_state_attr(''media_player.bedroom_tv'', ''source'', ''YouTube'') - and state_attr(''media_player.bedroom_tv'', ''media_title'') != state_attr(''sensor.youtube_thumbnail'', - ''title'') }}' - action: - - event: youtube_update - event_data: {} + trigger: state + id: title_change + for: + hours: 0 + minutes: 0 + seconds: 2 + - entity_id: + - media_player.living_room_tv + - media_player.bedroom_tv + trigger: state + id: reset_title + attribute: app_id + from: com.google.ios.youtube + conditions: [] + actions: + - choose: + - conditions: + - condition: and + conditions: + - condition: trigger + id: + - title_change + - condition: or + conditions: + - condition: template + value_template: "{% if state_attr('media_player.living_room_tv', 'media_title') + != None %} \n{{ is_state_attr('media_player.living_room_tv', 'app_id', + 'com.google.ios.youtube') and state_attr('media_player.living_room_tv', + 'media_title') != state_attr('sensor.youtube_thumbnail', 'title') }}\n{% + endif%}" + - condition: template + value_template: '{{ is_state_attr(''media_player.bedroom_tv'', ''source'', + ''YouTube'') and state_attr(''media_player.bedroom_tv'', ''media_title'') + != state_attr(''sensor.youtube_thumbnail'', ''title'') }}' + sequence: + - event: youtube_update + event_data: {} + - conditions: + - condition: trigger + id: + - reset_title + sequence: + - event: youtube_reset + event_data: {} max_exceeded: silent mode: single - id: '1702444277863' @@ -1153,3 +1182,111 @@ input: vacuum: vacuum.roidmi_eve camera: camera.roidmi_eve +- id: '1737054227949' + alias: Kids room camera snapshot + description: '' + triggers: + - at: 05:00:00 + id: delete + trigger: time + - hours: /1 + trigger: time_pattern + conditions: + - condition: time + after: 05:00:00 + before: 00:00:00 + actions: + - if: + - condition: trigger + id: delete + then: + - data: + folder: /config/www/tmp/snapshots/ + time: 0 + only_extensions: + - .png + - .jpg + action: delete.files_in_folder + - data: + folder: /config/www/tmp/kids/ + time: 0 + only_extensions: + - .png + - .jpg + action: delete.files_in_folder + - parallel: + - action: button.press + metadata: {} + data: {} + target: + entity_id: button.kids_room_start_rtsp_stream + - condition: state + entity_id: camera.kids_room + state: streaming + for: + hours: 0 + minutes: 0 + seconds: 3 + - delay: + hours: 0 + minutes: 0 + seconds: 2 + milliseconds: 0 + - parallel: + - data: + filename: /config/www/tmp/snapshots/camera.kids_room{{ now().strftime("%Y%m%d-%H%M%S") + }}.jpg + target: + entity_id: camera.kids_room + action: camera.snapshot + - action: input_text.set_value + metadata: {} + data: + value: camera.kids_room{{now().strftime("%Y%m%d-%H%M%S")}}.jpg + target: + entity_id: input_text.kids_camera_snapshot + - data: + filename: /config/tmp/camera.kids_room{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg + target: + entity_id: camera.kids_room + action: camera.snapshot + - delay: + hours: 0 + minutes: 0 + seconds: 5 + milliseconds: 0 + - action: button.press + metadata: {} + data: {} + target: + entity_id: button.kids_room_stop_rtsp_stream + mode: single +- id: '1737074902973' + alias: test video notify + description: '' + triggers: [] + conditions: [] + actions: + - action: notify.mobile_app_viet_ngoc + data: + message: Test video + data: + video: /media/local/test_video.mp4 + enabled: false + - action: notify.mobile_app_viet_ngoc + data: + message: browse + data: + actions: + - action: URI + title: Browse media + uri: /media-browser/browser + enabled: false + - action: notify.mobile_app_viet_ngoc + data: + message: Motion Detected in the Living Room + data: + entity_id: camera.kids_room_cam + push: + category: camera + mode: single diff --git a/config/configuration.yaml b/config/configuration.yaml index 8eef239..cdb34e0 100644 --- a/config/configuration.yaml +++ b/config/configuration.yaml @@ -12,7 +12,8 @@ homeassistant: - /config media_dirs: movies: /media/movies - media: /media + local: /media + # FRONT - END frontend: extra_module_url: diff --git a/config/custom_components/govee/manifest.json b/config/custom_components/govee/manifest.json index dd3ee4f..363300b 100644 --- a/config/custom_components/govee/manifest.json +++ b/config/custom_components/govee/manifest.json @@ -10,6 +10,6 @@ "issue_tracker": "https://github.com/LaggAt/hacs-govee/issues", "requirements": ["govee-api-laggat==0.2.2", "dacite==1.8.0"], "ssdp": [], - "version": "2025.1.1", + "version": "2023.11.1", "zeroconf": [] } diff --git a/config/dashboards/floorplan/mediaplayers.yaml b/config/dashboards/floorplan/mediaplayers.yaml index 69ed823..1811ea9 100755 --- a/config/dashboards/floorplan/mediaplayers.yaml +++ b/config/dashboards/floorplan/mediaplayers.yaml @@ -54,26 +54,27 @@ - atv-entity-picture entities: - media_player.living_room_tv - - sensor.youtube_thumbnail + # - sensor.youtube_thumbnail # - media_player.kodi_atv state_action: - service: floorplan.image_set service_data: image: | > - if (states['media_player.living_room_tv'].state === "off") { + const mediaState = states['media_player.living_room_tv'].state; + const appState = states['media_player.living_room_tv'].attributes.app_name; + if (mediaState !== "off") { + if (appState === "YouTube") { + return states['sensor.youtube_thumbnail'].state; + } else if (appState === "Kodi") { + return states['sensor.kodi_picture'].attributes.fanart; + } + } else { return "/local/hafloor/transparent_idle.png"; - } else if (states['media_player.living_room_tv'].state !== "off") { - let picture = states['sensor.youtube_thumbnail'].state; - if (states['media_player.kodi_atv'].state !== "off") { - picture = states['sensor.kodi_picture'].attributes.fanart; - } - return picture; } - entities: - light.sony_tv_backlight - # - media_player.kodi_atv state_action: - service: floorplan.style_set service_data: @@ -103,9 +104,9 @@ stroke-dashoffset: 400; animation: 5s ease-in-out 0s infinite strokeAnimation; */ `; - } else { - return "display: none;"; - } + } else { + return "display: none;"; + } - service: floorplan.style_set service_data: diff --git a/config/dashboards/shared/popup/calendar.yaml b/config/dashboards/shared/popup/calendar.yaml index c131aa0..05e5e77 100644 --- a/config/dashboards/shared/popup/calendar.yaml +++ b/config/dashboards/shared/popup/calendar.yaml @@ -10,14 +10,19 @@ browser_mod: type: custom:layout-card layout_type: custom:grid-layout layout: - grid-template-columns: 560px 560px + grid-template-columns: 550px 550px + grid-gap: 2px 1px margin: 0 padding: 0 + mediaquery: + '(max-width: 800px)': + grid-template-columns: 100% + grid-gap: 2px 1px + margin: 0 + padding: 0 cards: - type: entities title: "[[[ return states['sensor.date_en'].state;]]]" - card_mod: - class: header nopadding entities: - type: custom:atomic-calendar-revive enableModeChange: true @@ -43,11 +48,6 @@ browser_mod: compactMode: false showMultiDayEventParts: true showCurrentEventLine: true - card_mod: - style: | - .cal-card { - padding: 0px !important; - } - type: entities title: Lunar Phase card_mod: diff --git a/config/dashboards/shared/popup/popup_weather.yaml b/config/dashboards/shared/popup/popup_weather.yaml index 8992d35..e9a0f09 100644 --- a/config/dashboards/shared/popup/popup_weather.yaml +++ b/config/dashboards/shared/popup/popup_weather.yaml @@ -3,6 +3,8 @@ browser_mod: service: browser_mod.popup data: title: Weather + style: > + --max-popup-column: 2; content: type: custom:mod-card card_mod: !include ../snippets/style_popup_footer.yaml @@ -11,15 +13,8 @@ browser_mod: layout_type: custom:grid-layout layout: !include ../snippets/popup_footer_layout.yaml cards: - ################################################# - # # - # WEATHER POPUP # - # # - ################################################# - type: entities title: Prague - card_mod: - class: header nopadding entities: - type: custom:layout-card layout_type: custom:vertical-layout diff --git a/config/dashboards/shared/popup/security_sensors.yaml b/config/dashboards/shared/popup/security_sensors.yaml index defcf2a..0d79bb9 100755 --- a/config/dashboards/shared/popup/security_sensors.yaml +++ b/config/dashboards/shared/popup/security_sensors.yaml @@ -28,7 +28,7 @@ browser_mod: filter: template: | {% for sensor in expand('group.motion_sensors') -%} - {%- set name = state_attr(sensor.entity_id, "friendly_name") | regex_replace(find='Motion Sensor ', replace='') -%} + {%- set name = state_attr(sensor.entity_id, "friendly_name") | regex_replace('Motion Sensor| ?Occupancy','') | trim -%} {{ { 'entity': sensor.entity_id, 'name': name, @@ -51,7 +51,7 @@ browser_mod: filter: template: | {% for sensor in expand('group.contact_sensors') -%} - {%- set name = state_attr(sensor.entity_id, "friendly_name") | regex_replace(find='Contact Sensor ', replace='') -%} + {%- set name = state_attr(sensor.entity_id, "friendly_name") | regex_replace('Contact Sensor| ?Occupancy','') | trim -%} {{ { 'entity': sensor.entity_id, 'name': name, diff --git a/config/dashboards/shared/snippets/popup_footer_layout.yaml b/config/dashboards/shared/snippets/popup_footer_layout.yaml index 4a97c0d..8c02c48 100755 --- a/config/dashboards/shared/snippets/popup_footer_layout.yaml +++ b/config/dashboards/shared/snippets/popup_footer_layout.yaml @@ -1,4 +1,12 @@ -margin: -1 grid-template-columns: repeat(var(--max-popup-column, auto-fit), minmax(560px, 1fr)) grid-template-rows: auto grid-gap: 2px 1px +margin: 0 +padding: 0 +mediaquery: + '(max-width: 800px)': + grid-template-columns: 1fr + grid-template-rows: auto + grid-gap: 2px 1px + margin: 0 + padding: 0 diff --git a/config/dashboards/shared/snippets/style_popup_footer.yaml b/config/dashboards/shared/snippets/style_popup_footer.yaml index 9692001..8efbf38 100755 --- a/config/dashboards/shared/snippets/style_popup_footer.yaml +++ b/config/dashboards/shared/snippets/style_popup_footer.yaml @@ -1,7 +1,7 @@ style: layout-card$: - grid-layout: - $: | + grid-layout$: + .: | #root > * { margin: 0px !important; } @@ -10,7 +10,7 @@ style: display: block !important; } } - $hui-entities-card: + hui-entities-card: $: | ha-card { border-right: 0.1vw solid rgba(58, 69, 73, 0.2); @@ -18,6 +18,7 @@ style: transition: none; margin-bottom: 0 !important; } + ha-card.header.nopadding > .card-content { padding: 0 !important; } @@ -36,7 +37,7 @@ style: justify-content: space-evenly; margin-block: 1.5rem; } - $hui-entities-card:last-child: + hui-entities-card:last-child: $: | ha-card { border: none; diff --git a/config/dashboards/subviews/github-stats.yaml b/config/dashboards/subviews/github-stats.yaml new file mode 100644 index 0000000..728fc05 --- /dev/null +++ b/config/dashboards/subviews/github-stats.yaml @@ -0,0 +1,222 @@ +icon: mdi:github +title: GITHUB STATS +path: github-stats +subview: false +theme: tablet + +type: sections +max_columns: 6 +sections: + - type: grid + column_span: 2 + cards: + - &github_heading_card + type: custom:streamline-card + template: github_heading_card + variables: + - heading_title: 🚘 Vehicle status card + - total_entity: sensor.vehicle_status_card_total + - latest_entity: sensor.vehicle_status_latest + - stars_entity: sensor.vehicle_status_card_stars + - repo_link: https://github.com/ngocjohn/vehicle-status-card + - type: custom:mod-card + grid_options: + columns: full + card_mod: &swipe_style + style: + swipe-card: + $: | + #host { + --swiper-navigation-size: 24px !important; + --swiper-theme-color: rgb(179, 179, 179, .5); + } + .swiper-button-prev, .swiper-button-next { + top: 95% !important; + --swiper-navigation-size: 24px !important; + --swiper-theme-color: rgb(179, 179, 179, .5); + } + card: + type: custom:swipe-card + parameters: &swipe_parameters + navigation: + followFinger: false + grabCursor: false + roundLengths: true + centeredSlides: true + centeredSlidesBounds: true + enabled: true + createElements: false + allowTouchMove: false + cards: + - &github_graph_card + type: custom:streamline-card + template: github_graph_card + variables: + - total_entity: sensor.vehicle_status_card_total + - latest_entity: sensor.vehicle_status_latest + - &github_logbook_card + type: custom:streamline-card + template: github_logbook_card + variables: + - latest_entity: sensor.vehicle_status_latest + - &github_diagnostic_card + type: custom:streamline-card + template: github_diagnostic_card + variables: + - device_id: ngocjohn/vehicle-status-card + - type: grid + column_span: 2 + cards: + - <<: *github_heading_card + variables: + heading_title: 🚙 Vehicle info car + total_entity: sensor.vehicle_info_card + latest_entity: sensor.vehicle_latest_release_download + stars_entity: sensor.repo_vehicle_stars + repo_link: https://github.com/ngocjohn/vehicle-info-card + - type: custom:mod-card + card_mod: *swipe_style + grid_options: + columns: full + card: + type: custom:swipe-card + parameters: *swipe_parameters + cards: + - <<: *github_graph_card + variables: + total_entity: sensor.vehicle_info_card + latest_entity: sensor.vehicle_latest_release_download + bar_color: rgb(196, 74, 34) + fill_color: 'rgba(196, 74, 34, 0.2)' + - <<: *github_logbook_card + variables: + latest_entity: sensor.vehicle_latest_release_download + bar_color: rgb(196, 74, 34) + fill_color: 'rgba(196, 74, 34, 0.2)' + - <<: *github_diagnostic_card + variables: + device_id: ngocjohn/vehicle-info-card + bar_color: rgb(196, 74, 34) + fill_color: 'rgba(196, 74, 34, 0.2)' + - type: grid + column_span: 2 + cards: + - <<: *github_heading_card + variables: + heading_title: 🌘 Lunar Phase Card + total_entity: sensor.lunar_phase_card_total + latest_entity: sensor.lunar_phase_card_latest + stars_entity: sensor.lunar_phase_card_stars + repo_link: https://github.com/ngocjohn/lunar-phase-card + - type: custom:mod-card + card_mod: *swipe_style + grid_options: + columns: full + card: + type: custom:swipe-card + parameters: *swipe_parameters + cards: + - <<: *github_graph_card + variables: + total_entity: sensor.lunar_phase_card_total + latest_entity: sensor.lunar_phase_card_latest + bar_color: 'rgba(0, 255, 208, 0.7)' + fill_color: 'rgba(0, 255, 208, 0.2)' + - <<: *github_logbook_card + variables: + latest_entity: sensor.lunar_phase_card_latest + bar_color: 'rgba(0, 255, 208, 0.7)' + fill_color: 'rgba(0, 255, 208, 0.2)' + - <<: *github_diagnostic_card + variables: + device_id: ngocjohn/lunar-phase-card + bar_color: 'rgba(0, 255, 208, 0.7)' + fill_color: 'rgba(0, 255, 208, 0.2)' + - type: grid + column_span: 2 + cards: + - <<: *github_heading_card + variables: + heading_title: 🌘 Lunar Phase Integration + total_entity: sensor.lunar_phase_integration_total + latest_entity: sensor.lunar_phase_integration_latest + stars_entity: sensor.lunar_phase_integration_stars + repo_link: https://github.com/ngocjohn/lunar-phase + - type: custom:mod-card + card_mod: *swipe_style + grid_options: + columns: full + card: + type: custom:swipe-card + parameters: *swipe_parameters + cards: + - <<: *github_graph_card + variables: + total_entity: sensor.lunar_phase_integration_total + latest_entity: sensor.lunar_phase_integration_latest + bar_color: 'rgba(236, 79, 241, 0.7)' + fill_color: 'rgba(236, 79, 241, 0.2)' + - <<: *github_logbook_card + variables: + latest_entity: sensor.lunar_phase_integration_latest + bar_color: 'rgba(236, 79, 241, 0.7)' + fill_color: 'rgba(236, 79, 241, 0.2)' + - <<: *github_diagnostic_card + variables: + device_id: ngocjohn/lunar-phase + bar_color: 'rgba(236, 79, 241, 0.7)' + fill_color: 'rgba(236, 79, 241, 0.2)' + - type: grid + column_span: 2 + cards: + - <<: *github_heading_card + variables: + heading_title: 🛖 Hass Config + total_entity: 'sensor.hass_config_forks' + latest_entity: sensor.hass_config_latest_tag + stars_entity: 'sensor.hass_config_stars' + repo_link: https://github.com/ngocjohn/lunar-phase + - type: entities + grid_options: + columns: full + card_mod: + class: header nopadding + style: | + ha-card { + background: linear-gradient(to top, #2024349e 0%, transparent 100%); + } + show_header_toggle: false + state_color: false + entities: + - entity: sensor.hass_config_stars + name: Stars + - entity: sensor.hass_config_forks + name: Forks + - entity: sensor.hass_config_watchers + name: Watchers + - type: divider + - type: custom:multiple-logbook-card + card_mod: + style: | + ha-card .card-content-scroll { + padding: 0 !important; + max-height: 325px; + height: 100%; + } + max_items: 7 + show: + separator: true + duration: false + title: '' + date_format: relative + entities: + - entity: sensor.vehicle_latest_release_download + label: Vehicle Info + - entity: sensor.lunar_phase_integration_latest + label: Lunar Phase Integration + - entity: sensor.lunar_phase_card_latest + label: Lunar Phase Card + - entity: sensor.vehicle_status_latest + label: Vehicle Status + grid_options: + columns: full diff --git a/config/dashboards/templates/button_card_templates/tpl_base.yaml b/config/dashboards/templates/button_card_templates/tpl_base.yaml index 3a84c04..5889f46 100755 --- a/config/dashboards/templates/button_card_templates/tpl_base.yaml +++ b/config/dashboards/templates/button_card_templates/tpl_base.yaml @@ -878,12 +878,13 @@ extra_styles: #name { font-size: var(--chips-card-font-size); - padding: var(--chips-card-padding-v) var(--chips-card-padding-h); + //padding: var(--chips-card-padding-v) var(--chips-card-padding-h); } #state { + font-weight: var(--button-card-font-weight); font-size: var(--chips-card-state-size); - padding: var(--chips-card-padding-v) var(--chips-card-padding-h); - letter-spacing: 0.06vw; + //padding: var(--chips-card-padding-v) var(--chips-card-padding-h); + //letter-spacing: 0.06vw; } #card { border-radius: var(--chips-card-border-radius); @@ -1167,7 +1168,7 @@ extra_styles: clip-path: circle(50%); } `: ''} - ${/(tpl_popup_base|addons_base)/.test(this._config.template) ? ` + ${/(chip_system|tpl_popup_base|addons_base)/.test(this._config.template) ? ` :host { --cpu-mem-font-size: 12px; --cpu-mem-icon-size: 24px; @@ -1176,12 +1177,11 @@ extra_styles: cursor: var(--cursor); transition: border 300s ease-in-out, box-shadow 300ms ease ; } - ${ variables.hover_enable + ${variables.hover_enable ? `#card:hover { box-shadow: inset 0 0 1rem var(--tablet-primary-color) !important; border: 0.5px solid var(--tablet-primary-color) !important; - ${!variables.state_on ? 'color: unset !important;' :''} }` : '' } diff --git a/config/dashboards/templates/button_card_templates/tpl_chips.yaml b/config/dashboards/templates/button_card_templates/tpl_chips.yaml index 410baf3..bf8aae0 100644 --- a/config/dashboards/templates/button_card_templates/tpl_chips.yaml +++ b/config/dashboards/templates/button_card_templates/tpl_chips.yaml @@ -11,6 +11,7 @@ chips: template: - settings - extra_styles + - card_bounce variables: state_on: > [[[ return ['on', 'home', 'Normal', 'Away', 'Night', 'Guest', 'cool', 'fan_only', 'unlocked', 'open', 'streaming', 'yes', 'Blažičkova', 'Plzeňská'].indexOf(!entity || entity.state) !== -1; ]]] @@ -26,7 +27,6 @@ chips: [[[ return !entity || entity.attributes.entity_picture; ]]] timeout: > [[[ return !entity || Date.now() - Date.parse(entity.last_changed); ]]] - gle: > [[[ return states['sensor.gle'].state; ]]] hover_enable: true @@ -48,33 +48,7 @@ chips: } return variables.translate_unknown; ]]] - tap_action: - card_bounce: | - [[[ - // add animation - if (this.getElementsByTagName("style").length === 0) { - // phone condition - let mq = window.matchMedia('(max-width: 800px)').matches; - let style = document.createElement('style'); - style.innerHTML = ` - @keyframes card_bounce { - 0% { transform: scale(1); } - 10% { transform: scale(${ mq ? '0.92' : '0.94' }); } - 25% { transform: scale(1); } - 30% { transform: scale(${ mq ? '0.96' : '0.98' }); } - 100% { transform: scale(1); } - } - `; - this.appendChild(style); - } - // duration - let duration = 800; - // animate - this.style.animation = `card_bounce ${duration}ms cubic-bezier(0.22, 1, 0.36, 1)`; - // reset - window.setTimeout(() => { this.style.animation = "none"; }, duration + 100) - ]]] - haptic: medium + double_tap_action: haptic: success hold_action: @@ -85,8 +59,8 @@ chips: "i n" "i s" - grid-template-rows: min-content min-content - - grid-template-columns: 1fr 2fr - - column-gap: 8px + - grid-template-columns: 0.5fr 1fr + # - column-gap: 8px card: # - box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.15) - --mdc-ripple-color: rgba(0, 0, 0, 0.8) @@ -106,9 +80,8 @@ chips: - box-sizing: border-box; - border: 1px solid transparent; state: - - font-weight: 400 - - padding: 0 0.4vw 0 0 - - line-height: 100% + # - padding: 0 0.4vw 0 0 + # - line-height: 100% - align-self: center - justify-self: start - color: > @@ -119,8 +92,8 @@ chips: ]]] name: - justify-self: start - - padding: 0 0.4vw 0 0 - - line-height: 160% + # - padding: 0 0.4vw 0 0 + # - line-height: 160% - letter-spacing: 0.06em img-cell: - display: inline-flex @@ -128,11 +101,13 @@ chips: - position: relative icon: - width: 40% + - position: inherit - height: auto - background: rgb(150 150 150 / 30%) - - border-radius: 1vw - - padding: 10% - - position: inherit + - border-radius: 9999px + - padding: 10px + - margin: 0 + - display: inline-block - place-self: center baseline - opacity: > [[[ @@ -216,13 +191,13 @@ chip_air: "icon n" "icon s" - grid-template-rows: min-content min-content - - grid-template-columns: 1fr 2fr - - column-gap: 8px + - grid-template-columns: 0.5fr 1fr + # - column-gap: 8px card: - color: '#97989c' - background: linear-gradient(to bottom, rgba(53, 59, 83, 0.8) 0%, rgba(10, 14, 34, 0.8) 50%, rgba(53, 59, 83, 0.8) 100%) # - border-bottom-color: rgba(10, 14, 34, 1) - - padding: 0.2vw + # - padding: 0.2vw state: - color: &color > [[[ @@ -253,11 +228,12 @@ chip_system: action: more-info styles: card: + - box-shadow: none - padding: 0.3vw - box-sizing: border-box; - - border: 1px solid transparent; - - border-bottom: inherit; - - border-bottom-color: rgba(10, 14, 34, 1); + # - border: 1px solid transparent; + - border-bottom: 0.5px solid + - border-bottom-color: rgba(10, 14, 34, 1) - color: rgba(255, 255, 255, 0.6) - background: linear-gradient(to bottom, rgba(115, 115, 115, 0.2) 0%, rgba(49, 49, 49, 0.2) 100%) state: diff --git a/config/dashboards/templates/button_card_templates/tpl_footer.yaml b/config/dashboards/templates/button_card_templates/tpl_footer.yaml index cb46a86..83078fb 100755 --- a/config/dashboards/templates/button_card_templates/tpl_footer.yaml +++ b/config/dashboards/templates/button_card_templates/tpl_footer.yaml @@ -224,6 +224,9 @@ updates: ? `${a.release_url.split('/')[3]}/${a.release_url.split('/')[4]}` : a?.friendly_name; }; + + + // update entities Object.keys(states).forEach(key => { let s = states[key], e = s.entity_id, a = s.attributes; @@ -234,6 +237,9 @@ updates: `; } }); + function test(e) { + console.log(e); + } // subtitle let count = updates?.attributes.update_entities, subtitle = count === 0 diff --git a/config/dashboards/templates/button_card_templates/tpl_header.yaml b/config/dashboards/templates/button_card_templates/tpl_header.yaml index 37cacbc..0db97a9 100644 --- a/config/dashboards/templates/button_card_templates/tpl_header.yaml +++ b/config/dashboards/templates/button_card_templates/tpl_header.yaml @@ -47,7 +47,6 @@ header_weather: show_name: false show_state: true show_label: true - tap_action: !include ../../shared/popup/popup_weather.yaml state_display: > [[[ var realtemp = entity.attributes.temperature; diff --git a/config/dashboards/templates/button_card_templates/tpl_sectors.yaml b/config/dashboards/templates/button_card_templates/tpl_sectors.yaml index 81b9390..1c20e92 100755 --- a/config/dashboards/templates/button_card_templates/tpl_sectors.yaml +++ b/config/dashboards/templates/button_card_templates/tpl_sectors.yaml @@ -1004,11 +1004,11 @@ camera: ]]] battery: '' show_name: false - tap_action: - action: call-service - service: automation.trigger - service_data: - entity_id: automation.camera_snapshot + # tap_action: + # action: call-service + # service: automation.trigger + # service_data: + # entity_id: automation.camera_snapshot tooltip: > [[[ return states[variables.battery].state+' %'; diff --git a/config/dashboards/templates/decluttering-card-backup.yaml b/config/dashboards/templates/decluttering-card-backup.yaml new file mode 100644 index 0000000..851cca9 --- /dev/null +++ b/config/dashboards/templates/decluttering-card-backup.yaml @@ -0,0 +1,1156 @@ +#- +# _ _ _ _ _ _ +# __| | ___ ___| |_ _| |_| |_ ___ _ __(_)_ __ __ _ ___ __ _ _ __ __| | +# / _` |/ _ \/ __| | | | | __| __/ _ \ '__| | '_ \ / _` |_____ / __/ _` | '__/ _` | +# | (_| | __/ (__| | |_| | |_| || __/ | | | | | | (_| |_____| (_| (_| | | | (_| | +# \__,_|\___|\___|_|\__,_|\__|\__\___|_| |_|_| |_|\__, | \___\__,_|_| \__,_| +# |___/ +#- from github.com/ngocjohn/hass-config +# +light_auto_entitites: + card: + type: custom:auto-entities + filter: + include: + - group: '[[group]]' + options: + type: custom:mushroom-light-card + fill_container: true + layout: vertical + primary_info: name + secondary_info: state + use_light_color: true + show_brightness_control: true + show_color_control: true + show_color_temp_control: true + collapsible_controls: true + tap_action: + action: toggle + hold_action: + action: more-info + card_mod: + style: | + ha-card { + background: + {% if is_state(config.entity, 'on') %} + rgba(var(--rgb-state-light), 0.1); + {% endif %} + #cfcfcf1a !important; + border-radius: 12px !important; + } + card: + type: grid + square: false + columns: 2 + title: '[[title]]' + show_empty: true + card_param: cards + # # # # # # # # # # # # # # # # # # # # # # # # # + # # + # MAIN ROOMS # + # # + # # # # # # # # # # # # # # # # # # # # # # # # # + + # OFFICE GRID +grid_office: + card: + type: custom:button-card + entity: light.office_group + name: Office + double_tap_action: !include ../shared/popup/rooms/office.yaml + hold_action: !include ../shared/honeycomb/office_mode.yaml + template: + - rooms_base + - motion + - macbook + - server + - icon_office + - change_grid_title + # - light + variables: + state_on: > + [[[ + let state = states['sensor.office_active'].state; + if (state == 'yes') return state; + ]]] + motion: input_boolean.brma + light_entity: light.office_group + server: binary_sensor.mbproserver_active + macbook: switch.macbook + active: sensor.office_active + tempsensor: sensor.office_temp_humid_temperature + humidsensor: sensor.office_temp_humid_humidity + # LIVING ROOM GRID +grid_living_room: + card: + type: custom:button-card + entity: light.living_room_group + name: Lounge + double_tap_action: !include ../shared/popup/rooms/livingroom.yaml + hold_action: !include ../shared/honeycomb/living.yaml + template: + - rooms_base + - icon_couch_lamp + + variables: + light_entity: light.living_room_group + active: sensor.living_room_active + card_mod: + style: | + #circle { + {%- if not is_state('light.shelly_rgbw_kitchen_led_strip', 'on') -%} + display:none !important; + {% endif %} + } + +# grid_living_room: +# card: +# type: custom:button-card +# entity: person.viet_ngoc +# name: Viet Ngoc +# template: +# - battery_circle +# variables: +# battery: sensor.viet_ngoc_battery_level +# circle_unit: ' %' + +# KITCHEN NORMAL +grid_kitchen_normal: + card: + type: custom:button-card + entity: light.kitchen_group + name: Kitchen + template: + - rooms_base + - icon_noodles + - fan_circle + - motion + double_tap_action: !include ../shared/popup/rooms/kitchen.yaml + hold_action: !include ../shared/honeycomb/kitchen.yaml + variables: + fan_circle: fan.hood_power + light_entity: light.kitchen_table_light + motion: binary_sensor.motion_sensor_kitchen_occupancy + active: sensor.kitchen_active + # KITCHEN DISHWASING +grid_kitchen_dishwasing: + card: + type: custom:button-card + entity: timer.dishwasher_remaining + name: Dishwasher + template: + - base + - appliance_circle + - icon_dish + double_tap_action: + action: fire-dom-event + browser_mod: + service: browser_mod.popup + data: + title: 'Dishwasher' + # card_mod: + # style: + # #popup header + # .: + content: + type: vertical-stack + cards: + - type: entities + entities: + - entity: switch.mycka_nadobi_power + name: Power + icon: mdi:power + secondary_info: last-changed + - entity: binary_sensor.mycka_nadobi_door + name: Door + - entity: sensor.mycka_nadobi_operation_state + name: Operation State + - entity: sensor.mycka_nadobi_program_progress + name: Program Progress + - entity: sensor.mycka_nadobi_remaining_program_time + name: Remaining Program Time + tap_action: !include ../shared/popup/rooms/kitchen.yaml + hold_action: !include ../shared/honeycomb/kitchen.yaml + variables: + light_entity: light.kitchen_table_light + appliance: sensor.mycka_nadobi_program_progress + custom_fields: + timer: + card: + type: custom:timer-bar-card + layout: full_row + text_width: 0px + entity: timer.dishwasher_remaining + bar_direction: rt + invert: true + bar_background: '#ffffff4d' + bar_foreground: '#e5a00d9e' + styles: + card: + - overflow: hidden + custom_fields: + timer: + - display: block + - position: absolute + - top: > + [[[ + return window.matchMedia('(max-width: 800px)').matches + ? '77%' + : '97%'; + ]]] + - left: -15% + - width: 127% + + # BEDROOM +grid_bedroom: + card: + type: custom:button-card + entity: light.bedroom_group + name: Bedroom + double_tap_action: !include ../shared/popup/rooms/bedroom.yaml + hold_action: !include ../shared/honeycomb/bedroom.yaml + template: + - rooms_base + - icon_double_bed + - babycam + # - icon_bedroom + # - icon_bed + variables: + babycam: switch.lidl_3_gang_socket_l3 + active: sensor.bedroom_active + light_entity: light.bedroom_group + state_on: > + [[[ + let state = states['sensor.bedroom_active'].state; + if (state == 'yes') return state; + ]]] + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + # # + # SECURITY # + # # + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + # ALARM PANEL +grid_alarm: + card: + type: custom:button-card + entity: alarm_control_panel.aqara_hub + hold_action: !include ../shared/honeycomb/security.yaml + template: + - alarm + - icon_alarm + + # FRONT DOOR +grid_front_door: + card: + type: custom:button-card + entity: lock.nuki_neklanka_byt_lock + name: Front door + tap_action: + action: block + template: + - front_door + - icon_lock + - loader + variables: + battery_alert: binary_sensor.nuki_vchod_battery_critical + # MOTION SENSORS +grid_motion_sensors: + card: + type: custom:button-card + entity: sensor.motion_detected + tap_action: !include ../shared/popup/security_sensors.yaml + template: + - sensors + - icon_motion + - battery_alert + variables: + battery_alert: binary_sensor.zigbee_sensors_problem + # CONTACT SENSORS +grid_contact_sensors: + card: + type: custom:button-card + tap_action: !include ../shared/popup/security_sensors.yaml + entity: sensor.doors_state + template: + - doors + - circle_state + - icon_closet + + # APPLE TV +grid_atv: + card: + type: custom:button-card + entity: media_player.living_room_tv + name: Apple TV + # double_tap_action: !include ../shared/popup/rooms/atv_remote.yaml + double_tap_action: !include ../shared/popup/rooms/apple_tv_card.yaml + hold_action: !include ../shared/honeycomb/atv.yaml + template: + - mediaplayer + # SAMSUNG TV +grid_samsung: + card: + type: custom:button-card + entity: media_player.bedroom_tv + name: > + [[[ + let source = states['media_player.bedroom_tv'].attributes.source; + if ( variables.state_on && source !== 'Android TV Launcher' ) + return source; + else + return 'Samsung'; + ]]] + hold_action: !include ../shared/honeycomb/shield.yaml + template: + - mediaplayer + # PLAYSTATION +grid_playstation: + card: + type: custom:button-card + entity: switch.ps5_power + name: Playstation + template: + - base + - icon_ps5 + - loader + # HOMEPODS +grid_homepods: + card: + type: custom:button-card + entity: media_player.mass_universal_airplay + template: + - base + - icon_homepod + - circle + name: Homepods + double_tap_action: !include ../shared/popup/popup_mass.yaml + variables: + media_on: > + [[[ return !entity || ['on', 'paused', 'idle'].indexOf(entity.state) !== -1; ]]] + state_on: > + [[[ return !entity || ['playing'].indexOf(entity.state) !== -1; ]]] + circle_input: > + [[[ + return entity === undefined || Math.round(states['sensor.currently_playing'].attributes.mass_homepods / 4 * 100 ); + ]]] + circle_input_unit: ' /4' + custom_fields: + circle: > + [[[ + let input = variables.circle_input, + radius = 20.5, + tspan = '', + circumference = radius * 2 * Math.PI, + state = variables.state_on, + unit = variables.circle_input_unit || ' '; + let inner_text = Math.round(states['sensor.currently_playing'].attributes.mass_homepods ); + return ` + + + + ${inner_text}${tspan}${unit} + + `; + ]]] + card_mod: + style: | + {%- if is_state('media_player.mass_universal_airplay', 'off') %} + #circle { + display: none !important; + } + {%- endif %} + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + # # + # ROOMS 2 # + # # + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + # SHOWER ROOM +grid_shower: + card: + type: custom:button-card + entity: sensor.shower_active + name: Shower + template: + - rooms_base + - door_state + - motion + - icon_shower_new + # - icon_shower + # - icon_shower_head + variables: + light_entity: light.shower_group + motion: binary_sensor.motion_sensor_shower_room_occupancy + door: binary_sensor.contact_sensor_shower_room_contact + active: sensor.shower_active + # BATHROOM +grid_bathroom: + card: + type: custom:button-card + entity: sensor.bathroom_active + # double_tap_action: !include /config/dashboards/shared/popup/test_pop.yaml + name: Bathroom + template: + - rooms_base + - icon_bathroom + - motion + - door_state + - air_diffuser_circle + variables: + light_entity: light.bathroom_group + motion: binary_sensor.motion_sensor_bathroom_occupancy + door: binary_sensor.contact_sensor_bathroom + active: sensor.bathroom_active + air_diffuser_circle: switch.bathroom_air_diffuser + # UTILITY NORMAL +grid_utility_normal: + card: + type: custom:button-card + entity: light.utility_room_light + name: Utility + double_tap_action: !include ../shared/popup/rooms/utility.yaml + hold_action: !include ../shared/honeycomb/utitlity.yaml + template: + - rooms_base + - icon_broom + variables: + light_entity: light.utility_room_light + active: sensor.appliance_active + # UTILITY VACUUM +grid_utility_vacuum: + card: + type: custom:button-card + entity: sensor.appliance_active + name: > + [[[ + if (entity) { + let vacumState = states['sensor.vacuum_status_fix'].state, + position = states['sensor.vacuum_position'].state; + if (vacumState === 'Cleaning') { + return 'Cleaning'; + } else { + return vacumState; + } + } + ]]] + double_tap_action: + action: fire-dom-event + browser_mod: + service: browser_mod.more_info + data: + entity: camera.roidmi_eve + hold_action: !include ../shared/honeycomb/utitlity.yaml + state_display: > + [[[ + if (entity) { + let vacumState = states['sensor.vacuum_status_fix'].state, + position = states['sensor.vacuum_position'].state; + if (vacumState === 'Cleaning') { + return position; + } else { + return vacumState; + } + } + ]]] + template: + - rooms_base + - icon_roborock + variables: + light_entity: light.utility_room_light + active: sensor.appliance_active + # UTILITY WASHING +grid_utility_washing: + card: + type: custom:button-card + entity: sensor.appliance_active + name: Washdryer + hold_action: !include ../shared/honeycomb/utitlity.yaml + template: + - rooms_base + - appliance_circle + - icon_washer + variables: + light_entity: light.utility_room_light + active: sensor.appliance_active + appliance: sensor.washer_dryer_program_progress + double_tap_action: + action: fire-dom-event + browser_mod: + service: browser_mod.popup + data: + title: 'Washer-Dryer' + card_mod: + style: + #popup header + .: + content: + type: vertical-stack + cards: + - type: entities + entities: + - entity: switch.washer_dryer_power + name: Power + icon: mdi:power + secondary_info: last-changed + - entity: binary_sensor.washer_dryer_door + name: Door + - entity: sensor.washer_dryer_operation_state + name: Operation State + - entity: sensor.washer_dryer_program_progress + name: Program Progress + - entity: sensor.washer_dryer_remaining_program_time + name: Remaining Program Time + + # HALLWAY +grid_hallway: + card: + type: custom:button-card + entity: light.hallway_group + name: Hallway + # double_tap_action: !include ../shared/hallway.yaml + state_display: > + [[[ if (variables.state == 'off' ) return " "; ]]] + template: + - rooms_base + # - icon_hallway + - icon_hanger_mirror + - motion + variables: + light_entity: light.hallway_group + motion: binary_sensor.motion_sensor_entrance_occupancy + # CAM DOOR +grid_cam_door: + card: + type: custom:button-card + entity: camera.doorway + name: ' ' + hold_action: !include ../shared/popup/cameras.yaml + variables: + battery: sensor.doorway_battery_percentage + template: + - camera + - loader + styles: + card: + - background-position: center + # CAM KIDS ROOM +grid_cam_kids: + card: + type: custom:button-card + entity: camera.kids_room + name: ' ' + hold_action: !include ../shared/popup/cameras.yaml + template: + - camera + - loader + variables: + battery: 'sensor.doorway_battery_percentage' + styles: + card: + - background-position: center + # - background-image: > + # [[[ + # return `linear-gradient(0deg, rgba(0,0,0,.3) 0%, rgba(0,0,0,0) 100%), url(/local/tmp/${variables.entity_id}-latest.jpg)`; + # ]]] + # CAM TERRACE +grid_cam_terrace: + card: + type: custom:button-card + entity: camera.terasa + name: ' ' + hold_action: !include ../shared/popup/cameras.yaml + template: + - camera + - loader + variables: + battery: sensor.terasa_battery_percentage + styles: + card: + - background-position: center + # CAM GARDEN +grid_cam_garden: + card: + type: custom:button-card + entity: camera.zahrada + name: ' ' + hold_action: !include ../shared/popup/cameras.yaml + template: + - camera + - loader + variables: + battery: sensor.zahrada_battery_percentage + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + # # + # CLIMATE # + # # + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + # AIR PURIFIER +grid_air_purifier: + card: + type: custom:button-card + entity: sensor.home_climate + name: Humidity + tap_action: block + template: + - airpurifier + double_tap_action: !include ../shared/popup/airpurifier.yaml + # double_tap_action: !include ../shared/popup/purifier_popup.yaml + # THERMOSTAT +grid_thermostat: + card: + type: custom:button-card + entity: sensor.home_climate + name: Temperature + template: + - thermostat + double_tap_action: !include ../shared/popup/thermostat.yaml + tap_action: + action: call-service + service: input_boolean.toggle + service_data: + entity_id: input_boolean.svg_temp_humid + # LIVING ROOM COVERS +grid_covers_living: + card: + type: custom:button-card + entity: cover.living_room_cover + name: Lounge + # hold_action: !include ../shared/honeycomb/cover_living.yaml + template: + - cover + # LIVING ROOM COVERS +grid_covers_bedroom: + card: + type: custom:button-card + entity: cover.bedroom_shutters + name: Bedroom + # hold_action: !include ../shared/honeycomb/cover_bedroom.yaml + template: + - cover + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + # # + # HOME # + # # + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + # PERSON NGOC +grid_ngoc: + card: + type: custom:button-card + entity: person.viet_ngoc + name: Viet Ngoc + double_tap_action: !include ../shared/popup/home_vietngoc.yaml + triggers_update: + - sensor.waze_ngoc_home + template: + - person + variables: + circle_input: > + [[[ + let distance = Math.round(states['sensor.waze_ngoc_home'].attributes.distance); + if (distance) return distance; + ]]] + circle_input_unit: ' Km' + card_mod: + style: | + #circle { + {%- if is_state('person.viet_ngoc', 'home') -%} + display:none !important; + {% endif %} + } + # PERSON ZUZU +grid_zuzu: + card: + type: custom:button-card + entity: person.huong_giang + name: Zuzu + double_tap_action: !include ../shared/popup/home_zuzu.yaml + tap_action: + action: call-service + service: script.turn_on + service_data: + entity_id: script.zuzu_entities + triggers_update: + - sensor.waze_zuzu + template: + - person + state_display: > + [[[ + if (entity) + return variables.state === 'not_home' || variables.state === 'away' + ? states['sensor.gle'].state + : variables.state; + ]]] + # WEATHER +grid_weather: + card: + type: custom:button-card + entity: weather.prague + name: Prague + variables: + temp_min: sensor.weather_min_temp + temp_max: sensor.weather_max_temp + humidity: sensor.weather_humidity + current_weather: weather.prague + template: + - widget_weather + # HOME MODE +grid_home_mode: + card: + type: custom:button-card + entity: sensor.home_mode + name: Home mode + tap_action: + action: block + template: + - base + - icon_homemode + variables: + state_on: > + [[[ return true; ]]] + styles: + name: + - overflow: initial + # FOOTER +footer: + card: + type: horizontal-stack + view_layout: + grid-area: footer + cards: + - type: custom:button-card + name: > + Refresh + tap_action: + action: call-service + service: browser_mod.sequence + service_data: + sequence: + - service: shell_command.refresh_lovelace + - service: browser_mod.javascript + data: + code: lovelace_reload() + template: + - footer + - type: custom:button-card + name: > + Vacuum + tap_action: !include ../shared/popup/footer/footer_vacuum.yaml + triggers_update: + - sensor.date + variables: + notify: > + [[[ + let id = states['sensor.robot_vacuum_last_clean_end']; + if (id) return (Date.now() - Date.parse(id.state)) > 6048e5; + ]]] + template: + - footer + - type: custom:button-card + name: > + System + tap_action: !include ../shared/popup/footer/footer_system.yaml + template: + - footer + - type: custom:button-card + name: > + Server + tap_action: !include ../shared/popup/footer/footer_mbproserver.yaml + template: + - footer + - type: custom:button-card + entity: sensor.template_updates + name: > + Updates + tap_action: !include ../shared/popup/footer/footer_updates.yaml + variables: + notify: > + [[[ + return parseInt(entity?.state); + ]]] + template: + - footer + - type: custom:button-card + name: > + Overview + tap_action: !include ../shared/popup/footer/footer_overview.yaml + # variables: + # notify: > + # [[[ + # let id = states['binary_sensor.galaxy_tab_a_plugged_in']; + # if (id) return id.state === 'off'; + # ]]] + template: + - footer + - type: custom:button-card + name: > + Network + tap_action: !include ../shared/popup/footer/footer_network.yaml + triggers_update: + - binary_sensor.template_unifi_alerts + - update.unifi_status_update + variables: + notify: > + [[[ + let id = this._config.triggers_update; + if (id.every(e => states[e])) + return states[id[0]].state === 'on' + ? `error` + : states[id[1]].state === 'on' + ? 1 + : null; + ]]] + template: + - footer + + # LIGHT CARD + + # Light Card + # Uses the slider-button-card module. + + # Multi Graph Card + # Uses the mini-graph-card module. +multi_graph_card: + default: + - title: '' + - icon: '' + - hours_to_show: 48 + - points_per_hour: 2 + - height: 200 + - lower_bound: ~10000 + - upper_bound: ~0 + - animate: true + - show_extrema: false + - show_header: '' + - show_state: '' + - show_legend: '' + - smoothing: true + card: + type: 'custom:mini-graph-card' + entities: '[[entities]]' + name: '[[title]]' + icon: '[[icon]]' + hours_to_show: '[[hours_to_show]]' + points_per_hour: '[[points_per_hour]]' + hour24: true + line_width: 1.5 + height: '[[height]]' + lower_bound: '[[lower_bound]]' + upper_bound: '[[upper_bound]]' + smoothing: '[[smoothing]]' + animate: '[[animate]]' + show: + labels_secondary: false + extrema: '[[show_extrema]]' + card_mod: + style: | + ha-card { padding-top: 0 !important; } + .header { + padding-bottom: 0; + margin-top: -8px; + display: [[show_header]]; + } + .name > span { + font-size: var(--body-font-size) !important; + font-weight: normal !important; + max-height: none !important; + opacity: 1 !important; + } + .states { + margin-top: -8px; + display: [[show_state]]; + } + .state__value { + font-size: var(--h1-font-size) !important; + font-weight: 100 !important; + padding-top: 4px; + } + .state__uom { + font-size: var(--h6-font-size) !important; + text-transform: uppercase; + margin-bottom: 2px !important; + } + .state__time { + font-size: var(--h6-font-size) !important; + font-weight: normal !important; + letter-spacing: normal !important; + } + .graph__legend { + font-size: var(--h6-font-size) !important; + font-weight: normal !important; + justify-content: flex-start !important; + padding-left: 8px !important; + padding-bottom: 16px !important; + letter-spacing: normal !important; + display: [[show_legend]]; + } + .graph__legend__item { + margin: 0 8px !important; + } + .icon { + margin-top: 6px; + flex-basis: 0 !important; + } + .info.flex { + flex-flow: column; + position: absolute; + top: 32px; + right: 0; + } + .info__item { + flex-flow: row !important; + align-self: flex-end; + align-items: baseline !important; + } + .info__item span { + padding-left: 4px; + line-height: 16px; + } + .info__item__type { + font-size: var(--h6-font-size); + text-transform: uppercase !important; + } + .info__item__time { + display: none; + } + + # History Graph Card +history_graph_card: + default: + - name: '' + - icon: '' + - hours_to_show: 24 + - refresh_interval: 0 + card: + type: vertical-stack + in_card: true + cards: + - type: entity + entity: '[[entity]]' + name: '[[name]]' + icon: '[[icon]]' + - type: history-graph + hours_to_show: '[[hours_to_show]]' + refresh_interval: '[[refresh_interval]]' + show_names: false + entities: + - entity: '[[entity]]' + card_mod: + style: + .: | + ha-card { overflow: hidden; } + .content { + margin-left: -68px !important; + margin-bottom: -40px !important; + padding: 0 0 12px 0 !important; + overflow: hidden; + filter: hue-rotate(115deg) saturate(3) brightness(0.66) + } + state-history-charts$state-history-chart-line$ha-chart-base$: | + .chartLegend { display: none;} + + # LIGHT CARD + + # Light Card + # Uses the slider-button-card module. +light_card: + default: + - name: '' + card: + type: 'custom:slider-button-card' + entity: '[[entity]]' + name: '[[name]]' + slider: + direction: left-right + background: solid + use_state_color: true + use_percentage_bg_opacity: true + show_track: true + toggle_on_click: false + force_square: true + show_name: true + show_state: true + compact: false + icon: + show: true + use_state_color: true + tap_action: + action: more-info + icon: '' + action_button: + mode: custom + icon: 'mdi:power' + show: false + show_spinner: false + tap_action: + action: toggle + card_mod: + style: | + .name { + overflow: visible !important; + white-space: normal !important; + line-height: 1.33 !important; + padding: 10px 12px !important; + position: absolute; + bottom: 0 !important; + } + .icon { + --mdc-icon-size: 20px; + bottom: 10px !important; + position: absolute !important; + right: 8px !important; + } + .text { + bottom: 0 !important; + width: 100%; + height: 100%; + padding: 0 !important; + max-width: calc(100% - 24px) !important; + } + .slider { + background: linear-gradient(to right, rgba(var(--rgb-card-background-color),0.8), rgba(var(--rgb-card-background-color),0.8)), linear-gradient(to right, var(--slider-color), var(--slider-color)); + } + .slider-bg { + height: 4px !important; + top: auto !important; + bottom: 0 !important; + } + .state { + font-size: var(--h3-font-size); + font-weight: var(--h3-font-weight); + line-height: 2 !important; + padding: 14px 12px; + } + .slider-thumb::after { + background: var(--slider-thumb-color) !important; + } +tailwind_movies: + card: + type: custom:stack-in-card + card_mod: + style: !include ../shared/snippets/style-tailwind-card.yaml + mode: vertical + cards: + - type: custom:auto-entities + card: + type: horizontal-stack + filter: + template: | + {%- set movies = state_attr('[[entity]]', 'data') | sort(attribute="release_date", reverse=false) | sort(attribute="date_added", reverse=true) -%} + [ + {%- for movie in movies -%} + {%- if movie.title -%} + { + "type": "custom:popup-card", + "title": "{{ movie.title }}", + "entity": "{{ movie.tmdb_id }}", + "style": "--popup-min-width: 80vw;", + "card": {"type": "iframe", "aspect_ratio": "190%", "url": "{{ movie.tmdb_link }}"} + }{{ ',' if not loop.last }} + {%- endif %} + {%- endfor %} + ] + card_param: cards + - type: custom:tailwindcss-template-card + entity: '[[entity]]' + content: | +
+ + {% set movies = state_attr('[[entity]]', 'data') | sort(attribute="release_date", reverse=false) | + sort(attribute="date_added", reverse=true) %} + {% for movie in movies %} + + + {%- if movie.title %} +
+ + + +
+
+ + + + +
+ + + +
More..
+
+
+
+ + +
+ + + +
+ +
+ {{-movie.title-}} + {%- if movie.rating %} +
+ {{-movie.rating | round(2)-}} + +
+ {%endif%} +
+ + +
+
+ + {{-movie.year}} +
+ {%- if movie.runtime %} +
+ + {{-movie.runtime}} +
+ {%endif%} + {{movie.genres}} +
+ +
+ + +
+ {{-movie.overview}} +
+
+
+ {%-endif%} + {%- endfor %} +
+ ignore_line_breaks: true + always_update: false + parse_jinja: true + plugins: + daisyui: + enabled: true + url: https://cdn.jsdelivr.net/npm/daisyui@latest/dist/full.css + theme: inherit + overrideCardBackground: false + tailwindElements: + enabled: false diff --git a/config/dashboards/templates/decluttering-card.yaml b/config/dashboards/templates/decluttering-card.yaml index 851cca9..4db7150 100644 --- a/config/dashboards/templates/decluttering-card.yaml +++ b/config/dashboards/templates/decluttering-card.yaml @@ -7,6 +7,9 @@ # |___/ #- from github.com/ngocjohn/hass-config # + +# https://github.com/custom-cards/decluttering-card - Decluttering Card + light_auto_entitites: card: type: custom:auto-entities @@ -65,7 +68,7 @@ grid_office: - macbook - server - icon_office - - change_grid_title + # - change_grid_title # - light variables: state_on: > @@ -112,7 +115,8 @@ grid_living_room: # - battery_circle # variables: # battery: sensor.viet_ngoc_battery_level -# circle_unit: ' %' +# person_retain: sensor.test_person_last_changed +# battery_status: sensor.roidmi_v60_029d_charging_state # KITCHEN NORMAL grid_kitchen_normal: @@ -251,8 +255,8 @@ grid_front_door: - front_door - icon_lock - loader - variables: - battery_alert: binary_sensor.nuki_vchod_battery_critical + # variables: + # battery_alert: binary_sensor.nuki_vchod_battery_critical # MOTION SENSORS grid_motion_sensors: card: @@ -285,6 +289,12 @@ grid_atv: # double_tap_action: !include ../shared/popup/rooms/atv_remote.yaml double_tap_action: !include ../shared/popup/rooms/apple_tv_card.yaml hold_action: !include ../shared/honeycomb/atv.yaml + tap_action: + action: call-service + service: script.turn_on + service_data: + entity_id: script.atv_turn_on_off + template: - mediaplayer # SAMSUNG TV @@ -401,7 +411,6 @@ grid_bathroom: card: type: custom:button-card entity: sensor.bathroom_active - # double_tap_action: !include /config/dashboards/shared/popup/test_pop.yaml name: Bathroom template: - rooms_base @@ -550,7 +559,7 @@ grid_cam_door: grid_cam_kids: card: type: custom:button-card - entity: camera.kids_room + entity: camera.kids_room_cam name: ' ' hold_action: !include ../shared/popup/cameras.yaml template: @@ -558,14 +567,92 @@ grid_cam_kids: - loader variables: battery: 'sensor.doorway_battery_percentage' + double_tap_action: + action: fire-dom-event + browser_mod: + service: browser_mod.popup + data: + title: 'Kids Room' + card_mod: + style: + #popup header + .: + content: + type: custom:webrtc-camera + entity: camera.kids_room_cam + styles: card: - background-position: center - # - background-image: > - # [[[ - # return `linear-gradient(0deg, rgba(0,0,0,.3) 0%, rgba(0,0,0,0) 100%), url(/local/tmp/${variables.entity_id}-latest.jpg)`; - # ]]] - # CAM TERRACE + +# grid_cam_kids: +# card: +# type: custom:button-card +# entity: camera.kids_room_cam +# name: ' ' +# hold_action: !include ../shared/popup/cameras.yaml +# template: +# - camera +# - loader +# variables: +# battery: 'sensor.doorway_battery_percentage' +# double_tap_action: +# action: fire-dom-event +# browser_mod: +# service: browser_mod.sequence +# data: +# sequence: +# - service: > +# [[[ +# if (entity) { +# let streamStatus = states['sensor.kids_room_stream_status'].state; +# if (streamStatus === 'StreamStatus.IDLE') { +# return 'button.press'; +# } else { +# return null; +# } +# } +# ]]] +# data: +# entity_id: 'button.kids_room_start_rtsp_stream' +# - service: browser_mod.more_info +# data: +# entity: > +# [[[ +# return variables.entity_id; +# ]]] +# tap_action: +# action: > +# [[[ +# if (entity) { +# if (entity.state === 'streaming') { +# return 'call-service'; +# } else { +# return 'none'; +# } +# } +# ]]] +# service: button.press +# service_data: +# entity_id: button.kids_room_stop_rtsp_stream + +# styles: +# card: +# - background-position: center +# - background-image: > +# [[[ +# if (entity) { +# if (entity.state === 'streaming') { +# return `linear-gradient(0deg, rgba(0,0,0,.3) 0%, rgba(0,0,0,0) 100%), url(${variables.entity_picture})`; +# } else { +# const latest = states['input_text.kids_camera_snapshot'].state; +# return `linear-gradient(0deg, rgba(0,0,0,.3) 0%, rgba(0,0,0,0) 100%), url(/local/tmp/kids/camera.${latest})`; +# } +# } +# ]]] +# # CAM TERRACE + +# CAM TERRACE grid_cam_terrace: card: type: custom:button-card @@ -700,8 +787,7 @@ grid_weather: entity: weather.prague name: Prague variables: - temp_min: sensor.weather_min_temp - temp_max: sensor.weather_max_temp + daily_forecast: sensor.daily_forecast humidity: sensor.weather_humidity current_weather: weather.prague template: @@ -766,7 +852,7 @@ footer: - footer - type: custom:button-card name: > - Server + Server tap_action: !include ../shared/popup/footer/footer_mbproserver.yaml template: - footer diff --git a/config/dashboards/templates/streamline-card.yaml b/config/dashboards/templates/streamline-card.yaml index 0a3ed17..1152e91 100644 --- a/config/dashboards/templates/streamline-card.yaml +++ b/config/dashboards/templates/streamline-card.yaml @@ -7,6 +7,9 @@ # |___/ #- from github.com/ngocjohn/hass-config # + +# https://github.com/brunosabot/streamline-card - Streamline Card + light_auto_entitites: card: type: custom:auto-entities @@ -91,7 +94,6 @@ grid_living_room: template: - rooms_base - icon_couch_lamp - variables: light_entity: light.living_room_group active: sensor.living_room_active @@ -103,18 +105,6 @@ grid_living_room: {% endif %} } -# grid_living_room: -# card: -# type: custom:button-card -# entity: person.viet_ngoc -# name: Viet Ngoc -# template: -# - battery_circle -# variables: -# battery: sensor.viet_ngoc_battery_level -# person_retain: sensor.test_person_last_changed -# battery_status: sensor.roidmi_v60_029d_charging_state - # KITCHEN NORMAL grid_kitchen_normal: card: @@ -286,6 +276,12 @@ grid_atv: # double_tap_action: !include ../shared/popup/rooms/atv_remote.yaml double_tap_action: !include ../shared/popup/rooms/apple_tv_card.yaml hold_action: !include ../shared/honeycomb/atv.yaml + tap_action: + action: call-service + service: script.turn_on + service_data: + entity_id: script.atv_turn_on_off + template: - mediaplayer # SAMSUNG TV @@ -550,7 +546,7 @@ grid_cam_door: grid_cam_kids: card: type: custom:button-card - entity: camera.kids_room + entity: camera.kids_room_cam name: ' ' hold_action: !include ../shared/popup/cameras.yaml template: @@ -561,58 +557,18 @@ grid_cam_kids: double_tap_action: action: fire-dom-event browser_mod: - service: browser_mod.sequence + service: browser_mod.popup data: - sequence: - - service: > - [[[ - if (entity) { - let streamStatus = states['sensor.kids_room_stream_status'].state; - if (streamStatus === 'StreamStatus.IDLE') { - return 'button.press'; - } else { - return null; - } - } - ]]] - data: - entity_id: 'button.kids_room_start_rtsp_stream' - - service: browser_mod.more_info - data: - entity: > - [[[ - return variables.entity_id; - ]]] - tap_action: - action: > - [[[ - if (entity) { - if (entity.state === 'streaming') { - return 'call-service'; - } else { - return 'none'; - } - } - ]]] - service: button.press - service_data: - entity_id: button.kids_room_stop_rtsp_stream + title: 'Kids Room' + content: + type: custom:webrtc-camera + entity: camera.kids_room_cam styles: card: - background-position: center - - background-image: > - [[[ - if (entity) { - if (entity.state === 'streaming') { - return `linear-gradient(0deg, rgba(0,0,0,.3) 0%, rgba(0,0,0,0) 100%), url(${variables.entity_picture})`; - } else { - const latest = states['input_text.kids_camera_snapshot'].state; - return `linear-gradient(0deg, rgba(0,0,0,.3) 0%, rgba(0,0,0,0) 100%), url(/local/tmp/kids/camera.${latest})`; - } - } - ]]] - # CAM TERRACE + +# CAM TERRACE grid_cam_terrace: card: type: custom:button-card @@ -1200,3 +1156,148 @@ tailwind_movies: overrideCardBackground: false tailwindElements: enabled: false +addon_cards: + default: + - addon_list: '' + - button_template: '' + card: + type: custom:auto-entities + filter: + template: | + {%- set active = state_attr('sensor.hassio_addons_use', 'addons')['[[addon_list]]'] %} + {%- for dev in active -%} + {{ + { + 'type': 'custom:button-card', + 'name': dev.name, + 'entity': dev.running_ent, + 'template': ['[[button_template]]'], + 'variables': + { + 'slug_name': dev.slug_name, + 'dev_id': dev.dev_id, + 'conf_url': dev.conf_url, + 'cpu_ent': dev.cpu_ent, + 'memory_ent': dev.memory_ent, + 'update_ent': dev.update_ent, + 'ver_ent': dev.version_ent, + }, + } + }}, + {%- endfor %} + card: + type: custom:layout-card + layout_type: custom:grid-layout + layout: + grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) + grid-template-rows: auto + grid-gap: 0.5rem 0.8rem + margin: 0 + padding: 0 + mediaquery: + '(max-width: 800px)': + grid-template-columns: repeat(auto-fill, minmax(35%, 1fr)) + grid-gap: 4px 8px + cards: [] + +github_heading_card: + default: + - heading_title: null + - total_entity: null + - latest_entity: null + - stars_entity: null + - repo_link: null + card: + type: heading + icon: '' + heading: '[[heading_title]]' + heading_style: title + grid_options: + columns: full + rows: 1 + tap_action: + action: url + url_path: '[[repo_link]]' + badges: + - type: entity + entity: '[[total_entity]]' + - type: entity + entity: '[[latest_entity]]' + - type: entity + entity: '[[stars_entity]]' + +github_graph_card: + default: + - total_entity: '' + - latest_entity: '' + - bar_color: 'rgba(62, 149, 205, 1)' + - fill_color: 'rgba(62, 150, 205, 0.2)' + card: + type: custom:history-explorer-card + card_mod: + style: | + ha-card { + background: linear-gradient(to top, rgb(from {{'[[bar_color]]'}} r g b / 0.1) 0%, transparent 100%); + } + header: hide + showCurrentValues: false + legendVisible: false + defaultTimeRange: 1w + tooltip: + size: full + uiLayout: + toolbar: top + selector: hide + lineMode: curves + graphs: + - type: line + title: Total + entities: + - entity: '[[total_entity]]' + color: '[[bar_color]]' + fill: '[[fill_color]]' + - type: bar + title: Latest + entities: + - entity: '[[latest_entity]]' + color: '[[bar_color]]' +github_logbook_card: + default: + - latest_entity: '' + - bar_color: 'rgba(62, 149, 205, 1)' + - fill_color: 'rgba(62, 150, 205, 0.2)' + card: + type: custom:multiple-logbook-card + card_mod: + style: | + ha-card .card-content-scroll { + height: 100%; + max-height: 500px; + background: linear-gradient(to top, rgb(from {{'[[bar_color]]'}} r g b / 0.1) 0%, transparent 100%); + margin-top: 1rem !important; + } + ha-card .card-header { + display: none !important; + } + scroll: true + show: + separator: true + max_items: 10 + date_format: relative + entities: + - entity: '[[latest_entity]]' + +github_diagnostic_card: + default: + - device_id: '' + - bar_color: 'rgba(62, 149, 205, 1)' + - fill_color: 'rgba(62, 150, 205, 0.2)' + card: + type: custom:auto-entities + filter: + include: + - entity_category: diagnostic + device: '[[device_id]]' + exclude: [] + card: + type: entities diff --git a/config/dashboards/ui-lovelace-main.yaml b/config/dashboards/ui-lovelace-main.yaml index 28a1d1a..51c03eb 100644 --- a/config/dashboards/ui-lovelace-main.yaml +++ b/config/dashboards/ui-lovelace-main.yaml @@ -1,19 +1,12 @@ -swipe_nav: - wrap: false - animate_duration: 250 - enable_mouse_swipe: true - animate: swipe - prevent_default: false - swipe_amount: 30 - button_card_templates: !include_dir_merge_named ./templates/button_card_templates decluttering_templates: !include ./templates/decluttering-card.yaml streamline_templates: !include ./templates/streamline-card.yaml -title: Example +title: Neklanka Home views: - !include views/main.yaml - !include views/system.yaml + - !include subviews/github-stats.yaml - !include subviews/movie-panel.yaml - - !include subviews/ytube-music.yaml + # - !include subviews/ytube-music.yaml # - !include subviews/test-lovelace.yaml diff --git a/config/dashboards/views/main-grid/a-chips.yaml b/config/dashboards/views/main-grid/a-chips.yaml index 2cefdf3..8fc83b1 100755 --- a/config/dashboards/views/main-grid/a-chips.yaml +++ b/config/dashboards/views/main-grid/a-chips.yaml @@ -49,6 +49,14 @@ if (variables.playing == '0 Playing') return 'None'; else return variables.playing; ]]] + styles: + icon: + - color: > + [[[ + return variables.state_on + ? '#607D8B' + : ''; + ]]] tap_action: action: fire-dom-event browser_mod: diff --git a/config/dashboards/views/main-grid/header.yaml b/config/dashboards/views/main-grid/header.yaml index 232d17b..41b4e36 100755 --- a/config/dashboards/views/main-grid/header.yaml +++ b/config/dashboards/views/main-grid/header.yaml @@ -25,6 +25,7 @@ - header_clock - type: custom:button-card entity: weather.prague + tap_action: !include ../../shared/popup/popup_weather.yaml template: - header_weather ################################################# diff --git a/config/dashboards/views/main.yaml b/config/dashboards/views/main.yaml index 584585a..7e444c4 100755 --- a/config/dashboards/views/main.yaml +++ b/config/dashboards/views/main.yaml @@ -9,9 +9,8 @@ layout: margin: 0 grid-gap: 1.5vw 1vw grid-template-columns: 0 1fr 1fr 1fr 1fr 1fr 1fr 0 - grid-template-rows: 0 min-content 1fr 1fr fit-content(100%) 0 + grid-template-rows: min-content 1fr 1fr min-content 0 grid-template-areas: | - ". . . . . . . ." ". chips chips chips chips header header ." ". security mainrooms devices other floorplan floorplan ." ". cameras climate media movies floorplan floorplan ." @@ -21,7 +20,7 @@ layout: mediaquery: #laptop '(min-width: 1441px) and (max-width: 1770px)': - grid-gap: 2.5rem 1rem + grid-gap: 1.5vw 1vw #portrait '(min-width: 801px) and (max-width: 1440px)': grid-gap: 1% 1.5% diff --git a/config/dashboards/views/system-grid/side-columns.yaml b/config/dashboards/views/system-grid/side-columns.yaml index 5dc6ac8..3ba85c4 100644 --- a/config/dashboards/views/system-grid/side-columns.yaml +++ b/config/dashboards/views/system-grid/side-columns.yaml @@ -12,134 +12,15 @@ view_layout: grid-area: c2 entities: - - type: custom:auto-entities - filter: - template: | - {% set active_dev = states.sensor.hassio_addons_use.attributes.addons_active %} - {%- for dev in active_dev -%} - {{ - { - 'type': 'custom:button-card', - 'name': dev.name, - 'entity': dev.running_ent, - 'template': ['addon_active'], - 'variables': - { - 'slug_name': dev.slug_name, - 'dev_id': dev.dev_id, - 'conf_url': dev.conf_url, - 'cpu_ent': dev.cpu_ent, - 'memory_ent': dev.memory_ent, - 'update_ent': dev.update_ent, - 'ver_ent': dev.version_ent, - }, - } - }}, - {%- endfor %} - card: &addon_card - type: custom:layout-card - layout_type: custom:grid-layout - layout: - grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) - grid-template-rows: auto - grid-gap: 0.5rem 0.8rem - margin: 0 - padding: 0 - mediaquery: - '(max-width: 800px)': - grid-template-columns: repeat(auto-fill, minmax(35%, 1fr)) - grid-gap: 4px 8px - cards: [] + - type: custom:streamline-card + template: addon_cards + variables: + - addon_list: active + - button_template: addon_active - type: section label: Offline - - type: custom:auto-entities - filter: - template: | - {% set active_dev = states.sensor.hassio_addons_use.attributes.addons_off %} - {%- for dev in active_dev -%} - {{ - { - 'type': 'custom:button-card', - 'name': dev.name, - 'entity': dev.running_ent, - 'template': ['addons_base'], - 'variables': - { - 'slug_name': dev.slug_name, - 'dev_id': dev.dev_id, - 'conf_url': dev.conf_url, - 'cpu_ent': dev.cpu_ent, - 'memory_ent': dev.memory_ent, - 'update_ent': dev.update_ent, - 'ver_ent': dev.version_ent, - }, - } - }}, - {%- endfor %} - card: *addon_card -# - type: entities -# title: Devices state -# show_header_toggle: false -# card_mod: -# class: header -# entities: -# - type: custom:auto-entities -# filter: -# include: -# - attributes: -# device_class: battery -# state: < 30 -# options: -# type: custom:mushroom-template-card -# primary: '{{ states(entity) }}%' -# secondary: "{{ state_attr(entity, 'friendly_name') | title }}" -# icon: > -# {% set battery_level = (states(entity) | int / 10) | -# round(0) | int * 10 %} {% if battery_level == 100 %} -# mdi:battery -# {% elif battery_level > 0 %} -# mdi:battery-{{ battery_level }} -# {% else %} -# mdi:battery-outline -# {% endif %} -# icon_color: |- -# {% set battery_level = states(entity) | int %} -# {% if battery_level > 90 %} -# green -# {% elif battery_level > 60 %} -# light-green -# {% elif battery_level > 50 %} -# lime -# {% elif battery_level > 40 %} -# yellow -# {% elif battery_level > 30 %} -# amber -# {% elif battery_level > 20 %} -# orange -# {% elif battery_level > 10 %} -# deep-orange -# {% else %} -# red -# {% endif %} -# layout: horizontal -# tap_action: -# action: none -# badge_icon: |- -# {% set battery_level = states(entity) | int %} -# {% if battery_level < 10 %} -# mdi:exclamation-thick -# {% endif %} -# badge_color: red -# card_mod: -# style: | -# ha-card { -# padding: 4px 12px !important; -# } -# exclude: null -# show_empty: false -# card: -# type: custom:layout-card -# cards: [] -# layout_type: masonry -# sort: -# method: friendly_name + - type: custom:streamline-card + template: addon_cards + variables: + - addon_list: inactive + - button_template: addons_base diff --git a/config/dashboards/views/system-grid/system-graph.yaml b/config/dashboards/views/system-grid/system-graph.yaml index 2dfec81..adb45be 100644 --- a/config/dashboards/views/system-grid/system-graph.yaml +++ b/config/dashboards/views/system-grid/system-graph.yaml @@ -15,15 +15,18 @@ cardName: historycard-sys header: 'Monitoring' uimode: dark - defaultTimeOffset: 0 refresh: automatic: false combineSameUnits: true defaultTimeRange: 5h + defaultTimeOffset: 0 decimation: fast labelsVisible: true legendVisible: false - lineGraphHeight: 300 + lineMode: lines + lineGraphHeight: 320 + axisAddMarginMin: false + axisAddMarginMax: false uiLayout: toolbar: top selector: hide @@ -42,6 +45,7 @@ exclude: - entity: sensor.home_assistant_* lineMode: lines + - type: line entities: - entity: sensor.ha_system_cpu_usage @@ -52,5 +56,5 @@ grid-area: cc show: mediaquery: '(max-width: 1719px)' - lineGraphHeight: 250 - header: ' ' + lineGraphHeight: 220 + header: hide diff --git a/config/dashboards/views/system.yaml b/config/dashboards/views/system.yaml index 9b26287..4699c7c 100644 --- a/config/dashboards/views/system.yaml +++ b/config/dashboards/views/system.yaml @@ -7,9 +7,8 @@ layout: margin: 0 # height: 100% grid-gap: 2rem - overflow: hidden grid-template-columns: 0 1fr 1fr 1fr 1fr 1fr 1fr 0 - grid-template-rows: 0 fit-content(100%) 1fr fit-content(100%) 0 + grid-template-rows: 0 min-content 1fr min-content 0 grid-template-areas: | ". . . . . . . ." ". chips chips chips chips . . ." @@ -19,9 +18,9 @@ layout: mediaquery: # landscape '(min-width: 1441px) and (max-width: 1720px)': - grid-gap: 1% 1.5% + grid-gap: 1.2% 0.5% grid-template-columns: 0 1fr 1fr 1fr 1fr 1fr 1fr 0 - grid-template-rows: 0 min-content 1fr 1fr fit-content + grid-template-rows: 0 min-content fit-content(100%) min-content grid-template-areas: | ". . . . . . ." ". chips chips chips chips . ." diff --git a/config/go2rtc.yaml b/config/go2rtc.yaml index 0680c88..2ec51b3 100644 --- a/config/go2rtc.yaml +++ b/config/go2rtc.yaml @@ -1,3 +1,3 @@ streams: - T8400P2021030E86: - - T8400P2021030E86 + Kids Room: + - rtsp://CameraNeklanka27:NeklankaCamera27@192.168.0.24/live0 diff --git a/config/packages/hassio/hass_group.yaml b/config/packages/hassio/hass_group.yaml index 684cd17..6e22dcb 100644 --- a/config/packages/hassio/hass_group.yaml +++ b/config/packages/hassio/hass_group.yaml @@ -17,6 +17,7 @@ group: - light.living_room_floor_lamp - light.shelly_dimmer - light.shelly_rgbw_kitchen_led_strip + - light.sony_tv_backlight light_kitchen: name: Lights Kitchen Group icon: mdi:lightbulb-group @@ -82,6 +83,7 @@ group: - light.office_ripple_mood_light - light.office_led_light_strip - light.bedroom_ripple_mood_light + - light.sony_tv_backlight # - light.yeelink_bslamp2_409e_light ## SECURITY - SENSORS GROUP ## motion_sensors: diff --git a/config/packages/hassio/hass_light.yaml b/config/packages/hassio/hass_light.yaml index 541a445..0bf1461 100644 --- a/config/packages/hassio/hass_light.yaml +++ b/config/packages/hassio/hass_light.yaml @@ -16,6 +16,7 @@ light: entities: - light.living_room_floor_lamp - light.shelly_rgbw_kitchen_led_strip + - light.sony_tv_backlight - platform: group name: 'Kitchen Group' unique_id: group_light_kitchen @@ -96,6 +97,7 @@ light: - light.office_ripple_mood_light - light.office_led_light_strip - light.bedroom_ripple_mood_light + - light.sony_tv_backlight # - light.yeelink_bslamp2_409e_light homeassistant: customize: diff --git a/config/packages/hassio/hass_sensors.yaml b/config/packages/hassio/hass_sensors.yaml index f4ecc52..2dcee3d 100644 --- a/config/packages/hassio/hass_sensors.yaml +++ b/config/packages/hassio/hass_sensors.yaml @@ -94,68 +94,43 @@ template: MEMORY: {{memory}}% | CPU: {{cpu}}% icon: mdi:home-assistant attributes: - addons_active: | + addons: > + {%- set data = namespace(active=[]) -%} + {%- set dev_inactive = namespace(offline=[]) -%} {%- set devices = label_devices('addons') -%} - {% for dev in devices -%} - {%- set devname = device_attr(dev, 'name')-%} - {%- set identifiers = device_attr(dev, 'identifiers') | list -%} - {%- set slug_name = identifiers[0][1]-%} - {%- set conf_url = device_attr(dev, 'configuration_url') | replace('homeassistant://', '') -%} - - {%- set entities = device_entities(dev) | list-%} - {%- set running_ent = entities | select('search', '_running$') | join(', ')-%} - {%- set cpu_ent = entities | select('search', '_cpu_percent$') | join(', ') -%} - {%- set memory_ent = entities | select('search', '_memory_percent$') | join(', ')-%} - {%- set update_ent = entities | select('search', '_update$') | join(', ')-%} - {%- set version_ent = entities | select('search', '_version$') | reject('search', '_newest_version$') | join(', ')-%} - {%- if is_state(running_ent, 'on')-%} - {{ - { - 'name': devname, - 'dev_id': dev, - 'conf_url': conf_url, - 'slug_name': slug_name, - 'running_ent': running_ent, - 'cpu_ent': cpu_ent, - 'memory_ent': memory_ent, - 'update_ent': update_ent, - 'version_ent': version_ent, - } - }}, - {%- endif -%} - {%- endfor-%} - addons_off: | - {%- set devices = label_devices('addons') -%} - {% for dev in devices -%} - {%- set devname = device_attr(dev, 'name')-%} + {%- for dev in devices -%} + {%- set devname = device_attr(dev, 'name') -%} {%- set identifiers = device_attr(dev, 'identifiers') | list -%} - {%- set slug_name = identifiers[0][1]-%} + {%- set slug_name = identifiers[0][1] -%} {%- set conf_url = device_attr(dev, 'configuration_url') | replace('homeassistant://', '') -%} - {%- set entities = device_entities(dev) | list-%} - {%- set running_ent = entities | select('search', '_running$') | join(', ')-%} + {%- set entities = device_entities(dev) | list -%} + {%- set running_ent = entities | select('search', '_running$') | join(', ') -%} {%- set cpu_ent = entities | select('search', '_cpu_percent$') | join(', ') -%} - {%- set memory_ent = entities | select('search', '_memory_percent$') | join(', ')-%} - {%- set update_ent = entities | select('search', '_update$') | join(', ')-%} - {%- set version_ent = entities | select('search', '_version$') | reject('search', '_newest_version$') | join(', ')-%} + {%- set memory_ent = entities | select('search', '_memory_percent$') | join(', ') -%} + {%- set update_ent = entities | select('search', '_update$') | join(', ') -%} + {%- set version_ent = entities | select('search', '_version$') | reject('search', '_newest_version$') | join(', ') -%} + + {%- set addon_data = { + 'name': devname, + 'dev_id': dev, + 'conf_url': conf_url, + 'slug_name': slug_name, + 'running_ent': running_ent, + 'cpu_ent': cpu_ent, + 'memory_ent': memory_ent, + 'update_ent': update_ent, + 'version_ent': version_ent, + } -%} - {%- if is_state(running_ent, 'off')-%} - {{ - { - 'name': devname, - 'dev_id': dev, - 'conf_url': conf_url, - 'slug_name': slug_name, - 'running_ent': running_ent, - 'cpu_ent': cpu_ent, - 'memory_ent': memory_ent, - 'update_ent': update_ent, - 'version_ent': version_ent, - } - }}, + {%- if is_state(running_ent, 'on') -%} + {%- set data.active = data.active + [addon_data] -%} + {%- else -%} + {%- set dev_inactive.offline = dev_inactive.offline + [addon_data] -%} {%- endif -%} - {%- endfor-%} + {%- endfor -%} + {{ {'active': data.active, 'inactive': dev_inactive.offline} | tojson }} command_line: - sensor: unique_id: hacs_installed diff --git a/config/packages/hassio/hass_system.yaml b/config/packages/hassio/hass_system.yaml index 6e948a7..332bd3f 100644 --- a/config/packages/hassio/hass_system.yaml +++ b/config/packages/hassio/hass_system.yaml @@ -11,7 +11,17 @@ # RECORDER recorder: db_url: !secret mariadb_url - + exclude: + domains: + - alarm_control_panel + - button + - camera + entity_globs: + - sensor.*_motor_speed + - sensor.browser_* + - light.browser_* + - sensor.prague_moon_* + - sensor.*_color logger: default: error diff --git a/config/packages/templates/sensors/template_image.yaml b/config/packages/templates/sensors/template_image.yaml new file mode 100644 index 0000000..c475425 --- /dev/null +++ b/config/packages/templates/sensors/template_image.yaml @@ -0,0 +1,6 @@ +template: + - image: + name: Kids Room Cam Snapshot + unique_id: kids_room_cam_snapshot + url: > + {{ state_attr('camera.kids_room_cam', 'entity_picture') }} diff --git a/config/packages/templates/sensors/template_sensors.yaml b/config/packages/templates/sensors/template_sensors.yaml index 9d12fdb..18b5c13 100644 --- a/config/packages/templates/sensors/template_sensors.yaml +++ b/config/packages/templates/sensors/template_sensors.yaml @@ -319,7 +319,7 @@ template: state: "{{ iif (is_state('group.motion_sensors', 'on'), 'Detected', 'Clear') }}" icon: "{{ iif (this.state == 'Detected', 'mdi:motion-sensor', 'mdi:motion-sensor-off') }}" attributes: - motion_detected: "{{ expand(states.group.motion_sensors) | selectattr('state', 'in', ['detected', 'on']) | map(attribute='name') | list | replace('Motion Sensor ', '') }}" + motion_detected: "{{ expand(states.group.motion_sensors) | selectattr('state', 'in', ['detected', 'on']) | map(attribute='name') | list | replace('Motion Sensor ', '') | replace(' Occupancy', '')}}" # SENSOR - WEATHER - unique_id: weather_humidity name: 'Weather Humidity' diff --git a/config/themes/tablet.yaml b/config/themes/tablet.yaml index 8fcb881..e8c43ce 100644 --- a/config/themes/tablet.yaml +++ b/config/themes/tablet.yaml @@ -69,6 +69,8 @@ tablet: honeycomb-menu-icon-active-color: '#ffffffbd' honeycomb-menu-icon-color: '#FFFFFF80' + tablet-popup-content-padding: 1.4em 2.2em 1.6em 1.5em + # Swiper swiper-pagination-bottom: 8px swiper-pagination-bullet-height: 8px @@ -87,7 +89,16 @@ tablet: swiper-pagination-right: 8px swiper-pagination-top: auto swiper-theme-color: rgb(179, 179, 179) - tablet-popup-content-padding: 1.4em 2.2em 1.6em 1.5em + + swiper-scrollbar-border-radius: 10px + swiper-scrollbar-top: auto + swiper-scrollbar-bottom: 4px + swiper-scrollbar-left: auto + swiper-scrollbar-right: 4px + swiper-scrollbar-sides-offset: 1% + swiper-scrollbar-bg-color: rgba(0, 0, 0, 0.25) + swiper-scrollbar-drag-bg-color: rgb(179, 179, 179) + swiper-scrollbar-size: 4px card-mod-theme: tablet @@ -219,11 +230,12 @@ tablet: # CHIPS # # # ################################################# - grid-layout$hui-horizontal-stack-card:nth-child(2): + grid-layout$hui-horizontal-stack-card: $: | #root { flex-wrap: wrap; justify-content: space-between; + place-items: center; //margin-top: 0.5em; } @@ -259,7 +271,6 @@ tablet: grid-layout$history-explorer-card>ha-card: $: | h1 { - line-height: unset !important; } @@ -292,7 +303,7 @@ tablet: } .addon .card-content { - max-height: calc(100vh - 250px); + max-height: calc(calc(128px + 7px) * 5); overflow-y: auto; overflow-x: hidden; margin-top: 1rem !important; @@ -330,18 +341,19 @@ tablet: border-radius: 0.3em; overflow: hidden; } - @media screen and (min-width: 1700px) { - .type-custom-history-explorer-card > ha-card > h1.card-header { - padding: 0 !important; - line-height: unset !important; - } + + .type-custom-history-explorer-card div#graphlist { + padding: 0 !important; + } + + @media screen and (min-width: 1720px) { .type-custom-history-explorer-card div#graphlist { padding: 0 !important; display: flex; flex-direction: column; justify-content: space-between; height: 100%; - gap: 2rem !important; + gap: 1rem !important; } .type-custom-history-explorer-card div#graphlist > br { display: none !important; diff --git a/docs/README.md b/docs/README.md index 7c9fbc1..71c9cfe 100644 --- a/docs/README.md +++ b/docs/README.md @@ -37,13 +37,13 @@ https://github.com/ngocjohn/hass-config/assets/96962827/acc1a4db-b92e-4ab1-ac9d- - 34,023 - 32 - 163 + 34,946 + 34 + 164 63 - 53 + 54 32 - 1083 + 1063 215 38 @@ -62,6 +62,7 @@ https://github.com/ngocjohn/hass-config/assets/96962827/acc1a4db-b92e-4ab1-ac9d- - Advanced SSH & Web Terminal - ArgonOne Active Linear Cooling - Cloudflared +- DbStats - eufy-security-ws - Glances - go2rtc @@ -138,7 +139,6 @@ https://github.com/ngocjohn/hass-config/assets/96962827/acc1a4db-b92e-4ab1-ac9d- - [Mushroom](https://github.com/piitaya/lovelace-mushroom) - [Polr Ytube Media Card](https://github.com/pathofleastresistor/polr-ytube-media-card) - [Purifier Card](https://github.com/denysdovhan/purifier-card) -- [Restriction Card](https://github.com/iantrich/restriction-card) - [Rpi Monitor Card](https://github.com/ironsheep/lovelace-rpi-monitor-card) - [Simple Thermostat](https://github.com/nervetattoo/simple-thermostat) - [Slider Button Card](https://github.com/custom-cards/slider-button-card)