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
@@ -69,6 +69,10 @@ cards:
- automation.lighting_hallway_night_mode_motion_turn_lights_off - automation.lighting_hallway_night_mode_motion_turn_lights_off
- type: divider - type: divider
- automation.lighting_sync_tasmota_states_on_start_up - 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 - type: entities
title: Media title: Media
@@ -44,7 +44,9 @@ cards:
- type: custom:battery-entity - type: custom:battery-entity
entity: sensor.front_door_battery entity: sensor.front_door_battery
- type: custom:battery-entity - 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: divider
- type: custom:battery-entity - type: custom:battery-entity
entity: sensor.bedroom_door_battery entity: sensor.bedroom_door_battery
@@ -59,25 +61,26 @@ cards:
entity: sensor.kitchen_window_battery entity: sensor.kitchen_window_battery
- type: custom:battery-entity - type: custom:battery-entity
entity: sensor.kitchen_weather_battery entity: sensor.kitchen_weather_battery
- type: custom:battery-entity
entity: sensor.kitchen_motion_battery
- type: divider
- type: custom:battery-entity - type: custom:battery-entity
entity: sensor.bathroom_weather_battery entity: sensor.bathroom_weather_battery
- type: custom:battery-entity - type: custom:battery-entity
entity: sensor.hallway_weather_battery entity: sensor.hallway_weather_battery
- type: custom:battery-entity - type: custom:battery-entity
entity: sensor.motion_1_power entity: sensor.hallway_motion_battery
- type: custom:battery-entity
entity: sensor.motion_2_power
- type: entities - type: entities
title: Aqara Devices title: Aqara Devices
entities: entities:
- type: custom:battery-entity - type: custom:battery-entity
entity: sensor.desk_switch_battery entity: sensor.desk_switch_battery
- type: custom:battery-entity # - type: custom:battery-entity
entity: sensor.master_bedroom_bedside_switch_power # entity: sensor.master_bedroom_bedside_switch_power
- type: custom:battery-entity # - type: custom:battery-entity
entity: sensor.bathroom_switch_power # entity: sensor.bathroom_switch_power
- type: custom:battery-entity # - type: custom:battery-entity
entity: sensor.cube_power # entity: sensor.cube_power
- type: vertical-stack - type: vertical-stack
cards: cards:
- type: entities - type: entities
@@ -93,9 +96,11 @@ cards:
- type: divider - type: divider
- sensor.kitchen_window_lqi - sensor.kitchen_window_lqi
- sensor.kitchen_weather_lqi - sensor.kitchen_weather_lqi
- sensor.kitchen_motion_lqi
- type: divider - type: divider
- sensor.bathroom_weather_lqi - sensor.bathroom_weather_lqi
- sensor.hallway_weather_lqi - sensor.hallway_weather_lqi
- sensor.hallway_motion_lqi
- type: custom:vertical-stack-in-card - type: custom:vertical-stack-in-card
cards: cards:
- type: entities - type: entities
@@ -133,7 +133,7 @@
- type: custom:decluttering-card - type: custom:decluttering-card
template: floorplan_state_icon template: floorplan_state_icon
variables: variables:
- entity: binary_sensor.motion_2_ias_zone - entity: binary_sensor.hallway_motion_occupancy
- top: 34% - top: 34%
- left: 54% - left: 54%
- tap_action: - tap_action:
@@ -46,7 +46,7 @@
template: template:
- default - default
- with_state_indicator - with_state_indicator
entity: binary_sensor.motion_2_ias_zone entity: binary_sensor.hallway_motion_occupancy
name: Motion name: Motion
variables: variables:
state_indicator_id: automation.lighting_hallway_day_mode_motion_turn_lights_on state_indicator_id: automation.lighting_hallway_day_mode_motion_turn_lights_on
@@ -54,7 +54,7 @@
template: template:
- small - small
- progress - progress
entity: sensor.motion_2_illuminance entity: sensor.hallway_motion_illuminance
name: Lux name: Lux
variables: variables:
min_value: 0 min_value: 0
@@ -100,7 +100,7 @@
template: template:
- default - default
- with_state_indicator - with_state_indicator
entity: binary_sensor.motion_1_ias_zone entity: binary_sensor.kitchen_motion_occupancy
name: Motion name: Motion
variables: variables:
state_indicator_id: automation.lighting_kitchen_day_mode_motion_turn_lights_on state_indicator_id: automation.lighting_kitchen_day_mode_motion_turn_lights_on
@@ -108,7 +108,7 @@
template: template:
- small - small
- progress - progress
entity: sensor.motion_1_illuminance entity: sensor.kitchen_motion_illuminance
name: Lux name: Lux
variables: variables:
min_value: 0 min_value: 0
@@ -118,7 +118,7 @@
template: template:
- default - default
- with_state_indicator - with_state_indicator
entity: binary_sensor.motion_2_ias_zone entity: binary_sensor.hallway_motion_occupancy
name: Hallway name: Hallway
variables: variables:
state_indicator_id: automation.lighting_hallway_day_mode_motion_turn_lights_on state_indicator_id: automation.lighting_hallway_day_mode_motion_turn_lights_on
@@ -123,7 +123,7 @@
template: template:
- default - default
- with_state_indicator - with_state_indicator
entity: binary_sensor.motion_2_ias_zone entity: binary_sensor.hallway_motion_occupancy
name: Hallway name: Hallway
variables: variables:
state_indicator_id: automation.lighting_hallway_day_mode_motion_turn_lights_on state_indicator_id: automation.lighting_hallway_day_mode_motion_turn_lights_on
@@ -215,7 +215,7 @@
template: template:
- default - default
- with_state_indicator - with_state_indicator
entity: binary_sensor.motion_1_ias_zone entity: binary_sensor.kitchen_motion_occupancy
name: Kitchen name: Kitchen
variables: variables:
state_indicator_id: automation.lighting_kitchen_day_mode_motion_turn_lights_on state_indicator_id: automation.lighting_kitchen_day_mode_motion_turn_lights_on
@@ -223,7 +223,7 @@
template: template:
- default - default
- with_state_indicator - with_state_indicator
entity: binary_sensor.motion_2_ias_zone entity: binary_sensor.hallway_motion_occupancy
name: Hallway name: Hallway
variables: variables:
state_indicator_id: automation.lighting_hallway_day_mode_motion_turn_lights_on state_indicator_id: automation.lighting_hallway_day_mode_motion_turn_lights_on
+10 -12
View File
@@ -11,7 +11,7 @@ binary_sensor.house_mode:
entities: entities:
- input_select.house_mode - input_select.house_mode
binary_sensor.motion_1_ias_zone: binary_sensor.kitchen_motion_occupancy:
title: Kitchen motion title: Kitchen motion
auto_close: true auto_close: true
style: &broad_popup_style style: &broad_popup_style
@@ -25,10 +25,9 @@ binary_sensor.motion_1_ias_zone:
cards: cards:
- type: glance - type: glance
entities: entities:
- entity: binary_sensor.motion_1_ias_zone - entity: binary_sensor.kitchen_motion_occupancy
- entity: sensor.motion_1_illuminance - entity: sensor.kitchen_motion_illuminance
- entity: binary_sensor.motion_1_occupancy - entity: sensor.kitchen_motion_battery
- entity: sensor.motion_1_power
- type: "custom:mini-graph-card" - type: "custom:mini-graph-card"
animate: true animate: true
points_per_hour: 1 points_per_hour: 1
@@ -38,9 +37,9 @@ binary_sensor.motion_1_ias_zone:
average: true average: true
extrema: true extrema: true
entities: 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 title: Hallway motion
style: *broad_popup_style style: *broad_popup_style
auto_close: true auto_close: true
@@ -49,10 +48,9 @@ binary_sensor.motion_2_ias_zone:
cards: cards:
- type: glance - type: glance
entities: entities:
- entity: binary_sensor.motion_2_ias_zone - entity: binary_sensor.hallway_motion_occupancy
- entity: sensor.motion_2_illuminance - entity: sensor.hallway_motion_illuminance
- entity: binary_sensor.motion_2_occupancy - entity: sensor.hallway_motion_battery
- entity: sensor.motion_2_power
- type: "custom:mini-graph-card" - type: "custom:mini-graph-card"
animate: true animate: true
@@ -63,7 +61,7 @@ binary_sensor.motion_2_ias_zone:
average: true average: true
extrema: true extrema: true
entities: entities:
- entity: sensor.motion_2_illuminance - entity: sensor.hallway_motion_illuminance
sensor.synology_type_volume_1: sensor.synology_type_volume_1:
title: Platinum title: Platinum
@@ -2,7 +2,7 @@ automation:
- alias: Lighting · Hallway · Day mode · Motion · Turn lights on - alias: Lighting · Hallway · Day mode · Motion · Turn lights on
trigger: trigger:
platform: state platform: state
entity_id: binary_sensor.motion_2_ias_zone entity_id: binary_sensor.hallway_motion_occupancy
to: "on" to: "on"
condition: condition:
condition: state condition: state
@@ -15,7 +15,7 @@ automation:
- alias: Lighting · Hallway · Day mode · Motion · Turn lights off - alias: Lighting · Hallway · Day mode · Motion · Turn lights off
trigger: trigger:
platform: state platform: state
entity_id: binary_sensor.motion_2_ias_zone entity_id: binary_sensor.hallway_motion_occupancy
to: "off" to: "off"
for: for:
minutes: 5 minutes: 5
@@ -30,7 +30,7 @@ automation:
- alias: Lighting · Hallway · Night mode · Motion · Turn lights on - alias: Lighting · Hallway · Night mode · Motion · Turn lights on
trigger: trigger:
platform: state platform: state
entity_id: binary_sensor.motion_2_ias_zone entity_id: binary_sensor.hallway_motion_occupancy
to: "on" to: "on"
condition: condition:
condition: not condition: not
@@ -51,7 +51,7 @@ automation:
- alias: Lighting · Hallway · Night mode · Motion · Turn lights off - alias: Lighting · Hallway · Night mode · Motion · Turn lights off
trigger: trigger:
platform: state platform: state
entity_id: binary_sensor.motion_2_ias_zone entity_id: binary_sensor.hallway_motion_occupancy
to: "off" to: "off"
for: for:
minutes: 5 minutes: 5
@@ -2,7 +2,7 @@ automation:
- alias: Lighting · Kitchen · Day mode · Motion · Turn lights on - alias: Lighting · Kitchen · Day mode · Motion · Turn lights on
trigger: trigger:
platform: state platform: state
entity_id: binary_sensor.motion_1_ias_zone entity_id: binary_sensor.kitchen_motion_occupancy
to: "on" to: "on"
condition: condition:
condition: and condition: and
@@ -34,7 +34,7 @@ automation:
- alias: Lighting · Kitchen · Day mode · Motion · Turn lights off - alias: Lighting · Kitchen · Day mode · Motion · Turn lights off
trigger: trigger:
platform: state platform: state
entity_id: binary_sensor.motion_1_ias_zone entity_id: binary_sensor.kitchen_motion_occupancy
to: "off" to: "off"
for: for:
minutes: 30 minutes: 30
@@ -53,7 +53,7 @@ automation:
- alias: Lighting · Kitchen · Night mode · Motion · Turn lights on - alias: Lighting · Kitchen · Night mode · Motion · Turn lights on
trigger: trigger:
platform: state platform: state
entity_id: binary_sensor.motion_1_ias_zone entity_id: binary_sensor.kitchen_motion_occupancy
to: "on" to: "on"
condition: condition:
- condition: not - condition: not
@@ -75,7 +75,7 @@ automation:
- alias: Lighting · Kitchen · Night mode · Motion · Turn lights off - alias: Lighting · Kitchen · Night mode · Motion · Turn lights off
trigger: trigger:
platform: state platform: state
entity_id: binary_sensor.motion_1_ias_zone entity_id: binary_sensor.kitchen_motion_occupancy
to: "off" to: "off"
for: for:
minutes: 5 minutes: 5
+8 -8
View File
@@ -45,16 +45,16 @@ homekit:
- light.hallway_entrance - light.hallway_entrance
- light.hallway_main - light.hallway_main
- light.tuya_kitchen - light.tuya_kitchen
- binary_sensor.motion_1_ias_zone - binary_sensor.kitchen_motion_occupancy
- binary_sensor.motion_2_ias_zone - binary_sensor.hallway_motion_occupany
- binary_sensor.trisensor_motion - binary_sensor.trisensor_motion
- binary_sensor.multisensor_motion - binary_sensor.multisensor_motion
- sensor.bedroom_weather_temperature - sensor.bedroom_weather_temperature
- sensor.living_room_thermostat_temperature - sensor.living_room_thermostat_temperature
- sensor.trisensor_temperature - sensor.trisensor_temperature
- sensor.multisensor_6_temperature - sensor.multisensor_6_temperature
- sensor.motion_2_illuminance - sensor.hallway_motion_illuminance
- sensor.motion_1_illuminance - sensor.kitchen_motion_illuminance
- sensor.purifier_humidity - sensor.purifier_humidity
- sensor.bedroom_weather_humidity - sensor.bedroom_weather_humidity
- climate.living_room_thermostat_mode - climate.living_room_thermostat_mode
@@ -66,12 +66,12 @@ homekit:
entity_config: entity_config:
light.light_avatar_small_2: light.light_avatar_small_2:
name: PC name: PC
binary_sensor.motion_1_ias_zone: binary_sensor.kitchen_motion_occupancy:
linked_battery_sensor: sensor.motion_1_power linked_battery_sensor: sensor.kitchen_motion_battery
low_battery_threshold: 20 low_battery_threshold: 20
name: Kitchen Motion name: Kitchen Motion
binary_sensor.motion_2_ias_zone: binary_sensor.hallway_motion_occupany:
linked_battery_sensor: sensor.motion_2_power linked_battery_sensor: sensor.hallway_motion_battery
name: Hallway Motion name: Hallway Motion
binary_sensor.trisensor_motion: binary_sensor.trisensor_motion:
linked_battery_sensor: sensor.trisensor_battery_level linked_battery_sensor: sensor.trisensor_battery_level
+60 -21
View File
@@ -1,23 +1,62 @@
# binary_sensor:
# ─── CUSTOMIZATION ────────────────────────────────────────────────────────────── - 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: sensor:
customize: # Hallway Motion
binary_sensor.motion_1_ias_zone: - platform: mqtt
friendly_name: Motion Sensor 1 ias zone name: "Hallway motion illuminance"
sensor.motion_1_illuminance: state_topic: "zigbee2mqtt/hallway_motion"
friendly_name: Motion Sensor 1 Lux availability_topic: "zigbee2mqtt/bridge/state"
binary_sensor.motion_1_occupancy: device_class: "illuminance"
friendly_name: Motion Sensor 1 Occupancy value_template: "{{ value_json.illuminance_lux }}"
sensor.motion_1_power: - platform: mqtt
friendly_name: Motion Sensor 1 Battery 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: # Kitchen Motion
friendly_name: Motion Sensor 2 ias zone - platform: mqtt
sensor.motion_2_illuminance: name: "Kitchen motion illuminance"
friendly_name: Motion Sensor 2 Lux state_topic: "zigbee2mqtt/kitchen_motion"
binary_sensor.motion_2_occupancy: availability_topic: "zigbee2mqtt/bridge/state"
friendly_name: Motion Sensor 2 Occupancy device_class: "illuminance"
sensor.motion_2_power: value_template: "{{ value_json.illuminance_lux }}"
friendly_name: Motion Sensor 2 Battery - 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 }}"