Compare commits

...

4 Commits

8 changed files with 190 additions and 54 deletions

View File

@@ -21,25 +21,8 @@ motion_tracker:
motion_sensors: binary_sensor.hallway_motion motion_sensors: binary_sensor.hallway_motion
restroom: restroom:
motion_sensors: binary_sensor.restroom_motion motion_sensors: binary_sensor.restroom_motion
garage:
sleep_switch: motion_sensors: binary_sensor.garage_motion
kitchen:
module: smartswitch motion_sensors: binary_sensor.kitchen_motion
class: SmartSwitch
entity: input_boolean.sleeping
toggle_events:
button_long_press:
event_name: zha_event
event_data:
device_name: 'bedroom_hue_remote'
args:
press_type: 'hold'
button: 'off'
reset_data:
device_name: 'bedroom_hue_remote'
args:
button: 'off'
press_type: 'long_release'

116
apps/rooms/bedroom.yaml Normal file
View File

@@ -0,0 +1,116 @@
sleep_switch:
module: smartswitch
class: SmartSwitch
entity: input_boolean.sleeping
toggle_events:
button_long_press_pierre:
event_name: zha_event
event_data:
device_name: 'bedroom_remote_pierre'
args:
press_type: 'hold'
button: 'off'
reset_data:
device_name: 'bedroom_remote_pierre'
args:
button: 'off'
press_type: 'long_release'
button_long_press_maeva:
event_name: zha_event
event_data:
device_name: 'bedroom_remote_maeva'
args:
press_type: 'hold'
button: 'off'
reset_data:
device_name: 'bedroom_remote_maeva'
args:
button: 'off'
press_type: 'long_release'
sonos_led:
module: smartswitch
class: SmartSwitch
entity: switch.bedroom_led
smart_conditions: not input_boolean.sleeping
light_bedroom_bedlight_pierre:
module: smartlight
class: SmartLight
entity: light.bedroom_bedlight_pierre
toggle_events:
button_press:
event_name: zha_event
event_data:
device_name: 'bedroom_remote_pierre'
args:
press_type: 'press'
button: 'off'
off_events:
- turn_off_all_lights
increase_brightness_events:
up_hold:
event_name: zha_event
event_data:
device_name: 'bedroom_remote_pierre'
args:
press_type: 'hold'
button: 'up'
decrease_brightness_events:
down_hold:
event_name: zha_event
event_data:
device_name: 'bedroom_remote_pierre'
args:
press_type: 'hold'
button: 'down'
light_bedroom_bedlight_maeva:
module: smartlight
class: SmartLight
entity: light.bedroom_bedlight_maeva
toggle_events:
button_press:
event_name: zha_event
event_data:
device_name: 'bedroom_remote_maeva'
args:
press_type: 'press'
button: 'off'
off_events:
- turn_off_all_lights
increase_brightness_events:
up_hold:
event_name: zha_event
event_data:
device_name: 'bedroom_remote_maeva'
args:
press_type: 'hold'
button: 'up'
decrease_brightness_events:
down_hold:
event_name: zha_event
event_data:
device_name: 'bedroom_remote_maeva'
args:
press_type: 'hold'
button: 'down'
bed_ledstrip:
module: smartlight
class: SmartLight
entity: light.bedroom_ledstripe
smart_conditions: (input_boolean.sleeping or binary_sensor.day_interval_night) and (binary_sensor.bedroom_motion_bed_pierre or binary_sensor.bedroom_motion_bed_maeva)

View File

@@ -41,37 +41,5 @@ light_restroom:
25: binary_sensor.day_interval_night 25: binary_sensor.day_interval_night
100: True 100: True
light_bedroom_nightstand:
module: smartlight
class: SmartLight
entity: light.berdroom_bedlight
toggle_events:
button_press:
event_name: zha_event
event_data:
device_name: 'bedroom_hue_remote'
args:
press_type: 'press'
button: 'off'
increase_brightness_events:
up_hold:
event_name: zha_event
event_data:
device_name: 'bedroom_hue_remote'
args:
press_type: 'hold'
button: 'up'
decrease_brightness_events:
down_hold:
event_name: zha_event
event_data:
device_name: 'bedroom_hue_remote'
args:
press_type: 'hold'
button: 'down'

7
apps/rooms/garage.yaml Normal file
View File

@@ -0,0 +1,7 @@
light_garage:
module: smartlight
class: SmartLight
entity: switch.garage_01
smart_conditions: sensor.garage_last_motion < 3
blocking_conditions: sensor.garage_motion_light_level > 10 and not self

22
apps/rooms/kitchen.yaml Normal file
View File

@@ -0,0 +1,22 @@
light_kitchen_sink:
module: smartlight
class: SmartLight
entity: light.kitchen_sink
smart_conditions:
- light.kitchen_sink_switch
- sensor.kitchen_last_motion < 3 and (sensor.garage_motion_light_level < 10 or self)
light_brightness_pct:
100: light.kitchen_sink_switch
1: binary_sensor.day_interval_night or input_boolean.sleeping
15: True
light_kitchen_sink_switch:
module: smartswitch
class: SmartSwitch
entity: light.kitchen_sink_switch
off_events:
- turn_off_all_lights

16
apps/virtualevents.yaml Normal file
View File

@@ -0,0 +1,16 @@
virtual_events:
module: virtualevents
class: VirtualEvents
priority: 100 # default priority app is 50, since the virtual_events doesn't create any sensor but is based on sensor created by many app, it's important it's created last
virtual_events:
good_morning:
event_name: good_morning
event_condition: not input_boolean.sleeping
turn_off_all_lights:
event_name: turn_off_all_lights
event_condition: input_boolean.sleeping

24
archiveLogs.sh Normal file
View File

@@ -0,0 +1,24 @@
#!/bin/sh
# Archive log files from the logs directory into a timestamped subdirectory, then delete them.
LOGS_DIR=/conf/logs
ARCHIVE_DIR=$LOGS_DIR/archive
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
DEST=$ARCHIVE_DIR/$TIMESTAMP
# Find log files directly in the logs directory (non-recursive, skip archive subdir)
LOG_FILES=$(find "$LOGS_DIR" -maxdepth 1 -type f -name "*.log")
if [ -z "$LOG_FILES" ]; then
echo "[archiveLogs] No log files to archive."
exit 0
fi
mkdir -p "$DEST"
for f in $LOG_FILES; do
mv "$f" "$DEST/"
done
echo "[archiveLogs] Archived logs to $DEST"