Add motion sensors from mqtt

This commit is contained in:
2020-06-10 20:10:36 +03:00
parent f1a8c1db78
commit 5ea6a19372
12 changed files with 114 additions and 68 deletions

View File

@@ -69,6 +69,10 @@ cards:
- automation.lighting_hallway_night_mode_motion_turn_lights_off
- type: divider
- automation.lighting_sync_tasmota_states_on_start_up
- type: divider
- automation.trust_remote_dimming
- automation.trust_remote_turn_on
- automation.trust_remote_turn_off
- type: entities
title: Media

View File

@@ -44,7 +44,9 @@ cards:
- type: custom:battery-entity
entity: sensor.front_door_battery
- type: custom:battery-entity
entity: sensor.living_room_right_window_power
entity: sensor.desk_switch_battery
# - type: custom:battery-entity
# entity: sensor.living_room_right_window_power
- type: divider
- type: custom:battery-entity
entity: sensor.bedroom_door_battery
@@ -59,25 +61,26 @@ cards:
entity: sensor.kitchen_window_battery
- type: custom:battery-entity
entity: sensor.kitchen_weather_battery
- type: custom:battery-entity
entity: sensor.kitchen_motion_battery
- type: divider
- type: custom:battery-entity
entity: sensor.bathroom_weather_battery
- type: custom:battery-entity
entity: sensor.hallway_weather_battery
- type: custom:battery-entity
entity: sensor.motion_1_power
- type: custom:battery-entity
entity: sensor.motion_2_power
entity: sensor.hallway_motion_battery
- type: entities
title: Aqara Devices
entities:
- type: custom:battery-entity
entity: sensor.desk_switch_battery
- type: custom:battery-entity
entity: sensor.master_bedroom_bedside_switch_power
- type: custom:battery-entity
entity: sensor.bathroom_switch_power
- type: custom:battery-entity
entity: sensor.cube_power
# - type: custom:battery-entity
# entity: sensor.master_bedroom_bedside_switch_power
# - type: custom:battery-entity
# entity: sensor.bathroom_switch_power
# - type: custom:battery-entity
# entity: sensor.cube_power
- type: vertical-stack
cards:
- type: entities
@@ -93,9 +96,11 @@ cards:
- type: divider
- sensor.kitchen_window_lqi
- sensor.kitchen_weather_lqi
- sensor.kitchen_motion_lqi
- type: divider
- sensor.bathroom_weather_lqi
- sensor.hallway_weather_lqi
- sensor.hallway_motion_lqi
- type: custom:vertical-stack-in-card
cards:
- type: entities

View File

@@ -133,7 +133,7 @@
- type: custom:decluttering-card
template: floorplan_state_icon
variables:
- entity: binary_sensor.motion_2_ias_zone
- entity: binary_sensor.hallway_motion_occupancy
- top: 34%
- left: 54%
- tap_action:

View File

@@ -46,7 +46,7 @@
template:
- default
- with_state_indicator
entity: binary_sensor.motion_2_ias_zone
entity: binary_sensor.hallway_motion_occupancy
name: Motion
variables:
state_indicator_id: automation.lighting_hallway_day_mode_motion_turn_lights_on
@@ -54,7 +54,7 @@
template:
- small
- progress
entity: sensor.motion_2_illuminance
entity: sensor.hallway_motion_illuminance
name: Lux
variables:
min_value: 0

View File

@@ -100,7 +100,7 @@
template:
- default
- with_state_indicator
entity: binary_sensor.motion_1_ias_zone
entity: binary_sensor.kitchen_motion_occupancy
name: Motion
variables:
state_indicator_id: automation.lighting_kitchen_day_mode_motion_turn_lights_on
@@ -108,7 +108,7 @@
template:
- small
- progress
entity: sensor.motion_1_illuminance
entity: sensor.kitchen_motion_illuminance
name: Lux
variables:
min_value: 0
@@ -118,7 +118,7 @@
template:
- default
- with_state_indicator
entity: binary_sensor.motion_2_ias_zone
entity: binary_sensor.hallway_motion_occupancy
name: Hallway
variables:
state_indicator_id: automation.lighting_hallway_day_mode_motion_turn_lights_on

View File

@@ -123,7 +123,7 @@
template:
- default
- with_state_indicator
entity: binary_sensor.motion_2_ias_zone
entity: binary_sensor.hallway_motion_occupancy
name: Hallway
variables:
state_indicator_id: automation.lighting_hallway_day_mode_motion_turn_lights_on

View File

@@ -215,7 +215,7 @@
template:
- default
- with_state_indicator
entity: binary_sensor.motion_1_ias_zone
entity: binary_sensor.kitchen_motion_occupancy
name: Kitchen
variables:
state_indicator_id: automation.lighting_kitchen_day_mode_motion_turn_lights_on
@@ -223,7 +223,7 @@
template:
- default
- with_state_indicator
entity: binary_sensor.motion_2_ias_zone
entity: binary_sensor.hallway_motion_occupancy
name: Hallway
variables:
state_indicator_id: automation.lighting_hallway_day_mode_motion_turn_lights_on

View File

@@ -11,7 +11,7 @@ binary_sensor.house_mode:
entities:
- input_select.house_mode
binary_sensor.motion_1_ias_zone:
binary_sensor.kitchen_motion_occupancy:
title: Kitchen motion
auto_close: true
style: &broad_popup_style
@@ -25,10 +25,9 @@ binary_sensor.motion_1_ias_zone:
cards:
- type: glance
entities:
- entity: binary_sensor.motion_1_ias_zone
- entity: sensor.motion_1_illuminance
- entity: binary_sensor.motion_1_occupancy
- entity: sensor.motion_1_power
- entity: binary_sensor.kitchen_motion_occupancy
- entity: sensor.kitchen_motion_illuminance
- entity: sensor.kitchen_motion_battery
- type: "custom:mini-graph-card"
animate: true
points_per_hour: 1
@@ -38,9 +37,9 @@ binary_sensor.motion_1_ias_zone:
average: true
extrema: true
entities:
- entity: sensor.motion_1_illuminance
- entity: sensor.kitchen_motion_illuminance
binary_sensor.motion_2_ias_zone:
binary_sensor.hallway_motion_occupancy:
title: Hallway motion
style: *broad_popup_style
auto_close: true
@@ -49,10 +48,9 @@ binary_sensor.motion_2_ias_zone:
cards:
- type: glance
entities:
- entity: binary_sensor.motion_2_ias_zone
- entity: sensor.motion_2_illuminance
- entity: binary_sensor.motion_2_occupancy
- entity: sensor.motion_2_power
- entity: binary_sensor.hallway_motion_occupancy
- entity: sensor.hallway_motion_illuminance
- entity: sensor.hallway_motion_battery
- type: "custom:mini-graph-card"
animate: true
@@ -63,7 +61,7 @@ binary_sensor.motion_2_ias_zone:
average: true
extrema: true
entities:
- entity: sensor.motion_2_illuminance
- entity: sensor.hallway_motion_illuminance
sensor.synology_type_volume_1:
title: Platinum

View File

@@ -2,7 +2,7 @@ automation:
- alias: Lighting · Hallway · Day mode · Motion · Turn lights on
trigger:
platform: state
entity_id: binary_sensor.motion_2_ias_zone
entity_id: binary_sensor.hallway_motion_occupancy
to: "on"
condition:
condition: state
@@ -15,7 +15,7 @@ automation:
- alias: Lighting · Hallway · Day mode · Motion · Turn lights off
trigger:
platform: state
entity_id: binary_sensor.motion_2_ias_zone
entity_id: binary_sensor.hallway_motion_occupancy
to: "off"
for:
minutes: 5
@@ -30,7 +30,7 @@ automation:
- alias: Lighting · Hallway · Night mode · Motion · Turn lights on
trigger:
platform: state
entity_id: binary_sensor.motion_2_ias_zone
entity_id: binary_sensor.hallway_motion_occupancy
to: "on"
condition:
condition: not
@@ -51,7 +51,7 @@ automation:
- alias: Lighting · Hallway · Night mode · Motion · Turn lights off
trigger:
platform: state
entity_id: binary_sensor.motion_2_ias_zone
entity_id: binary_sensor.hallway_motion_occupancy
to: "off"
for:
minutes: 5

View File

@@ -2,7 +2,7 @@ automation:
- alias: Lighting · Kitchen · Day mode · Motion · Turn lights on
trigger:
platform: state
entity_id: binary_sensor.motion_1_ias_zone
entity_id: binary_sensor.kitchen_motion_occupancy
to: "on"
condition:
condition: and
@@ -34,7 +34,7 @@ automation:
- alias: Lighting · Kitchen · Day mode · Motion · Turn lights off
trigger:
platform: state
entity_id: binary_sensor.motion_1_ias_zone
entity_id: binary_sensor.kitchen_motion_occupancy
to: "off"
for:
minutes: 30
@@ -53,7 +53,7 @@ automation:
- alias: Lighting · Kitchen · Night mode · Motion · Turn lights on
trigger:
platform: state
entity_id: binary_sensor.motion_1_ias_zone
entity_id: binary_sensor.kitchen_motion_occupancy
to: "on"
condition:
- condition: not
@@ -75,7 +75,7 @@ automation:
- alias: Lighting · Kitchen · Night mode · Motion · Turn lights off
trigger:
platform: state
entity_id: binary_sensor.motion_1_ias_zone
entity_id: binary_sensor.kitchen_motion_occupancy
to: "off"
for:
minutes: 5

View File

@@ -45,16 +45,16 @@ homekit:
- light.hallway_entrance
- light.hallway_main
- light.tuya_kitchen
- binary_sensor.motion_1_ias_zone
- binary_sensor.motion_2_ias_zone
- binary_sensor.kitchen_motion_occupancy
- binary_sensor.hallway_motion_occupany
- binary_sensor.trisensor_motion
- binary_sensor.multisensor_motion
- sensor.bedroom_weather_temperature
- sensor.living_room_thermostat_temperature
- sensor.trisensor_temperature
- sensor.multisensor_6_temperature
- sensor.motion_2_illuminance
- sensor.motion_1_illuminance
- sensor.hallway_motion_illuminance
- sensor.kitchen_motion_illuminance
- sensor.purifier_humidity
- sensor.bedroom_weather_humidity
- climate.living_room_thermostat_mode
@@ -66,12 +66,12 @@ homekit:
entity_config:
light.light_avatar_small_2:
name: PC
binary_sensor.motion_1_ias_zone:
linked_battery_sensor: sensor.motion_1_power
binary_sensor.kitchen_motion_occupancy:
linked_battery_sensor: sensor.kitchen_motion_battery
low_battery_threshold: 20
name: Kitchen Motion
binary_sensor.motion_2_ias_zone:
linked_battery_sensor: sensor.motion_2_power
binary_sensor.hallway_motion_occupany:
linked_battery_sensor: sensor.hallway_motion_battery
name: Hallway Motion
binary_sensor.trisensor_motion:
linked_battery_sensor: sensor.trisensor_battery_level

View File

@@ -1,23 +1,62 @@
#
# ─── CUSTOMIZATION ──────────────────────────────────────────────────────────────
#
binary_sensor:
- platform: mqtt
name: "Hallway motion occupancy"
state_topic: "zigbee2mqtt/hallway_motion"
availability_topic: "zigbee2mqtt/bridge/state"
payload_on: true
payload_off: false
value_template: "{{ value_json.occupancy }}"
device_class: "motion"
- platform: mqtt
name: "Kitchen motion occupancy"
state_topic: "zigbee2mqtt/kitchen_motion"
availability_topic: "zigbee2mqtt/bridge/state"
payload_on: true
payload_off: false
value_template: "{{ value_json.occupancy }}"
device_class: "motion"
homeassistant:
customize:
binary_sensor.motion_1_ias_zone:
friendly_name: Motion Sensor 1 ias zone
sensor.motion_1_illuminance:
friendly_name: Motion Sensor 1 Lux
binary_sensor.motion_1_occupancy:
friendly_name: Motion Sensor 1 Occupancy
sensor.motion_1_power:
friendly_name: Motion Sensor 1 Battery
sensor:
# Hallway Motion
- platform: mqtt
name: "Hallway motion illuminance"
state_topic: "zigbee2mqtt/hallway_motion"
availability_topic: "zigbee2mqtt/bridge/state"
device_class: "illuminance"
value_template: "{{ value_json.illuminance_lux }}"
- platform: mqtt
name: "Hallway motion battery"
state_topic: "zigbee2mqtt/hallway_motion"
availability_topic: "zigbee2mqtt/bridge/state"
unit_of_measurement: "%"
device_class: "battery"
value_template: "{{ value_json.battery }}"
- platform: mqtt
name: "Hallway motion LQI"
state_topic: "zigbee2mqtt/hallway_motion"
availability_topic: "zigbee2mqtt/bridge/state"
icon: "mdi:signal"
unit_of_measurement: "lqi"
value_template: "{{ value_json.linkquality }}"
binary_sensor.motion_2_ias_zone:
friendly_name: Motion Sensor 2 ias zone
sensor.motion_2_illuminance:
friendly_name: Motion Sensor 2 Lux
binary_sensor.motion_2_occupancy:
friendly_name: Motion Sensor 2 Occupancy
sensor.motion_2_power:
friendly_name: Motion Sensor 2 Battery
# Kitchen Motion
- platform: mqtt
name: "Kitchen motion illuminance"
state_topic: "zigbee2mqtt/kitchen_motion"
availability_topic: "zigbee2mqtt/bridge/state"
device_class: "illuminance"
value_template: "{{ value_json.illuminance_lux }}"
- platform: mqtt
name: "Kitchen motion battery"
state_topic: "zigbee2mqtt/kitchen_motion"
availability_topic: "zigbee2mqtt/bridge/state"
unit_of_measurement: "%"
device_class: "battery"
value_template: "{{ value_json.battery }}"
- platform: mqtt
name: "Kitchen motion LQI"
state_topic: "zigbee2mqtt/kitchen_motion"
availability_topic: "zigbee2mqtt/bridge/state"
icon: "mdi:signal"
unit_of_measurement: "lqi"
value_template: "{{ value_json.linkquality }}"