Skip to content

Commit

Permalink
Add condition for turning pc off and fix config (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarb authored Feb 7, 2021
1 parent 3177865 commit 9c62a2c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 26 deletions.
42 changes: 17 additions & 25 deletions automations.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Turn off all lights 01 / 02 (when not home)

- id: '1564525145700'
alias: Turn christmas lights on when dark outside
trigger:
Expand All @@ -15,8 +13,7 @@
- id: '1564525145711'
alias: Turn christmas lights off when bright outside
trigger:
- platform: sun
entity_id: sun.sun
platform: sun
event: sunrise
condition: []
action:
Expand All @@ -26,7 +23,7 @@
- id: '1608504370538'
alias: Turn off Christmas lights at night
trigger:
- platform: time
platform: time
at: 00:30
condition: []
action:
Expand All @@ -36,7 +33,7 @@
- id: '1564525145701'
alias: Turn office lights on when computer is active
trigger:
- platform: state
platform: state
entity_id: binary_sensor.macbook_pro
to: 'on'
condition:
Expand All @@ -50,7 +47,7 @@
- id: '1564525145702'
alias: Turn office lights off when computer is inactive
trigger:
- platform: state
platform: state
entity_id: binary_sensor.macbook_pro
to: 'off'
condition:
Expand All @@ -65,12 +62,12 @@
- service: light.turn_off
data:
entity_id:
- office.office_spotlights
- office.office_desk_lamp
- office.office_spotlights
- office.office_desk_lamp
- id: '1564525145782'
alias: Hallway motion turns on tablet
trigger:
- entity_id: binary_sensor.mqtt_hallway_motion
entity_id: binary_sensor.mqtt_hallway_motion
from: 'off'
platform: state
to: 'on'
Expand All @@ -80,7 +77,7 @@
- id: '1564525145783'
alias: Hallway motion absence turns off tablet
trigger:
- entity_id: binary_sensor.mqtt_hallway_motion
entity_id: binary_sensor.mqtt_hallway_motion
from: 'on'
platform: state
to: 'off'
Expand All @@ -91,7 +88,7 @@
- id: '1569245264705'
alias: Bathroom motion turns on bathroom ceiling lamp dimmed
trigger:
- entity_id: binary_sensor.mqtt_bathroom_motion
entity_id: binary_sensor.mqtt_bathroom_motion
from: 'off'
platform: state
to: 'on'
Expand All @@ -107,7 +104,7 @@
- id: '1569245264706'
alias: Bathroom motion turns on bathroom ceiling lamp strong
trigger:
- entity_id: binary_sensor.mqtt_bathroom_motion
entity_id: binary_sensor.mqtt_bathroom_motion
from: 'off'
platform: state
to: 'on'
Expand All @@ -123,7 +120,7 @@
- id: '1569245490089'
alias: Bathroom motion sensor disabled turns off light
trigger:
- entity_id: binary_sensor.mqtt_bathroom_motion
entity_id: binary_sensor.mqtt_bathroom_motion
from: 'on'
platform: state
to: 'off'
Expand All @@ -136,7 +133,7 @@
alias: Clean room
description: Start Roborock room cleaning triggered from Google Assistant (IFTTT)
trigger:
- event_data:
event_data:
action: vacuum
event_type: ifttt_webhook_received
platform: event
Expand All @@ -151,7 +148,7 @@
alias: Send notification when Spotify playlist is updated
description: Sends a rich notification when a track has been added to a Spotify playlist, as detected by IFTTT
trigger:
- event_data:
event_data:
action: sharing
event_type: ifttt_webhook_received
platform: event
Expand Down Expand Up @@ -181,7 +178,7 @@
alias: Turn on office lights when PC turns on
description: ''
trigger:
- entity_id: switch.computer_power
entity_id: switch.computer_power
from: 'off'
platform: state
to: 'on'
Expand All @@ -194,7 +191,7 @@
alias: Turn off office lights when PC turns off
description: ''
trigger:
- entity_id: switch.computer_power
entity_id: switch.computer_power
from: 'on'
platform: state
to: 'off'
Expand All @@ -206,7 +203,7 @@
- id: '1587292652712'
alias: Send notification when vacuum returns to base with empty dustbin action
trigger:
- entity_id: vacuum.robocop
entity_id: vacuum.robocop
platform: state
from: cleaning
to: returning
Expand All @@ -229,16 +226,11 @@
alias: Send Robocop to waste bin on notification action
description: ''
trigger:
- event_data:
event_data:
action: send_robocop_to_waste_bin
event_type: mobile_app_notification_action
platform: event
condition: []
action:
- data: {}
service: script.send_robocop_to_waste_bin





5 changes: 4 additions & 1 deletion scripts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ turn_computer_on:

turn_computer_off:
alias: Turn off computer
sequence:
sequence:
- condition: state
entity_id: switch.computer_power
state: "on"
- service: shell_command.turn_off_computer
data:
ssh_user: !secret shutdown_ssh_user
Expand Down

0 comments on commit 9c62a2c

Please sign in to comment.