From 2971f64d22fcb20e16ef5796d734f35d67866050 Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Tue, 31 May 2022 13:18:09 +0300 Subject: [PATCH] Add hallway_motion_2 --- .../advanced_dashboard/10_system.yaml | 3 ++ .../home_dashboard/hallway_dashboard.yaml | 2 +- config/lovelace/popup_cards.yaml | 1 + config/packages/modules/batteries.yaml | 1 + .../modules/lighting/areas/hallway.yaml | 4 +-- config/packages/sensors/motion.yaml | 33 ++++++++++++++++++- 6 files changed, 40 insertions(+), 4 deletions(-) diff --git a/config/lovelace/advanced_dashboard/10_system.yaml b/config/lovelace/advanced_dashboard/10_system.yaml index d152fe2..ce428f4 100644 --- a/config/lovelace/advanced_dashboard/10_system.yaml +++ b/config/lovelace/advanced_dashboard/10_system.yaml @@ -74,6 +74,8 @@ cards: entity: sensor.hallway_weather_battery - type: custom:battery-entity-row entity: sensor.hallway_motion_battery + - type: custom:battery-entity-row + entity: sensor.hallway_motion_2_battery - type: custom:battery-entity-row entity: sensor.guest_bedroom_weather_battery - type: custom:battery-entity-row @@ -124,6 +126,7 @@ cards: - sensor.front_door_lqi - sensor.hallway_weather_lqi - sensor.hallway_motion_lqi + - sensor.hallway_motion_2_lqi - type: divider - sensor.guest_bedroom_weather_lqi - sensor.router_1_lqi diff --git a/config/lovelace/home_dashboard/hallway_dashboard.yaml b/config/lovelace/home_dashboard/hallway_dashboard.yaml index 08b354c..ddc80c4 100644 --- a/config/lovelace/home_dashboard/hallway_dashboard.yaml +++ b/config/lovelace/home_dashboard/hallway_dashboard.yaml @@ -42,7 +42,7 @@ entity: binary_sensor.hallway_motion_occupancy - type: custom:button-card template: v3_badge_icon - entity: binary_sensor.trisensor_home_security_motion_detection + entity: binary_sensor.hallway_motion_2_occupancy - type: custom:button-card template: v3_badge_icon entity: binary_sensor.front_door diff --git a/config/lovelace/popup_cards.yaml b/config/lovelace/popup_cards.yaml index f122da8..7ebf5f7 100644 --- a/config/lovelace/popup_cards.yaml +++ b/config/lovelace/popup_cards.yaml @@ -34,6 +34,7 @@ group.hallway_motion: - type: glance entities: - entity: binary_sensor.hallway_motion_occupancy + - entity: binary_sensor.hallway_motion_2_occupancy - entity: sensor.hallway_motion_illuminance - entity: sensor.hallway_motion_battery diff --git a/config/packages/modules/batteries.yaml b/config/packages/modules/batteries.yaml index f980de6..49977cb 100644 --- a/config/packages/modules/batteries.yaml +++ b/config/packages/modules/batteries.yaml @@ -32,6 +32,7 @@ automation: - sensor.hallway_weather_battery - sensor.hallway_motion_battery + - sensor.hallway_motion_2_battery - sensor.guest_bedroom_weather_battery - sensor.terrarium_weather_battery diff --git a/config/packages/modules/lighting/areas/hallway.yaml b/config/packages/modules/lighting/areas/hallway.yaml index db95fe9..2983e93 100644 --- a/config/packages/modules/lighting/areas/hallway.yaml +++ b/config/packages/modules/lighting/areas/hallway.yaml @@ -2,7 +2,7 @@ automation: - alias: Lighting · Hallway · Motion On trigger: platform: state - entity_id: binary_sensor.hallway_motion_occupancy + entity_id: group.hallway_motion to: "on" condition: condition: state @@ -35,7 +35,7 @@ automation: - alias: Lighting · Hallway · Motion Off trigger: platform: state - entity_id: binary_sensor.hallway_motion_occupancy + entity_id: group.hallway_motion to: "off" for: "00:01:00" action: diff --git a/config/packages/sensors/motion.yaml b/config/packages/sensors/motion.yaml index 6123021..4538b2a 100644 --- a/config/packages/sensors/motion.yaml +++ b/config/packages/sensors/motion.yaml @@ -11,7 +11,8 @@ group: name: Hallway Motion entities: - binary_sensor.hallway_motion_occupancy - - binary_sensor.trisensor_home_security_motion_detection + - binary_sensor.hallway_motion_2_occupancy + # - binary_sensor.trisensor_home_security_motion_detection binary_sensor: - platform: mqtt @@ -22,6 +23,14 @@ binary_sensor: payload_off: false value_template: "{{ value_json.occupancy }}" device_class: "motion" + - platform: mqtt + name: "Hallway motion 2 occupancy" + state_topic: "z2m_deconz/hallway_motion_2" + availability_topic: "z2m_deconz/bridge/state" + payload_on: true + payload_off: false + value_template: "{{ value_json.occupancy }}" + device_class: "motion" - platform: mqtt name: "Kitchen motion occupancy" state_topic: "z2m_deconz/kitchen_motion" @@ -54,6 +63,28 @@ sensor: device_class: "signal_strength" value_template: "{{ value_json.linkquality }}" + # Hallway Motion 2 + - platform: mqtt + name: "Hallway motion 2 illuminance" + state_topic: "z2m_deconz/hallway_motion_2" + availability_topic: "z2m_deconz/bridge/state" + device_class: "illuminance" + value_template: "{{ value_json.illuminance_lux }}" + - platform: mqtt + name: "Hallway motion 2 battery" + state_topic: "z2m_deconz/hallway_motion_2" + availability_topic: "z2m_deconz/bridge/state" + unit_of_measurement: "%" + device_class: "battery" + value_template: "{{ value_json.battery }}" + - platform: mqtt + name: "Hallway motion 2 LQI" + state_topic: "z2m_deconz/hallway_motion_2" + availability_topic: "z2m_deconz/bridge/state" + unit_of_measurement: "lqi" + device_class: "signal_strength" + value_template: "{{ value_json.linkquality }}" + # Kitchen Motion - platform: mqtt name: "Kitchen motion illuminance"