Commit cfad56c7 authored by Rob Connolly's avatar Rob Connolly
Browse files

Package yaml cleanup and add automation IDs.

parent f10d78d2
---
octoprint:
- host: !secret octoprint_host
api_key: !secret octoprint_api_key
......@@ -16,6 +16,7 @@ camera:
automation:
- alias: Send a notice when 3D print is done
id: printer_notification_done
trigger:
- platform: state
entity_id: binary_sensor.ender_3_printing
......
---
automation:
- alias: 'Set HA theme for day and night'
id: day_night_theme
trigger:
- platform: homeassistant
event: start
......@@ -11,8 +12,8 @@ automation:
entity_id: sun.sun
to: below_horizon
action:
- service_template: frontend.set_theme
data_template:
- service: frontend.set_theme
data:
name: >
{% if states.sun.sun.state == "above_horizon" %}
Green light Mode
......
---
automation:
- alias: "Electric blankets prompt"
id: electric_blankets_prompt
trigger:
platform: time
at: "21:30:00"
......
......@@ -57,6 +57,7 @@ input_boolean:
automation:
- alias: Set soundbar power
id: set_soundbar_power
trigger:
platform: state
entity_id: input_boolean.soundbar_power
......@@ -64,6 +65,7 @@ automation:
service: shell_command.soundbar_power_toggle
- alias: Set soundbar mute
id: set_soundbar_mute
trigger:
platform: state
entity_id: input_boolean.soundbar_mute
......@@ -71,27 +73,30 @@ automation:
service: shell_command.soundbar_mute_toggle
- alias: Set soundbar source
id: set_soundbar_source
trigger:
platform: state
entity_id: input_select.soundbar_source
action:
service_template: >
service: >
shell_command.{% if trigger.to_state.state == 'TV' %}soundbar_source_tv{% elif trigger.to_state.state == 'Aux' %}soundbar_source_aux{% else %}soundbar_source_bluetooth{% endif %}
- alias: Set soundbar effect
id: set_soundbar_effect
trigger:
platform: state
entity_id: input_select.soundbar_effect
action:
service_template: >
service: >
shell_command.{% if trigger.to_state.state == 'Movie' %}soundbar_effect_movie{% elif trigger.to_state.state == 'Night' %}soundbar_effect_night{% else %}soundbar_effect_music{% endif %}
- alias: Set soundbar voice adjust
id: set_soundbar_voice_adjust
trigger:
platform: state
entity_id: input_select.soundbar_voice_adjust
action:
service_template: >
service: >
shell_command.{% if trigger.to_state.state == 'Level 1' %}soundbar_voice_adjust_1{% elif trigger.to_state.state == 'Level 2' %}soundbar_voice_adjust_2{% else %}soundbar_voice_adjust_3{% endif %}
script:
......
......@@ -2,10 +2,10 @@
# vim: set filetype=home-assistant :
# vim: set syntax=yaml :
switch:
platform: kankun
switches:
camera_power:
host: !secret camera_power_host
- platform: kankun
switches:
camera_power:
host: !secret camera_power_host
binary_sensor:
- platform: ping
......@@ -35,6 +35,7 @@ binary_sensor:
automation:
- alias: Reset cameras if connectivity lost
id: reset_cameras
trigger:
- platform: state
entity_id: binary_sensor.driveway_camera_status
......
---
camera:
- platform: onvif
name: Garage
host: 10.0.2.125
port: 8080
---
automation:
- alias: Hall lights bright on
id: hall_lights_bright_on
trigger:
- platform: state
entity_id: sensor.hall_button_near_click
......@@ -18,6 +19,7 @@ automation:
brightness_pct: 100
- alias: Hall lights bright off
id: hall_lights_bright_off
trigger:
- platform: state
entity_id: sensor.hall_button_near_click
......@@ -34,6 +36,7 @@ automation:
entity_id: light.hallway
- alias: Hall lights dim on
id: hall_lights_dim_on
trigger:
- platform: state
entity_id: sensor.hall_button_near_click
......@@ -51,6 +54,7 @@ automation:
brightness_pct: 1
- alias: Hall lights dim off
id: hall_lights_dim_off
trigger:
- platform: state
entity_id: sensor.hall_button_near_click
......
---
#sensor:
# - platform: haveibeenpwned
# email:
......@@ -12,5 +12,4 @@
# - !secret hibp_email8
# - !secret hibp_email9
# - !secret hibp_email10
# - !secret hibp_email11
# - !secret hibp_email11
\ No newline at end of file
---
input_select:
home_mode:
name: "Home Mode"
......@@ -33,6 +33,7 @@ script:
automation:
- alias: Switch Home Mode from NFC tag
id: home_mode_nfc
trigger:
platform: event
event_type: tag_scanned
......@@ -42,6 +43,7 @@ automation:
service: script.home_mode
- alias: Coffee/Lunchtime Lights
id: coffee_lunchtime_lights
trigger:
- platform: state
entity_id: input_select.home_mode
......@@ -54,6 +56,7 @@ automation:
entity_id: script.downlights_bright
- alias: End of Coffee/Lunch Time
id: end_coffee_lunchtime
trigger:
- platform: state
entity_id: input_select.home_mode
......@@ -74,6 +77,7 @@ automation:
option: None
- alias: Evening
id: home_mode_evening
trigger:
- platform: state
entity_id: input_select.home_mode
......@@ -87,6 +91,7 @@ automation:
option: None
- alias: Bedtime
id: home_mode_bedtime
trigger:
- platform: state
entity_id: input_select.home_mode
......@@ -97,5 +102,4 @@ automation:
- service: input_select.select_option
data:
entity_id: input_select.home_mode
option: Night
option: Night
\ No newline at end of file
---
automation:
- alias: Kitchen button downlights on
id: kitchen_button_downlights_on
trigger:
platform: mqtt
topic: 'zigbee2mqtt/kitchen_button'
......@@ -17,6 +18,7 @@ automation:
entity_id: script.downlights_bright
- alias: Kitchen button downlights off
id: kitchen_button_downlights_off
trigger:
platform: mqtt
topic: 'zigbee2mqtt/kitchen_button'
......@@ -33,6 +35,7 @@ automation:
entity_id: light.kitchen_downlights
- alias: Kitchen button dining room on
id: kitchen_button_dining_room_on
trigger:
platform: mqtt
topic: 'zigbee2mqtt/kitchen_button'
......@@ -48,6 +51,7 @@ automation:
entity_id: scene.dining_spots_bright
- alias: Kitchen button dining room off
id: kitchen_button_dining_room_off
trigger:
platform: mqtt
topic: 'zigbee2mqtt/kitchen_button'
......@@ -64,6 +68,7 @@ automation:
entity_id: light.dining_room_spots
- alias: Kitchen button all lights on
id: kitchen_button_all_on
trigger:
platform: mqtt
topic: 'zigbee2mqtt/kitchen_button'
......@@ -85,6 +90,7 @@ automation:
entity_id: script.main_lights
- alias: Kitchen button all lights off
id: kitchen_button_all_off
trigger:
platform: mqtt
topic: 'zigbee2mqtt/kitchen_button'
......@@ -108,6 +114,7 @@ automation:
entity_id: light.living_room_spots
- alias: Kitchen button candlelight dinner
id: kitchen_button_candlelight
trigger:
platform: mqtt
topic: 'zigbee2mqtt/kitchen_button'
......@@ -124,5 +131,4 @@ automation:
- service: light.turn_off
entity_id: light.kitchen_downlights
- service: light.turn_off
entity_id: light.living_room_spots
entity_id: light.living_room_spots
\ No newline at end of file
......@@ -23,6 +23,7 @@ switch:
automation:
- alias: "Mute outdoor speakers when powered down"
id: mute_outdoor_speakers
trigger:
platform: state
entity_id: switch.outdoor_speakers
......@@ -35,6 +36,7 @@ automation:
is_volume_muted: true
- alias: "Unmute outdoor speakers when powered up"
id: unmute_outdoor_speakers
trigger:
platform: state
entity_id: switch.outdoor_speakers
......@@ -47,6 +49,7 @@ automation:
is_volume_muted: false
- alias: 'Turn off TV if idle for 5 minutes'
id: tv_idle_off
trigger:
- platform: state
entity_id: media_player.living_room_kodi
......@@ -83,4 +86,4 @@ automation:
value_template: '{{ states.light.living_room_spots.attributes.rgb_color == [0, 0, 255] or states.light.living_room_spots.attributes.rgb_color == (0, 0, 255) }}'
- service: light.turn_off
data:
entity_id: light.living_room_spots
entity_id: light.living_room_spots
\ No newline at end of file
---
sensor:
- platform: command_line
name: BBC News Summary URL
......@@ -54,6 +54,7 @@ script:
automation:
- alias: 'Auto wake up'
id: auto_wake_up
trigger:
platform: time
at: '07:00:00'
......@@ -75,6 +76,7 @@ automation:
entity_id: script.downlights_bright
- alias: 'Auto wake up (weekend)'
id: auto_wake_up_weekend
trigger:
platform: time
at: '08:00:00'
......@@ -96,6 +98,7 @@ automation:
entity_id: script.downlights_bright
- alias: 'Getting Up'
id: getting_up
trigger:
platform: state
entity_id: !secret device1_charge_status
......@@ -140,5 +143,4 @@ automation:
# message: "The latest news from the BBC follows:"
# - wait_template: "{{ is_state('media_player.living_room_tv', 'stop') }}"
# - service: script.turn_on
# entity_id: script.play_news_summary
# entity_id: script.play_news_summary
\ No newline at end of file
---
automation:
- alias: 'Set movie scene when watching TV in the evening'
......
......@@ -17,6 +17,7 @@ input_boolean:
automation:
- alias: "Greenhouse High Temperature Notification"
id: greenhouse_high_notify
trigger:
platform: numeric_state
entity_id: sensor.temperatureandhumidity_3_1
......@@ -32,7 +33,9 @@ automation:
data_template:
title: "Greenhouse Temperature High!"
message: "The greenhouse temperature is {{ states.sensor.temperatureandhumidity_3_1.state }}{{ states.sensor.temperatureandhumidity_3_1.attributes.unit_of_measurement }}. You may wish to open the door and check if the plants need watering."
- alias: "Greenhouse Low Temperature Notification"
id: greenhouse_low_notification
trigger:
platform: numeric_state
entity_id: sensor.temperatureandhumidity_3_1
......
......@@ -25,6 +25,7 @@ input_boolean:
automation:
- alias: 'Night light 1 on at bedtime'
id: night_light1_bedtime
trigger:
platform: time
at: '19:30:00'
......@@ -36,6 +37,7 @@ automation:
brightness_pct: 80
- alias: 'Night light 2 on at bedtime'
id: night_light2_bedtime
trigger:
platform: time
at: '19:15:00'
......@@ -47,6 +49,7 @@ automation:
brightness_pct: 80
- alias: 'Night lights red at 5am'
id: night_lights_red
trigger:
platform: time
at: '05:00:00'
......@@ -63,6 +66,7 @@ automation:
brightness_pct: 80
- alias: 'Night lights blue for quiet time'
id: night_lights_blue
trigger:
platform: time
at: input_datetime.wakeup_time_quiet
......@@ -93,6 +97,7 @@ automation:
brightness_pct: 80
- alias: 'Night lights green in morning (workdays)'
id: night_lights_green_workday
trigger:
platform: time
at: input_datetime.wakeup_time_weekday
......@@ -124,6 +129,7 @@ automation:
entity_id: !secret night_light2
- alias: 'Night light green in morning (non-workdays)'
id: night_lights_green_non_workday
trigger:
platform: time
at: input_datetime.wakeup_time_weekend_holiday
......@@ -152,4 +158,4 @@ automation:
- service: light.turn_off
entity_id: !secret night_light1
- service: light.turn_off
entity_id: !secret night_light2
entity_id: !secret night_light2
\ No newline at end of file
---
automation:
- alias: "Night mode kitchen light on"
id: night_mode_kitchen_light_on
trigger:
- platform: state
entity_id: binary_sensor.kitchen_hall_door_contact
......@@ -17,6 +18,7 @@ automation:
entity_id: scene.goodnight
- alias: "Night mode kitchen light off"
id: night_mode_kitchen_light_off
trigger:
- platform: state
entity_id: binary_sensor.kitchen_hall_door_contact
......@@ -31,5 +33,4 @@ automation:
action:
- alias: Light Off
service: light.turn_off
entity_id: light.yeelight_color1_34ce0084fb1d
entity_id: light.yeelight_color1_34ce0084fb1d
\ No newline at end of file
......@@ -11,6 +11,7 @@ input_boolean:
automation:
- alias: "Activate Away Mode"
id: away_mode_activate
trigger:
- platform: state
entity_id: !secret person1_entity
......@@ -49,6 +50,7 @@ automation:
entity_id: input_boolean.away_mode
- alias: "Deactivate Away Mode"
id: away_mode_deactivate
trigger:
- platform: state
entity_id: !secret person1_entity
......@@ -62,4 +64,4 @@ automation:
entity_id: input_boolean.away_mode
- service: input_boolean.turn_off
data:
entity_id: input_boolean.vacation_mode
entity_id: input_boolean.vacation_mode
\ No newline at end of file
......@@ -46,4 +46,4 @@ automation:
after_offset: "-00:20:00"
action:
service: script.turn_on
entity_id: script.main_lights
entity_id: script.main_lights
\ No newline at end of file
......@@ -65,6 +65,7 @@ sensor:
automation:
- alias: Low Battery Notification
id: low_battery_notification
trigger:
- platform: numeric_state
entity_id: sensor.test_battery
......@@ -90,6 +91,7 @@ automation:
title: "Low Battery Alert"
message: "Device '{{ trigger.to_state.name }}' has LOW battery: {{ trigger.to_state.state }}%."
- alias: Critical Battery Notification
id: critical_battery_notification
trigger:
- platform: numeric_state
entity_id: sensor.test_battery
......@@ -116,6 +118,7 @@ automation:
message: "Device '{{ trigger.to_state.name }}' has CRITICAL battery: {{ trigger.to_state.state }}%."
- alias: Auto-reset Room Sensors
id: room_sensor_auto_reset
trigger:
- platform: state
entity_id: binary_sensor.toilet_sensor_status
......@@ -134,6 +137,7 @@ automation:
message: "Device '{{ trigger.to_state.name }}' was offline for 10 minutes, room sensors reset."
- alias: Notify on startup
id: startup_notify
trigger:
- platform: homeassistant
event: start
......@@ -144,6 +148,7 @@ automation:
message: "Home Assistant has been started up!"
- alias: Notify on shutdown
id: shutdown_notify
trigger:
- platform: homeassistant
event: shutdown
......@@ -151,4 +156,4 @@ automation:
- service: notify.notify
data:
title: "Home Assistant Shutdown"
message: "Home Assistant is shutting down!"
message: "Home Assistant is shutting down!"
\ No newline at end of file
---
automation:
- alias: Toilet button light bright
id: toilet_button_light_bright_on
trigger:
platform: mqtt
topic: 'zigbee2mqtt/toilet_button'
......@@ -18,6 +19,7 @@ automation:
brightness_pct: 100
- alias: Toilet button light off
id: toilet_button_light_bright_off
trigger:
platform: mqtt
topic: 'zigbee2mqtt/toilet_button'
......@@ -34,6 +36,7 @@ automation:
entity_id: light.toilet
- alias: Toilet button light dim
id: toilet_button_light_dim_on
trigger:
platform: mqtt
topic: 'zigbee2mqtt/toilet_button'
......@@ -51,6 +54,7 @@ automation:
brightness_pct: 1
- alias: Toilet button light off from dim
id: toilet_button_light_dim_off
trigger:
platform: mqtt
topic: 'zigbee2mqtt/toilet_button'
......@@ -64,5 +68,4 @@ automation:
action:
service: light.turn_off
data:
entity_id: light.toilet
entity_id: light.toilet
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment