Skip to content

Commit

Permalink
Automated update at 2018-10-08 12:03
Browse files Browse the repository at this point in the history
  • Loading branch information
DubhAd committed Oct 8, 2018
1 parent 89432ab commit e5cfa5d
Show file tree
Hide file tree
Showing 18 changed files with 472 additions and 312 deletions.
42 changes: 42 additions & 0 deletions automation/family_room_not_occupied.yaml
@@ -0,0 +1,42 @@
initial_state: 'on'
alias: 'Family room not occupied'
trigger:
- platform: state
entity_id: device_tracker.family_tv
to: 'not_home'
- platform: state
entity_id: media_player.family_room
to: 'paused'
- platform: state
entity_id: media_player.family_room
to: 'off'
- platform: state
entity_id: media_player.cast_kitchen_speaker
to: 'off'
- platform: state
entity_id: media_player.cast_kitchen_speaker
to: 'idle'
condition:
# TV and music off
- condition: state
entity_id: device_tracker.family_tv
state: 'not_home'
- condition: or
conditions:
- condition: state
entity_id: media_player.family_room
state: 'playing'
- condition: state
entity_id: media_player.family_room
state: 'off'
- condition: or
conditions:
- condition: state
entity_id: media_player.cast_kitchen_speaker
state: 'playing'
- condition: state
entity_id: media_player.cast_kitchen_speaker
state: 'idle'
action:
- service: input_boolean.turn_off
entity_id: input_boolean.family_room_occupied
40 changes: 40 additions & 0 deletions automation/family_room_occupied.yaml
@@ -0,0 +1,40 @@
initial_state: 'on'
alias: 'Family room occupied'
trigger:
- platform: state
entity_id: device_tracker.family_tv
to: 'home'
- platform: state
entity_id: media_player.family_room
to: 'playing'
- platform: state
entity_id: media_player.cast_kitchen_speaker
to: 'playing'
condition:
# TV or music on
- condition: or
conditions:
- condition: state
entity_id: device_tracker.family_tv
state: 'home'
- condition: state
entity_id: media_player.family_room
state: 'playing'
- condition: state
entity_id: media_player.cast_kitchen_speaker
state: 'playing'
- condition: or
conditions:
# Somebody is home, or guest mode is on
- condition: state
entity_id: input_boolean.all_away
state: 'off'
- condition: state
entity_id: input_boolean.adults_away
state: 'off'
- condition: state
entity_id: input_boolean.guest_mode
state: 'on'
action:
- service: input_boolean.turn_on
entity_id: input_boolean.family_room_occupied
50 changes: 16 additions & 34 deletions automation/living_room_away.yaml
Expand Up @@ -2,47 +2,29 @@ initial_state: 'on'
alias: 'Living room away'
trigger:
- platform: state
entity_id: media_player.samsung_tv_remote
entity_id: input_boolean.living_room_occupied
to: 'off'
for:
minutes: 3
- platform: state
entity_id: device_tracker.livingroom_chromecast
to: 'not_home'
for:
minutes: 3
- platform: state
entity_id: media_player.cast_living_room_tv
to: 'unavailable'
for:
minutes: 3
- platform: state
entity_id: media_player.living_room
to: 'paused'
for:
minutes: 3
- platform: state
entity_id: input_boolean.all_away
to: 'on'
to: 'off'
- platform: state
entity_id: input_boolean.adults_away
to: 'off'
condition:
condition: and
conditions:
# Requires all the media devices to be off
- condition: state
entity_id: media_player.samsung_tv_remote
entity_id: input_boolean.living_room_occupied
state: 'off'
- condition: or
conditions:
- condition: state
entity_id: input_boolean.all_away
state: 'on'
- condition: state
entity_id: input_boolean.adults_away
state: 'on'
- condition: state
entity_id: device_tracker.livingroom_chromecast
state: 'not_home'
- condition: state
entity_id: media_player.cast_living_room_tv
state: 'unavailable'
- condition: state
entity_id: media_player.living_room
state: 'paused'
# There's been no motion in the last 3 minutes
- condition: template
value_template: "{{ ( as_timestamp(now()) - as_timestamp(states.binary_sensor.living_room_motion.last_updated) ) > 180 }}"
entity_id: input_boolean.guest_mode
state: 'off'
action:
- service: input_select.select_option
data:
Expand Down
36 changes: 25 additions & 11 deletions automation/living_room_day_off.yaml
@@ -1,9 +1,6 @@
initial_state: 'on'
alias: 'Living room day off'
trigger:
- platform: state
entity_id: sun.sun
to: above_horizon
- platform: numeric_state
entity_id: sensor.living_room_multi_luminance
above: 70
Expand All @@ -22,25 +19,42 @@ trigger:
above: 20
for:
minutes: 30
- platform: state
entity_id: input_boolean.living_room_occupied
to: 'on'
condition:
- condition: and
conditions:
- condition: state
entity_id: sun.sun
state: above_horizon
- condition: state
entity_id: input_boolean.lighting_automations
entity_id: input_boolean.living_room_occupied
state: 'on'
- condition: or
conditions:
# Bright, or...
- condition: numeric_state
entity_id: sensor.living_room_multi_luminance
above: 40
# Sun is rising
- condition: state
entity_id: binary_sensor.trend_sun_elevation
state: 'on'
- condition: and
conditions:
# Sun is rising
- condition: state
entity_id: binary_sensor.trend_sun_elevation
state: 'on'
- condition: numeric_state
entity_id: sensor.living_room_multi_luminance
above: 20
# We're here or guest mode is on
- condition: or
conditions:
- condition: state
entity_id: input_boolean.all_away
state: 'off'
- condition: state
entity_id: input_boolean.adults_away
state: 'off'
- condition: state
entity_id: input_boolean.guest_mode
state: 'on'
action:
- service: input_select.select_option
data:
Expand Down
134 changes: 23 additions & 111 deletions automation/living_room_day_on.yaml
@@ -1,130 +1,42 @@
initial_state: 'on'
alias: 'Living room day on'
trigger:
- platform: state
entity_id: input_boolean.living_room_occupied
to: 'on'
- platform: numeric_state
entity_id: sensor.living_room_multi_luminance
below: 18
below: 20
for:
minutes: 5
- platform: numeric_state
entity_id: sensor.living_room_multi_luminance
below: 14
below: 15
for:
minutes: 1
- platform: state
entity_id: media_player.samsung_tv_remote
to: 'on'
- platform: state
entity_id: media_player.cast_living_room_tv
to: 'playing'
- platform: state
entity_id: device_tracker.livingroom_chromecast
to: 'home'
- platform: state
entity_id: media_player.living_room
to: 'playing'
- platform: state
entity_id: media_player.samsung_tv_remote
to: 'on'
for:
minutes: 5
- platform: state
entity_id: media_player.cast_living_room_tv
to: 'playing'
for:
minutes: 5
- platform: state
entity_id: device_tracker.livingroom_chromecast
to: 'home'
for:
minutes: 5
- platform: state
entity_id: media_player.living_room
to: 'playing'
for:
minutes: 5
- platform: state
entity_id: input_boolean.lighting_automations
to: 'on'
- platform: state
entity_id: group.living_room_lights
to: 'off'
condition:
condition: and
conditions:
# Lighting automations are enabled
- condition: state
entity_id: input_boolean.lighting_automations
state: 'on'
# Lights are off
- condition: state
entity_id: switch.tv_light_switch
state: 'off'
for:
minutes: 5
- condition: and
conditions:
# Room is dark, but not too dark
- condition: numeric_state
entity_id: sensor.living_room_multi_luminance
below: 18
below: 20
above: 11
# During operational hours
- condition: time
after: '04:00:00'
before: '23:00:00'
- condition: or
conditions:
# Media's been on for at least 5 minutes
- condition: state
entity_id: media_player.samsung_tv_remote
state: 'on'
for:
minutes: 5
# Chromecast
- condition: state
entity_id: media_player.cast_living_room_tv
state: 'playing'
for:
minutes: 5
- condition: state
entity_id: device_tracker.livingroom_chromecast
state: 'home'
for:
minutes: 5
# Sonos
- condition: state
entity_id: media_player.living_room
state: 'playing'
for:
minutes: 5
# There's been motion in the last 3 minutes
- condition: template
value_template: "{{ ( as_timestamp(now()) - as_timestamp(states.binary_sensor.living_room_motion.last_updated) ) < 180 }}"
# We're home
- condition: or
conditions:
- condition: state
entity_id: input_boolean.adults_away
state: 'off'
- condition: state
entity_id: input_boolean.all_away
state: 'off'
- condition: or
conditions:
# TV is on
- condition: state
entity_id: media_player.samsung_tv_remote
state: 'on'
# Chromecast
- condition: state
entity_id: media_player.cast_living_room_tv
state: 'playing'
- condition: state
entity_id: device_tracker.livingroom_chromecast
state: 'home'
# Sonos
- condition: state
entity_id: media_player.living_room
state: 'playing'
- condition: state
entity_id: input_boolean.living_room_occupied
state: 'on'
# We're here or guest mode is on
- condition: or
conditions:
- condition: state
entity_id: input_boolean.all_away
state: 'off'
- condition: state
entity_id: input_boolean.adults_away
state: 'off'
- condition: state
entity_id: input_boolean.guest_mode
state: 'on'
action:
- service: input_select.select_option
data:
Expand Down
20 changes: 20 additions & 0 deletions automation/living_room_lights_day_on.yaml
@@ -0,0 +1,20 @@
initial_state: 'off'
alias: 'Living room lights day on'
trigger:
- platform: state
entity_id: input_select.living_room
to: Day on
condition:
condition: and
conditions:
# Lighting automations are enabled
- condition: state
entity_id: input_boolean.lighting_automations
state: 'on'
action:
- service: homeassistant.turn_off
entity_id: input_boolean.livingroom_lights_auto
- service: switch.turn_on
entity_id: switch.tv_light_switch
- service: switch.turn_on
entity_id: switch.livingroom_socket_switch

0 comments on commit e5cfa5d

Please sign in to comment.