diff --git a/automations.yaml b/automations.yaml index f107da3..0caabe0 100644 --- a/automations.yaml +++ b/automations.yaml @@ -184,6 +184,9 @@ data: entity_id: media_player.livingroom_speaker message: You have 15 minutes until bedtime. + - service: notify.shield + data: + message: 15 minutes till bed! - wait_for_trigger: - platform: time at: '21:29:00' @@ -302,3 +305,48 @@ target: entity_id: input_boolean.night_mode mode: single +- id: '1634785924008' + alias: Morning wake up routine + description: '' + trigger: + - platform: template + value_template: '{{now().strftime("%a %h %d %H:%M %Z %Y") == (((state_attr(''sensor.pixel_4a_next_alarm'', + ''Time in Milliseconds'') | int / 1000) + 1*60 ) | timestamp_custom(''%a %h + %d %H:%M %Z %Y''))}} + + ' + condition: + - condition: state + entity_id: person.jen + state: home + - condition: time + weekday: + - mon + - tue + - wed + - thu + - fri + before: 07:00:00 + after: 06:00:00 + action: + - service: script.turn_on + target: + entity_id: script.morning_routine + - service: input_boolean.turn_off + target: + entity_id: input_boolean.night_mode + mode: single +- id: '1634835663224' + alias: Morning lights turn off + description: '' + trigger: + - platform: numeric_state + entity_id: sun.sun + attribute: elevation + above: '1' + condition: [] + action: + - service: scene.turn_on + target: + entity_id: scene.morning_lights_2 + mode: single diff --git a/esphome/garage.yaml b/esphome/garage.yaml new file mode 100644 index 0000000..c478bc2 --- /dev/null +++ b/esphome/garage.yaml @@ -0,0 +1,54 @@ +esphome: + name: garage + platform: ESP8266 + board: esp01_1m + +wifi: + networks: + - ssid: !secret "wifi_ssid" + password: !secret "wifi_pass" + ap: + ssid: "smart_plug_1_fallback" + password: "Fallback@!" + +captive_portal: + +web_server: + port: 80 + +# Enable logging +logger: + +# Enable Home Assistant API +api: + +ota: + +binary_sensor: + - platform: gpio + pin: + number: GPIO14 + mode: INPUT_PULLUP + inverted: True + name: "Garage Door Sensor" + device_class: garage_door + +switch: + - platform: gpio + pin: GPIO12 + id: relay + - platform: template + icon: "mdi:arrow-up-down-bold-outline" + name: "Garage Door" + turn_on_action: + - switch.turn_on: relay + - delay: 15000ms + - switch.turn_off: relay + + # - delay: 500ms + # - switch.turn_off: relay + +sensor: + - platform: wifi_signal + name: garage_door_signal + update_interval: 15s \ No newline at end of file diff --git a/media_player.yaml b/media_player.yaml index e3b8e43..53f6594 100644 --- a/media_player.yaml +++ b/media_player.yaml @@ -7,5 +7,5 @@ host: 192.168.10.83 - platform: androidtv - name: Livingroom TV Sheild + name: Livingroom TV Shield host: 192.168.10.81 diff --git a/scenes.yaml b/scenes.yaml index 12ebb7b..5a9a989 100644 --- a/scenes.yaml +++ b/scenes.yaml @@ -107,3 +107,20 @@ friendly_name: Office Lamp supported_features: 44 state: 'on' +- id: '1634835495041' + name: Morning Lights + entities: + light.porch_light: + supported_color_modes: + - brightness + off_brightness: + friendly_name: Porch Light + supported_features: 41 + state: 'off' + light.upstairs_light: + supported_color_modes: + - brightness + off_brightness: + friendly_name: Upstairs Light + supported_features: 41 + state: 'off' diff --git a/scripts.yaml b/scripts.yaml index 074f640..a7c8fe7 100644 --- a/scripts.yaml +++ b/scripts.yaml @@ -39,3 +39,42 @@ start_sleep_timer: entity_id: timer.sleep_timer mode: restart icon: mdi:bed +morning_routine: + alias: Morning Routine + sequence: + - type: turn_on + device_id: b01054a542a51b2c6fb66d1a13e158a3 + entity_id: light.upstairs_light + domain: light + brightness_pct: 15 + - type: turn_on + device_id: e6cbd7cd9a565f6e81ec1d7903d151f4 + entity_id: light.livingroom_light + domain: light + brightness_pct: 5 + - service: switch.turn_on + target: + entity_id: switch.harmony_hub_shield_tv + - delay: + hours: 0 + minutes: 0 + seconds: 3 + milliseconds: 0 + - service: androidtv.adb_command + data: + entity_id: media_player.livingroom_tv_shield + command: am start -a android.intent.action.VIEW -d -n ar.tvplayer.tv/.ui.MainActivity + - delay: + hours: 0 + minutes: 0 + seconds: 3 + milliseconds: 0 + - wait_for_trigger: + - platform: numeric_state + entity_id: sun.sun + attribute: elevation + above: '1' + - service: light.turn_off + target: + entity_id: light.upstairs_light + mode: single