Skip to content

Commit

Permalink
Generate the simple light automations from templates
Browse files Browse the repository at this point in the history
  • Loading branch information
claha committed Sep 30, 2023
1 parent 3c225d3 commit 1b99ca7
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 347 deletions.
9 changes: 9 additions & 0 deletions roles/homeassistant/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
---
service_name: "{{ ansible_role_name }}"
service_path: "{{ services_path }}/{{ service_name }}"
areas:
- bedroom
- guest_room
- kitchen
- living_room
- laundry
- master_bedroom
- office

stocks: []
funds: []
glances: []
Expand Down
43 changes: 0 additions & 43 deletions roles/homeassistant/files/config/automation/lights_bedroom.yaml

This file was deleted.

43 changes: 0 additions & 43 deletions roles/homeassistant/files/config/automation/lights_guest_room.yaml

This file was deleted.

43 changes: 0 additions & 43 deletions roles/homeassistant/files/config/automation/lights_kitchen.yaml

This file was deleted.

45 changes: 0 additions & 45 deletions roles/homeassistant/files/config/automation/lights_laundry.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,5 @@
---
# yamllint disable rule:line-length
- alias: "Lights laundry off"

trigger:
platform: state
entity_id: binary_sensor.dark_outside
from: "on"
to: "off"

action:
service: script.lights_laundry_off


- alias: "Lights laundry on"

trigger:
platform: state
entity_id: binary_sensor.dark_outside
from: "off"
to: "on"

condition:
condition: time
before: input_datetime.lights_laundry_off_evening

action:
service: script.lights_laundry_on


- alias: "Lights laundry dim"

trigger:
Expand All @@ -38,23 +10,6 @@
service: script.lights_laundry_dim


- alias: "Lights laundry off time"

trigger:
- platform: time
at: input_datetime.lights_laundry_off_morning
- platform: time
at: input_datetime.lights_laundry_off_evening

condition:
condition: state
entity_id: binary_sensor.xiaomi_movement_and_illuminance_0_occupancy
state: "off"

action:
service: script.lights_laundry_off


- alias: "Lights laundry on motion"

trigger:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,33 +1,5 @@
---
# yamllint disable rule:line-length
- alias: "Lights master bedroom off"

trigger:
platform: state
entity_id: binary_sensor.dark_outside
from: "on"
to: "off"

action:
service: script.lights_master_bedroom_off


- alias: "Lights master bedroom on"

trigger:
platform: state
entity_id: binary_sensor.dark_outside
from: "off"
to: "on"

condition:
condition: time
before: input_datetime.lights_master_bedroom_off_evening

action:
service: script.lights_master_bedroom_on


- alias: "Lights master bedroom dim"

trigger:
Expand All @@ -36,19 +8,3 @@

action:
service: script.lights_master_bedroom_dim


- alias: "Lights master bedroom off time morning"
use_blueprint:
path: run_script_at.yaml
input:
datetime: input_datetime.lights_master_bedroom_off_morning
script: script.lights_master_bedroom_off


- alias: "Lights master bedroom off time evening"
use_blueprint:
path: run_script_at.yaml
input:
datetime: input_datetime.lights_master_bedroom_off_evening
script: script.lights_master_bedroom_off
43 changes: 0 additions & 43 deletions roles/homeassistant/files/config/automation/lights_office.yaml

This file was deleted.

Loading

0 comments on commit 1b99ca7

Please sign in to comment.