Created
September 4, 2018 00:22
-
-
Save smarthomehobby/ef351e21aebac80ea5e4d8e9c42ee02c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################ | |
## Double Key Wireless Switch Automations, Scripts, and Bedtime Script Setup | |
################################################################################ | |
#Put this in configuration.yaml | |
input_number: | |
bedtime_trigger: | |
name: Bedtime Trigger | |
min: 0 | |
max: 3 | |
step: 1 | |
#Put this in automations.yaml | |
- id: living_room_wall_switch_left | |
alias: Living Room Wall Switch Left | |
initial_state: 'on' | |
trigger: | |
platform: event | |
event_type: click | |
event_data: | |
entity_id: binary_sensor.wall_switch_left_158d00016405ac | |
click_type: single | |
action: | |
- service: homeassistant.turn_on | |
data_template: | |
entity_id: > | |
{% if is_state("input_number.bedtime_trigger", "3.0") %} | |
script.bedtime_living_room | |
{%-elif is_state("input_number.bedtime_trigger", "1.0") %} | |
script.bedtime_living_room | |
{% else %} | |
script.living_room_lamp_toggle | |
{% endif %} | |
- id: living_room_wall_switch_right | |
alias: Living Room Wall Switch Right | |
initial_state: 'on' | |
trigger: | |
platform: event | |
event_type: click | |
event_data: | |
entity_id: binary_sensor.wall_switch_right_158d00016405ac | |
click_type: single | |
action: | |
- service: homeassistant.turn_on | |
data_template: | |
entity_id: > | |
{% if is_state("input_number.bedtime_trigger", "3.0") %} | |
script.bedtime_bedroom | |
{%-elif is_state("input_number.bedtime_trigger", "2.0") %} | |
script.bedtime_bedroom | |
{% else %} | |
script.entry_toggle | |
{% endif %} | |
- id: living_room_wall_switch_both | |
alias: Living Room Wall Switch Both | |
initial_state: 'on' | |
trigger: | |
platform: event | |
event_type: click | |
event_data: | |
entity_id: binary_sensor.wall_switch_both_158d00016405ac | |
click_type: both | |
action: | |
- service: switch.toggle | |
entity_id: switch.fish_tank_light | |
#Put this in scripts.yaml | |
bedtime_bedroom: | |
alias: "Bedtime Bedroom" | |
sequence: | |
- service: input_number.decrement | |
entity_id: input_number.bedtime_trigger | |
- service: input_number.decrement | |
entity_id: input_number.bedtime_trigger | |
- service: homeassistant.turn_on | |
entity_id: light.bedroom_lamp | |
data: | |
brightness: 5 | |
- service: homeassistant.turn_on | |
entity_id: | |
- switch.bedroom_fan | |
- group.evening_night_light | |
- service: homeassistant.turn_off | |
entity_id: | |
- switch.entry | |
- service: homeassistant.turn_on | |
entity_id: light.gateway_light_34ce008d4aae | |
data: | |
rgb_color: [255, 103, 23] | |
bedtime_living_room: | |
alias: "Bedtime Living Room" | |
sequence: | |
- service: input_number.decrement | |
entity_id: input_number.bedtime_trigger | |
- service: homeassistant.turn_off | |
entity_id: | |
- switch.tv | |
- switch.air_conditioner | |
- switch.entry | |
- service: homeassistant.turn_on | |
entity_id: script.fans_off | |
- wait_template: "{{is_state('binary_sensor.door_window_sensor_158d0001e59f8e', 'on')}}" | |
- wait_template: "{{is_state('binary_sensor.door_window_sensor_158d0001e59f8e', 'off')}}" | |
- service: homeassistant.turn_off | |
entity_id: | |
- light.lamp | |
- switch.fish_tank_light | |
- switch.christmas_tree | |
- service: homeassistant.turn_on | |
entity_id: | |
- automation.nighttime_living_room | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment