add some home cinema automation

This commit is contained in:
2026-06-21 09:30:33 +02:00
parent 85fb207ca0
commit 6310e39fd9
2 changed files with 72 additions and 11 deletions

View File

@@ -4,11 +4,6 @@ virtual_sensors:
priority: 10 # default priority app is 50, since most of them require sensors created by virtual sensors, it's important that virtual_sensors start first priority: 10 # default priority app is 50, since most of them require sensors created by virtual sensors, it's important that virtual_sensors start first
sensors: sensors:
continuous_condition.is_apple_tv_idle:
time: 5
conditions: media_player.apple_tv == 'paused' or media_player.apple_tv == 'idle' or media_player.apple_tv == 'standby'
binary_sensor.is_apple_tv_on: media_player.apple_tv != 'off'
binary_sensor.someone_home: person.maeva == 'home' or person.pierre == 'home' binary_sensor.someone_home: person.maeva == 'home' or person.pierre == 'home'
binary_sensor.is_dark_outside: sun.sun == 'below_horizon' binary_sensor.is_dark_outside: sun.sun == 'below_horizon'
@@ -17,11 +12,40 @@ virtual_sensors:
values: values:
0: 0:
- not binary_sensor.living_room_occupancy - not binary_sensor.living_room_occupancy
- binary_sensor.is_apple_tv_on and not binary_sensor.is_apple_tv_idle - binary_sensor.projector_on and not binary_sensor.is_vertex2_content_idle
- light.living_room - light.living_room
- sensor.mezzanine_motion_light_level > 10 - sensor.mezzanine_motion_light_level > 10
1: binary_sensor.is_everybody_sleeping 1:
- binary_sensor.is_everybody_sleeping
- binary_sensor.projector_on
2: true 2: true
# home cinema sensors
binary_sensor.projector_on: switch.living_room_projector_plug and sensor.living_room_projector_plug_power > 50
continuous_condition.projector_off_for_a_while:
time: 90
default_value: on
conditions: not binary_sensor.projector_on
# is_apple_tv_on is not reliable as the the apple tv integration sometimes return "paused" when it's actually off,
# you should use is_using_apple_tv instead for most automation
binary_sensor.is_apple_tv_on: media_player.apple_tv != 'off' and media_player.apple_tv != 'idle'
binary_sensor.is_xbox_on: media_player.xbox != 'off'
binary_sensor.is_playstation_on: switch.ps5_136_power
retain_condition.vertex2_has_input_signal:
retain_time: 10
conditions: sensor.hdfury_vertex2_07_output_tx0 or sensor.hdfury_vertex2_07_audio_output
binary_sensor.is_using_apple_tv: binary_sensor.is_apple_tv_on and binary_sensor.vertex2_has_input_signal and select.hdfury_vertex2_07_port_select_tx0 == 0
binary_sensor.is_using_xbox: binary_sensor.is_xbox_on and binary_sensor.vertex2_has_input_signal and select.hdfury_vertex2_07_port_select_tx0 == 1
binary_sensor.is_using_playstation: binary_sensor.is_playstation_on and binary_sensor.vertex2_has_input_signal and select.hdfury_vertex2_07_port_select_tx0 == 2
continuous_condition.is_vertex2_content_idle:
time: 5
conditions:
trigger_conditions:
- binary_sensor.is_using_apple_tv and (media_player.apple_tv == 'paused' or media_player.apple_tv == 'idle' or media_player.apple_tv == 'standby')
# - binary_sensor.is_using_playstation and sensor.ps5_136_activity == 'idle'
# - binary_sensor.is_using_xbox and not binary_sensor.yetanotherpedro_in_game
#p1p sensors #p1p sensors
binary_sensor.p1p_is_printing: binary_sensor.p1p_is_printing:
trigger_conditions: sensor.garage_p1p_etat_de_l_impression != 'idle' and sensor.garage_p1p_etat_de_l_impression != 'finish' and sensor.garage_p1p_etat_de_l_impression != 'idle' and sensor.garage_p1p_etat_de_l_impression != 'offline' trigger_conditions: sensor.garage_p1p_etat_de_l_impression != 'idle' and sensor.garage_p1p_etat_de_l_impression != 'finish' and sensor.garage_p1p_etat_de_l_impression != 'idle' and sensor.garage_p1p_etat_de_l_impression != 'offline'

View File

@@ -10,7 +10,7 @@ light_mezzanine_01:
- light.living_room - light.living_room
light_brightness_pct: light_brightness_pct:
15: binary_sensor.is_everybody_sleeping 15: binary_sensor.is_everybody_sleeping or binary_sensor.projector_on
35: binary_sensor.day_interval_night 35: binary_sensor.day_interval_night
100: True 100: True
@@ -26,7 +26,7 @@ light_mezzanine_02:
- light.living_room - light.living_room
light_brightness_pct: light_brightness_pct:
5: binary_sensor.is_everybody_sleeping 5: binary_sensor.is_everybody_sleeping or binary_sensor.projector_on
25: binary_sensor.day_interval_night 25: binary_sensor.day_interval_night
100: True 100: True
@@ -77,3 +77,40 @@ light_living_room:
off_events: off_events:
- turn_off_all_lights - turn_off_all_lights
projection_screen:
module: smartshutter
class: SmartShutter
entity: cover.living_room_projection_screen
close_position: 22
close_conditions: # close mean screen down
# when the projector is turn back on, it can happen that this condition is evaluated before projector_off_for_a_while is updated
# so I need to test both binary_sensor.projector_on and not binary_sensor.projector_off_for_a_while
trigger_conditions: binary_sensor.projector_on or not binary_sensor.projector_off_for_a_while
disable_conditions:
- binary_sensor.day_interval_night and not binary_sensor.projector_on
- binary_sensor.is_everybody_sleeping and not binary_sensor.projector_on
bravia_theatre:
module: smartswitch
class: SmartSwitch
entity: media_player.bravia_theatre
smart_conditions: binary_sensor.vertex2_has_input_signal
w4000i:
module: smartswitch
class: SmartSwitch
entity: media_player.benq_w4000i
smart_conditions: binary_sensor.vertex2_has_input_signal
mezzanine_curtains:
module: smartshutter
class: SmartShutter
entity: cover.salon_mezzanine_curtain
close_conditions:
trigger_conditions: binary_sensor.projector_on or not binary_sensor.projector_off_for_a_while
disable_conditions: self == 'closed' and (binary_sensor.is_dark_outside or binary_sensor.is_anybody_sleeping)