Compare commits

..

2 Commits

9 changed files with 39 additions and 17 deletions

21
apps/global/sleep.yaml Normal file
View File

@@ -0,0 +1,21 @@
sleep_sensors:
module: virtualsensors
class: VirtualSensorsApp
priority: 5 # 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.is_bedroom_sleeping: input_boolean.bedroom_sleeping
binary_sensor.is_living_room_sleeping: input_boolean.living_room_sleeping
binary_sensor.is_desk_sleeping: input_boolean.desk_sleeping
binary_sensor.is_guestroom_sleeping: input_boolean.guestroom_sleeping
binary_sensor.is_everybody_sleeping:
- binary_sensor.is_bedroom_sleeping
#- binary_sensor.is_living_room_sleeping and ...
#- binary_sensor.is_desk_sleeping and ...
#- binary_sensor.is_guestroom_sleeping and ...
binary_sensor.is_anybody_sleeping:
- binary_sensor.is_bedroom_sleeping
- binary_sensor.is_living_room_sleeping
- binary_sensor.is_desk_sleeping
- binary_sensor.is_guestroom_sleeping

View File

@@ -7,10 +7,10 @@ virtual_events:
virtual_events: virtual_events:
good_morning: good_morning:
event_name: good_morning event_name: good_morning
event_condition: not input_boolean.sleeping event_condition: not binary_sensor.is_everybody_sleeping
turn_off_all_lights: turn_off_all_lights:
event_name: turn_off_all_lights event_name: turn_off_all_lights
event_condition: input_boolean.sleeping event_condition: binary_sensor.is_everybody_sleeping

View File

@@ -10,5 +10,4 @@ virtual_sensors:
binary_sensor.is_apple_tv_on: media_player.apple_tv != 'off' 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_everybody_sleeping: input_boolean.sleeping

View File

@@ -2,7 +2,7 @@ sleep_switch:
module: smartswitch module: smartswitch
class: SmartSwitch class: SmartSwitch
entity: input_boolean.sleeping entity: input_boolean.bedroom_sleeping
toggle_events: toggle_events:
button_long_press_pierre: button_long_press_pierre:
@@ -64,7 +64,7 @@ sonos_led:
entity: switch.bedroom_led entity: switch.bedroom_led
smart_conditions: not input_boolean.sleeping smart_conditions: not binary_sensor.is_bedroom_sleeping
light_bedroom_bedlight_pierre: light_bedroom_bedlight_pierre:
module: smartlight module: smartlight
@@ -152,7 +152,7 @@ bed_ledstrip:
entity: light.bedroom_ledstripe entity: light.bedroom_ledstripe
smart_conditions: smart_conditions:
trigger_conditions: (input_boolean.sleeping or binary_sensor.day_interval_night) and (binary_sensor.bedroom_motion_bed_pierre or binary_sensor.bedroom_motion_bed_maeva) trigger_conditions: (binary_sensor.is_bedroom_sleeping or binary_sensor.day_interval_night) and (binary_sensor.bedroom_motion_bed_pierre or binary_sensor.bedroom_motion_bed_maeva)
blocking_conditions: switch.bedroom_light or light.bedroom_bedlight_pierre or light.bedroom_bedlight_maeva blocking_conditions: switch.bedroom_light or light.bedroom_bedlight_pierre or light.bedroom_bedlight_maeva
on_events_with_transition: on_events_with_transition:
@@ -177,4 +177,4 @@ alarm_clock:
inputdate_alarmclock_secondary: input_datetime.secondary_alarmclock inputdate_alarmclock_secondary: input_datetime.secondary_alarmclock
input_text_wakeup_time: input_text.wakeup_time input_text_wakeup_time: input_text.wakeup_time
sleeping_condition: input_boolean.sleeping sleeping_condition: binary_sensor.is_bedroom_sleeping

View File

@@ -8,7 +8,7 @@ light_corridor:
blocking_conditions: sensor.corridor_motion_light_level > 10 and not self blocking_conditions: sensor.corridor_motion_light_level > 10 and not self
light_brightness_pct: light_brightness_pct:
1: input_boolean.sleeping 1: binary_sensor.is_everybody_sleeping
25: binary_sensor.day_interval_night 25: binary_sensor.day_interval_night
100: True 100: True
@@ -22,7 +22,7 @@ light_hallway:
blocking_conditions: sensor.hallway_motion_light_level > 10 and not self blocking_conditions: sensor.hallway_motion_light_level > 10 and not self
light_brightness_pct: light_brightness_pct:
1: input_boolean.sleeping 1: binary_sensor.is_everybody_sleeping
25: binary_sensor.day_interval_night 25: binary_sensor.day_interval_night
100: True 100: True
@@ -37,7 +37,7 @@ light_restroom:
blocking_conditions: sensor.restroom_motion_light_level > 10 and not self blocking_conditions: sensor.restroom_motion_light_level > 10 and not self
light_brightness_pct: light_brightness_pct:
1: input_boolean.sleeping 1: binary_sensor.is_everybody_sleeping
25: binary_sensor.day_interval_night 25: binary_sensor.day_interval_night
100: True 100: True

View File

@@ -9,7 +9,7 @@ light_kitchen_sink:
light_brightness_pct: light_brightness_pct:
100: light.kitchen_sink_switch 100: light.kitchen_sink_switch
1: binary_sensor.day_interval_night or input_boolean.sleeping 1: binary_sensor.day_interval_night or binary_sensor.is_everybody_sleeping
15: True 15: True
light_kitchen_sink_switch: light_kitchen_sink_switch:

View File

@@ -8,7 +8,7 @@ light_mezzanine_01:
blocking_conditions: sensor.mezzanine_motion_light_level > 10 and not self blocking_conditions: sensor.mezzanine_motion_light_level > 10 and not self
light_brightness_pct: light_brightness_pct:
15: input_boolean.sleeping 15: binary_sensor.is_everybody_sleeping
35: binary_sensor.day_interval_night 35: binary_sensor.day_interval_night
100: True 100: True
@@ -22,7 +22,7 @@ light_mezzanine_02:
blocking_conditions: sensor.mezzanine_motion_light_level > 10 and not self blocking_conditions: sensor.mezzanine_motion_light_level > 10 and not self
light_brightness_pct: light_brightness_pct:
5: input_boolean.sleeping 5: binary_sensor.is_everybody_sleeping
25: binary_sensor.day_interval_night 25: binary_sensor.day_interval_night
100: True 100: True
@@ -38,7 +38,7 @@ light_bookshelves:
- binary_sensor.is_apple_tv_on and not binary_sensor.is_apple_tv_idle - binary_sensor.is_apple_tv_on and not binary_sensor.is_apple_tv_idle
#light_brightness_pct: #light_brightness_pct:
# 5: input_boolean.sleeping # 5: binary_sensor.is_everybody_sleeping
# 25: binary_sensor.day_interval_night # 25: binary_sensor.day_interval_night
# 100: True # 100: True

View File

@@ -11,7 +11,7 @@ TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
DEST=$ARCHIVE_DIR/$TIMESTAMP DEST=$ARCHIVE_DIR/$TIMESTAMP
# Find log files directly in the logs directory (non-recursive, skip archive subdir) # Find log files directly in the logs directory (non-recursive, skip archive subdir)
LOG_FILES=$(find "$LOGS_DIR" -maxdepth 1 -type f -name "*.log") LOG_FILES=$(find "$LOGS_DIR" -maxdepth 1 -type f -name "*.log*")
if [ -z "$LOG_FILES" ]; then if [ -z "$LOG_FILES" ]; then
echo "[archiveLogs] No log files to archive." echo "[archiveLogs] No log files to archive."

View File

@@ -2,3 +2,5 @@ libstdc++
gcompat gcompat
bash bash
git git
nodejs
npm