diff --git a/automation.yaml b/automation.yaml new file mode 100644 index 0000000..1f143f8 --- /dev/null +++ b/automation.yaml @@ -0,0 +1,6 @@ +# Sun Based +- !include automations/sunset_outside_on.yaml +- !include automations/sunset_inside_on.yaml +# Weather Based +- !include automations/cloudy_inside_on.yaml + diff --git a/automations/cloudy_inside_on.yaml b/automations/cloudy_inside_on.yaml new file mode 100644 index 0000000..a5ebed4 --- /dev/null +++ b/automations/cloudy_inside_on.yaml @@ -0,0 +1,13 @@ +alias: "Cloudy, inside on" +trigger: + platform: time + after: '14:40:00' +condition: + - condition: numeric_state + entity_id: sensor.dark_sky_cloud_coverage + above: 90 + - condition: state + entity_id: group.family + state: "home" +action: + service: script.inside_all_on diff --git a/automations/sunset_inside_on.yaml b/automations/sunset_inside_on.yaml new file mode 100644 index 0000000..7c676ef --- /dev/null +++ b/automations/sunset_inside_on.yaml @@ -0,0 +1,7 @@ +alias: "Sunset Inside on" +trigger: + platform: sun + event: sunset + offset: "-01:00:00" +action: + service: script.inside_all_on \ No newline at end of file diff --git a/automations/sunset_outside_on.yaml b/automations/sunset_outside_on.yaml new file mode 100644 index 0000000..6cdbb50 --- /dev/null +++ b/automations/sunset_outside_on.yaml @@ -0,0 +1,7 @@ +alias: "Sunset Outside on" +trigger: + platform: sun + event: sunset + offset: "-00:30:00" +action: + service: script.outside_all_on \ No newline at end of file diff --git a/automations/test.yaml b/automations/test.yaml new file mode 100644 index 0000000..5eff3de --- /dev/null +++ b/automations/test.yaml @@ -0,0 +1,9 @@ +#trigger: +# platform: time + # Matches every hour at 5 minutes past whole +# minutes: 49 +# seconds: 00 +#action: +# service: switch.turn_on +# data: +# entity_id: switch.fireplace_lights \ No newline at end of file diff --git a/configuration.yaml b/configuration.yaml index 97c24a7..09aad7d 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -6,11 +6,12 @@ homeassistant: time_zone: America/New_York customize: !include customize.yaml group: !include groups.yaml -#automation: !include automation.yaml +automation: !include automation.yaml sensor: !include_dir_merge_list sensors switch: !include_dir_merge_list switches -light: !include_dir_merge_list light +script: !include scripts.yaml alexa: !include alexa/intents.yaml +input_select: !include input_select.yaml http: api_password: !secret MY_API_PASS diff --git a/scripts/inside_all_on.yaml b/scripts/inside_all_on.yaml new file mode 100644 index 0000000..7c758fd --- /dev/null +++ b/scripts/inside_all_on.yaml @@ -0,0 +1,12 @@ +sequence: +- event: LOGBOOK_ENTRY + event_data: + name: EVENT + message: "Turning inside lights on." +- service: switch.turn_on + data: + entity_id: switch.tower_lamp + +#- service: notify.notify +# data: +# message: "Outside lights are on!" \ No newline at end of file diff --git a/scripts/outside_all_on.yaml b/scripts/outside_all_on.yaml new file mode 100644 index 0000000..9571c9e --- /dev/null +++ b/scripts/outside_all_on.yaml @@ -0,0 +1,20 @@ +sequence: +- event: LOGBOOK_ENTRY + event_data: + name: EVENT + message: "Turning outside lights on." +- service: switch.turn_on + data: + entity_id: switch.driveway_light +- service: switch.turn_on + data: + entity_id: switch.side_door_light +- service: switch.turn_on + data: + entity_id: front_porch_left +- service: switch.turn_on + data: + entity_id: front_porch_right +#- service: notify.notify +# data: +# message: "Outside lights are on!" \ No newline at end of file