From 183e1e7a6676fbc87c0d3fa99ba71316b9d4928d Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Sun, 18 Dec 2022 14:28:18 +0200 Subject: [PATCH] Update dashboards --- advanced-lovelace.yaml | 1 - lovelace/advanced_dashboard/00_home.yaml | 22 ----- lovelace/advanced_dashboard/04_sensors.yaml | 69 --------------- lovelace/advanced_dashboard/12_test.yaml | 3 - .../stacked-weather.yaml | 83 +++++++++++++++++++ .../home_dashboard/bedroom_dashboard.yaml | 4 +- .../guest_bedroom_dashboard.yaml | 2 +- .../home_dashboard/preferences_dashboard.yaml | 2 +- lovelace/home_dashboard/world_dashboard.yaml | 62 ++++++++++++++ packages/modules/presence.yaml | 22 ++++- ui-lovelace.yaml | 13 ++- 11 files changed, 179 insertions(+), 104 deletions(-) delete mode 100644 lovelace/advanced_dashboard/04_sensors.yaml create mode 100644 lovelace/decluttering_templates/stacked-weather.yaml create mode 100644 lovelace/home_dashboard/world_dashboard.yaml diff --git a/advanced-lovelace.yaml b/advanced-lovelace.yaml index 49d4f64..8015bc1 100644 --- a/advanced-lovelace.yaml +++ b/advanced-lovelace.yaml @@ -6,7 +6,6 @@ views: - !include lovelace/advanced_dashboard/00_home.yaml - !include lovelace/advanced_dashboard/02_lights.yaml - !include lovelace/advanced_dashboard/03_climate.yaml - - !include lovelace/advanced_dashboard/04_sensors.yaml - !include lovelace/advanced_dashboard/08_automations.yaml - !include lovelace/advanced_dashboard/09_network.yaml - !include lovelace/advanced_dashboard/10_system.yaml diff --git a/lovelace/advanced_dashboard/00_home.yaml b/lovelace/advanced_dashboard/00_home.yaml index 87ba8b1..4854aba 100644 --- a/lovelace/advanced_dashboard/00_home.yaml +++ b/lovelace/advanced_dashboard/00_home.yaml @@ -40,25 +40,3 @@ cards: - entity: sensor.slack_user_stars icon: mdi:slack name: Slack User · Stars - - - type: "custom:weather-card" - current: true - details: true - entity: weather.dark_sky - forecast: true - - - type: vertical-stack - title: Quarantine - cards: - - type: entities - entities: - - type: custom:decluttering-card - template: percentage_card - variables: - - name: Percent - - entity: sensor.quarantined_percent - - icon: mdi:percent - - orange: 100 - - red: 100 - - entity: sensor.quarantine_times_left - name: Times left diff --git a/lovelace/advanced_dashboard/04_sensors.yaml b/lovelace/advanced_dashboard/04_sensors.yaml deleted file mode 100644 index acd15f0..0000000 --- a/lovelace/advanced_dashboard/04_sensors.yaml +++ /dev/null @@ -1,69 +0,0 @@ -title: Sensors -path: sensors -icon: mdi:motion-sensor -panel: true -cards: - - type: custom:mod-card - style: - layout-card: - $: - horizontal-layout: - $: - .: | - #columns { - margin: 0 20px; - grid-gap: 20px; - } - card: - type: custom:layout-card - layout_type: custom:horizontal-layout - layout: - max_cols: 3 - cards: - - type: vertical-stack - title: Sensors - cards: - - type: horizontal-stack - cards: - - type: custom:button-card - template: v3_button - entity: binary_sensor.multisensor_motion - name: Living room - - type: custom:button-card - template: [v3_button, with_state_indicator] - entity: binary_sensor.kitchen_motion_occupancy - name: Kitchen - variables: - state_indicator_id: automation.lighting_kitchen_motion_on - - type: custom:button-card - template: [v3_button, with_state_indicator] - entity: group.hallway_motion - name: Hallway - variables: - state_indicator_id: automation.lighting_hallway_motion_on - - type: horizontal-stack - cards: - - type: custom:button-card - template: v3_button - entity: binary_sensor.living_room_right_window_contact - name: Living room - - type: custom:button-card - template: v3_button - entity: binary_sensor.bedroom_left_window_contact - name: Bedroom left - - type: custom:button-card - template: v3_button - entity: binary_sensor.bedroom_right_window_contact - name: Bedroom right - - type: custom:button-card - template: v3_button - entity: binary_sensor.kitchen_window_contact - name: Kitchen - - type: horizontal-stack - cards: - - type: custom:button-card - template: v3_button - entity: binary_sensor.front_door_contact - - type: custom:button-card - template: v3_button - entity: binary_sensor.bedroom_door_contact diff --git a/lovelace/advanced_dashboard/12_test.yaml b/lovelace/advanced_dashboard/12_test.yaml index 4e95a47..654b48b 100644 --- a/lovelace/advanced_dashboard/12_test.yaml +++ b/lovelace/advanced_dashboard/12_test.yaml @@ -5,9 +5,6 @@ cards: entities: - input_boolean.purifier_turned_on_for_bad_air - binary_sensor.aqi_above_threshold - - type: divider - - sensor.carbon_activity - - sensor.carbon_last_update_trigger - type: custom:mini-graph-card hours_to_show: 168 diff --git a/lovelace/decluttering_templates/stacked-weather.yaml b/lovelace/decluttering_templates/stacked-weather.yaml new file mode 100644 index 0000000..496b418 --- /dev/null +++ b/lovelace/decluttering_templates/stacked-weather.yaml @@ -0,0 +1,83 @@ +stacked-weather: + card: + type: custom:stack-in-card + mode: vertical + keep: + background: true + card_mod: + style: | + ha-card { + margin-top: 16px; + } + cards: + - type: custom:simple-weather-card + entity: weather.dark_sky + backdrop: true + secondary_info: + - humidity + - wind_speed + - precipitation_probability + card_mod: + style: | + .weather__info:not(.weather__info--add) { + margin-left: 14px; + } + + - type: custom:air-visual-card + air_pollution_level: sensor.u_s_air_pollution_level + air_quality_index: sensor.u_s_air_quality_index + main_pollutant: sensor.u_s_main_pollutant + hide_title: true + hide_weather: true + country: Sofia + card_mod: + style: | + .grid-container { + grid-template-columns: 70px 30% auto; + grid-template-rows: 0 38px auto; + } + + .face { + border-top-left-radius: 0; + } + + .face img { + height: 40px; + } + + .country { + text-align: left; + padding-left: 16px; + } + + .aplSensor { + justify-content: end; + padding-right: 16px; + padding-top: 16px; + font-size: 1em; + border-top-right-radius: 0; + } + + .mainPollutantSensor { + padding: 0 0 16px 0; + } + + .mainPollutantSensorText { + width: auto; + padding: 0 16px; + margin-left: auto; + margin-right: 16px; + } + + .aqiSensor { + justify-content: start; + padding-left: 16px; + padding-top: 16px; + font-size: 1.5em; + height: auto; + } + + - type: markdown + content: >- + {% set forecast = states('sensor.dark_sky_hourly_summary') %} + It will be {{ forecast[0] | lower }}{{ forecast [1:] }} diff --git a/lovelace/home_dashboard/bedroom_dashboard.yaml b/lovelace/home_dashboard/bedroom_dashboard.yaml index ee6d98e..9145eb9 100644 --- a/lovelace/home_dashboard/bedroom_dashboard.yaml +++ b/lovelace/home_dashboard/bedroom_dashboard.yaml @@ -6,7 +6,7 @@ - type: custom:decluttering-card template: coloured-vertical-stack variables: - - color: "#9489d1" + - color: "#786fa7" - cards: - type: custom:decluttering-card template: v3_title @@ -110,7 +110,7 @@ - type: custom:decluttering-card template: coloured-vertical-stack variables: - - color: "#9489d1" + - color: "#786fa7" - cards: - type: custom:decluttering-card template: v3_section_title diff --git a/lovelace/home_dashboard/guest_bedroom_dashboard.yaml b/lovelace/home_dashboard/guest_bedroom_dashboard.yaml index edbd9f2..2a31396 100644 --- a/lovelace/home_dashboard/guest_bedroom_dashboard.yaml +++ b/lovelace/home_dashboard/guest_bedroom_dashboard.yaml @@ -6,7 +6,7 @@ - type: custom:decluttering-card template: coloured-vertical-stack variables: - - color: "#0040A0" + - color: "#39445a" - cards: - type: custom:decluttering-card template: v3_title diff --git a/lovelace/home_dashboard/preferences_dashboard.yaml b/lovelace/home_dashboard/preferences_dashboard.yaml index d25551e..51c4d5e 100644 --- a/lovelace/home_dashboard/preferences_dashboard.yaml +++ b/lovelace/home_dashboard/preferences_dashboard.yaml @@ -6,7 +6,7 @@ - type: custom:decluttering-card template: coloured-vertical-stack variables: - - color: "#6A737A" + - color: "#404040" - cards: - type: custom:decluttering-card template: v3_title diff --git a/lovelace/home_dashboard/world_dashboard.yaml b/lovelace/home_dashboard/world_dashboard.yaml new file mode 100644 index 0000000..af4a58f --- /dev/null +++ b/lovelace/home_dashboard/world_dashboard.yaml @@ -0,0 +1,62 @@ +- type: custom:layout-card + layout_type: custom:horizontal-layout + layout: + max_cols: 2 + cards: + - type: custom:decluttering-card + template: coloured-vertical-stack + variables: + - color: "#38593a" + - cards: + - type: custom:decluttering-card + template: v3_title + variables: + - title: 🌍 Outside world + + - type: custom:decluttering-card + template: stacked-weather + + - type: "custom:weather-card" + current: true + details: true + entity: weather.dark_sky + forecast: true + + - type: custom:sun-card + darkMode: true + + + - type: custom:decluttering-card + template: coloured-vertical-stack + variables: + - color: "#38593a" + - cards: + - type: custom:decluttering-card + template: v3_section_title + variables: + - title: Home stats + - type: entities + entities: + - type: custom:decluttering-card + template: percentage_card + variables: + - name: Georgi home + - entity: sensor.georgi_home_percent + - icon: mdi:percent + - orange: 100 + - red: 100 + - entity: sensor.georgi_times_left + name: Georgi times left + - type: custom:decluttering-card + template: percentage_card + variables: + - name: Maya home + - entity: sensor.maya_home_percent + - icon: mdi:percent + - orange: 100 + - red: 100 + - entity: sensor.maya_times_left + name: Maya times left + + + - !include ../popup_cards.yaml diff --git a/packages/modules/presence.yaml b/packages/modules/presence.yaml index 6c41b98..fa293ec 100644 --- a/packages/modules/presence.yaml +++ b/packages/modules/presence.yaml @@ -53,7 +53,7 @@ binary_sensor: sensor: - platform: history_stats - name: Quarantined percent + name: Georgi home percent entity_id: device_tracker.arsenic state: "home" type: ratio @@ -62,7 +62,7 @@ sensor: end: "{{ now() }}" - platform: history_stats - name: Quarantine times left + name: Georgi times left entity_id: device_tracker.arsenic state: "home" type: count @@ -70,6 +70,24 @@ sensor: days: 7 end: "{{ now() }}" + - platform: history_stats + name: Maya home percent + entity_id: device_tracker.maya_phone_1 + state: "home" + type: ratio + duration: + days: 7 + end: "{{ now() }}" + + - platform: history_stats + name: Maya times left + entity_id: device_tracker.maya_phone_1 + state: "home" + type: count + duration: + days: 7 + end: "{{ now() }}" + automation: - alias: Presence · Georgi Arrival detection diff --git a/ui-lovelace.yaml b/ui-lovelace.yaml index 2107ef8..b9f2746 100644 --- a/ui-lovelace.yaml +++ b/ui-lovelace.yaml @@ -10,6 +10,13 @@ kiosk_mode: title: Home views: + - title: World + path: world_view + icon: "mdi:earth" + panel: true + background: '#38593a' + cards: !include lovelace/home_dashboard/world_dashboard.yaml + theme: sarah-noctis-grey - title: Living Room path: default_view icon: "mdi:sofa" @@ -21,7 +28,7 @@ views: path: bedroom icon: "mdi:bed-empty" panel: true - background: '#9489d1' + background: '#786fa7' cards: !include lovelace/home_dashboard/bedroom_dashboard.yaml theme: sarah-noctis-grey - title: Kitchen @@ -56,13 +63,13 @@ views: path: guest_bedroom icon: "mdi:numeric-2-box-outline" panel: true - background: '#0040A0' + background: '#39445a' cards: !include lovelace/home_dashboard/guest_bedroom_dashboard.yaml theme: sarah-noctis-grey - title: Preferences path: Preferences icon: "mdi:cogs" panel: true - background: '#8aaec3' + background: '#404040' cards: !include lovelace/home_dashboard/preferences_dashboard.yaml theme: sarah-noctis-grey