From 28b3dda4d9222ce887b79dabf33611475da413db Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Sat, 11 Jun 2022 16:46:22 +0300 Subject: [PATCH] Fix motion sensor dashboards --- .../hallway_dashboard/at_home_dashboard.yaml | 14 ++++---------- .../hallway_dashboard/coming_home_dashboard.yaml | 6 ++++-- .../hallway_dashboard/leaving_home_dashboard.yaml | 14 ++++---------- config/lovelace/popup_cards.yaml | 4 ++-- config/packages/sensors/motion.yaml | 2 +- 5 files changed, 15 insertions(+), 25 deletions(-) diff --git a/config/lovelace/hallway_dashboard/at_home_dashboard.yaml b/config/lovelace/hallway_dashboard/at_home_dashboard.yaml index 71a6c21..8a390f3 100644 --- a/config/lovelace/hallway_dashboard/at_home_dashboard.yaml +++ b/config/lovelace/hallway_dashboard/at_home_dashboard.yaml @@ -47,19 +47,13 @@ card: entity: sensor.average_humidity - type: custom:button-card template: v3_badge_icon - entity: sensor.active_motion_sensors + entity: group.all_motion_sensors icon: | [[[ - return entity.state === 0 ? 'mdi:motion-sensor-off' : 'mdi:motion-sensor'; + return entity.state === 'off' ? 'mdi:motion-sensor-off' : 'mdi:motion-sensor'; ]]] - state: - - value: 0 - operator: '!=' - styles: - card: - - background-color: 'white' - icon: - - color: var(--primary-color) + tap_action: + action: more-info - type: custom:button-card template: v3_badge_icon entity: sensor.open_window_count diff --git a/config/lovelace/hallway_dashboard/coming_home_dashboard.yaml b/config/lovelace/hallway_dashboard/coming_home_dashboard.yaml index b1eb16b..f125a88 100644 --- a/config/lovelace/hallway_dashboard/coming_home_dashboard.yaml +++ b/config/lovelace/hallway_dashboard/coming_home_dashboard.yaml @@ -54,11 +54,13 @@ card: entity: sensor.average_humidity - type: custom:button-card template: v3_badge_icon - entity: sensor.active_motion_sensors + entity: group.all_motion_sensors icon: | [[[ - return entity.state === 0 ? 'mdi:motion-sensor-off' : 'mdi:motion-sensor'; + return entity.state === 'off' ? 'mdi:motion-sensor-off' : 'mdi:motion-sensor'; ]]] + tap_action: + action: more-info state: - value: 0 operator: '!=' diff --git a/config/lovelace/hallway_dashboard/leaving_home_dashboard.yaml b/config/lovelace/hallway_dashboard/leaving_home_dashboard.yaml index c3919a1..b66deb8 100644 --- a/config/lovelace/hallway_dashboard/leaving_home_dashboard.yaml +++ b/config/lovelace/hallway_dashboard/leaving_home_dashboard.yaml @@ -34,19 +34,11 @@ card: - background-image: url("/local/images/people/maya.jpg") - type: custom:button-card template: v3_badge_icon - entity: sensor.active_motion_sensors + entity: group.all_motion_sensors icon: | [[[ - return entity.state === 0 ? 'mdi:motion-sensor-off' : 'mdi:motion-sensor'; + return entity.state === 'off' ? 'mdi:motion-sensor-off' : 'mdi:motion-sensor'; ]]] - state: - - value: 0 - operator: '!=' - styles: - card: - - background-color: 'white' - icon: - - color: var(--primary-color) - type: custom:button-card template: v3_badge_icon entity: sensor.open_window_count @@ -54,6 +46,8 @@ card: [[[ return entity.state === 0 ? 'mdi:window-closed' : 'mdi:window-open'; ]]] + tap_action: + action: more-info state: - value: 0 operator: '!=' diff --git a/config/lovelace/popup_cards.yaml b/config/lovelace/popup_cards.yaml index 7ebf5f7..53679db 100644 --- a/config/lovelace/popup_cards.yaml +++ b/config/lovelace/popup_cards.yaml @@ -162,7 +162,7 @@ media_player.nvidia_shield: &nvidia_shield media_player.living_room_tv: *nvidia_shield -sensor.active_motion_sensors: +group.all_motion_sensors: title: Active motion sensors card: type: vertical-stack @@ -178,7 +178,7 @@ sensor.active_motion_sensors: - margin-left: 8px - type: custom:button-card template: [v3_button, v3_popup_button] - entity: binary_sensor.trisensor_home_security_motion_detection + entity: binary_sensor.hallway_motion_2_occupancy name: Hallway - type: custom:button-card template: [v3_button, v3_popup_button] diff --git a/config/packages/sensors/motion.yaml b/config/packages/sensors/motion.yaml index 393881b..65e925b 100644 --- a/config/packages/sensors/motion.yaml +++ b/config/packages/sensors/motion.yaml @@ -3,9 +3,9 @@ group: name: All motion_sensors entities: - binary_sensor.hallway_motion_occupancy + - binary_sensor.hallway_motion_2_occupancy - binary_sensor.kitchen_motion_occupancy - binary_sensor.multisensor_motion - - binary_sensor.trisensor_home_security_motion_detection hallway_motion: name: Hallway Motion