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
@@ -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
@@ -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
+8 -8
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
+60 -21
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 }}"