Refactor motion tracker configuration and add presence detection module

This commit is contained in:
2026-05-13 19:51:13 +02:00
parent 60224f0459
commit f163b9eede
2 changed files with 50 additions and 33 deletions

View File

@@ -5,54 +5,35 @@ debugger:
port: 5678 port: 5678
wait_for_client: false # set to true when you need to debug initialize() wait_for_client: false # set to true when you need to debug initialize()
motion_tracker:
module: motiontracker
class: MotionTracker
priority: 5 # this need to be initialized before app using motion tracker
max_time: 30
areas:
corridor:
motion_sensors: binary_sensor.corridor_motion
hallway:
motion_sensors: binary_sensor.hallway_motion
restroom:
motion_sensors: binary_sensor.restroom_motion
garage:
motion_sensors: binary_sensor.garage_motion
kitchen:
motion_sensors: binary_sensor.kitchen_motion
mezzanine:
motion_sensors: binary_sensor.mezzanine_motion
informations_collector: informations_collector:
module: informationscollector module: informationscollector
class: InformationsCollector class: InformationsCollector
priority: 1 priority: 1
#mute: True mute: True
error_collector: error_collector:
reset_error_count_button: input_button.reset_error_count reset_error_count_button: input_button.reset_error_count
output_sensor: sensor.ad_errors output_sensor: sensor.ad_errors
# min_max_temp_sensors: min_max_temp_sensors:
# temperature_sensors: temperature_sensors:
# - sensor.temperature_exterieur_nord - sensor.ext_front_temperature
# - sensor.temperature_exterieur_sud - sensor.ext_back_temperature
# output_sensors: output_sensors:
# max_temp: sensor.max_temp_outside max_temp: sensor.max_temp_outside
# max_temp_yesterday: sensor.max_temp_yesterday_outside max_temp_yesterday: sensor.max_temp_yesterday_outside
# min_temp: sensor.min_temp_outside min_temp: sensor.min_temp_outside
# min_temp_yesterday: sensor.min_temp_yesterday_outside min_temp_yesterday: sensor.min_temp_yesterday_outside
group_collectors: group_collectors:
windows: windows:
group: binary_sensor.group_windows group: binary_sensor.group_windows
output_sensor: sensor.ad_number_of_windows_open output_sensor: sensor.ad_number_of_windows_open
doors:
group: binary_sensor.group_doors
output_sensor: sensor.ad_number_of_doors_open
music_players: music_players:
group: media_player.group_music_player group: media_player.group_music_player

36
apps/global/presence.yaml Normal file
View File

@@ -0,0 +1,36 @@
motion_tracker:
module: motiontracker
class: MotionTracker
priority: 5 # this need to be initialized before app using motion tracker
max_time: 30
areas:
corridor:
motion_sensors: binary_sensor.corridor_motion
hallway:
motion_sensors: binary_sensor.hallway_motion
restroom:
motion_sensors: binary_sensor.restroom_motion
garage:
motion_sensors: binary_sensor.garage_motion
kitchen:
motion_sensors: binary_sensor.kitchen_motion
mezzanine:
motion_sensors: binary_sensor.mezzanine_motion
living_room:
motion_sensors: binary_sensor.living_room_presence_presence
occupancy_sensors:
module: virtualsensors
class: VirtualSensorsApp
priority: 8 # default priority app is 50, since most of them require sensors created by virtual sensors, it's important that virtual_sensors start first
sensors:
binary_sensor.occupancy_living_room:
trigger_conditions: sensor.living_room_last_motion <= 5
binary_sensor.occupancy_kitchen:
trigger_conditions: sensor.kitchen_last_motion <= 5
binary_sensor.occupancy_restroom:
trigger_conditions: sensor.restroom_last_motion <= 3