SHARE
TWEET

HA CONFIG + AUTOMATIONS

duquesne9 Dec 28th, 2017 (edited) 116 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. homeassistant:
  2.   # Name of the location where Home Assistant is running
  3.   name: Home
  4.   # Location required to calculate the time the sun rises and sets
  5.   latitude: 38.1628
  6.   longitude: -85.52
  7.   # Impacts weather/sunrise data (altitude above sea level in meters)
  8.   elevation: 179
  9.   # metric for Metric, imperial for Imperial
  10.   unit_system: imperial
  11.   # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  12.   time_zone: America/Kentucky/Louisville
  13.   customize: !include customize.yaml
  14.  
  15. # Show links to resources in log and frontend
  16. #introduction:
  17.  
  18. # Enables the frontend
  19. frontend:
  20.  
  21. http:
  22.   # Uncomment this to add a password (recommended!)
  23.   # api_password: PASSWORD
  24.   # Uncomment this if you are using SSL or running in Docker etc
  25.   # base_url: example.duckdns.org:8123
  26.  
  27. # Checks for available updates
  28. updater:
  29.  
  30. # Discover some devices automatically
  31. discovery:
  32.  
  33. # Allows you to issue voice commands from the frontend in enabled browsers
  34. conversation:
  35.  
  36. # Enables support for tracking state changes over time.
  37. history:
  38.  
  39. # View all events in a logbook
  40. logbook:
  41.  
  42. # Track the sun
  43.  
  44.  
  45. # Text to speech
  46. tts:
  47.   platform: google
  48.  
  49. light:
  50.   - platform: lifx
  51.     allow unreachable: true
  52.  
  53. rest_command:
  54.   cube_off:
  55.     url: 'http://192.168.1.101/ledsoff?fade=1000'
  56.   cube_evening:
  57.     url: 'http://192.168.1.101/wave4?r=240&g=75&b=20&fade=1000'
  58.   cube_christmas:
  59.     url: 'http://192.168.1.101/christmas?fade=1000'
  60.   cube_morning:
  61.     url: 'http://192.168.1.101/wave4?r=50&g=100&b=255&fade=1000'
  62.   cube_hanukkah:
  63.     url: 'http://192.168.1.101/hanukkah?fade=1000'
  64.  
  65.  
  66. automation: !include automations.yaml
  67. input_boolean: !include inputbool.yaml
  68. input_number: !include inputnumber.yaml
  69. script: !include scripts.yaml
  70. sensor: !include sensors.yaml
  71.  
  72. group:
  73.   cube:
  74.     name: Cube
  75.     entities:
  76.       - script.cube_out
  77.       - script.morning
  78.       - script.evening
  79.       - script.hanukkah
  80.       - script.christmas
  81.  
  82.   randoms:
  83.     name: Randoms
  84.     entities:
  85.       - sensor.date
  86.       - sensor.pihole
  87.       - sensor.time
  88.       - sensor.worldclock_sensor
  89.       - sensor.yr_symbol
  90.       - sun.sun
  91.   alarm_clock:
  92.     name: 'Alarm Clock'
  93.     entities:
  94.       - sensor.alarm_clock_time
  95.       - input_number.alarm_clock_hour
  96.       - input_number.alarm_clock_minute
  97.       - input_boolean.alarm_clock_status
  98.  
  99. ##############################################
  100.  
  101. ##############AUTOMATIONS.YAML################
  102.  
  103. ##############################################
  104.  
  105.   - alias: 'Hue light on gradually with alarm'
  106.     hide_entity: False
  107.     trigger:
  108.       platform: template
  109.       value_template: '{{ states.sensor.time.state == states.sensor.alarm_clock_time_long.state }}'
  110.     condition:
  111.       condition: state
  112.       entity_id: input_boolean.alarm_clock_status
  113.       state: 'on'
  114.     action:
  115.       service: script.wake_up
  116.  
  117.  
  118. ###############
  119.  
  120. SCRIPTS.YAML
  121.  
  122. ################
  123.  
  124.   # Turns on the bedroom lights and then the living room lights 1 minute later
  125.  
  126.   morning:
  127.     alias: Cube Morning
  128.     sequence:
  129.       # This is Home Assistant Script Syntax
  130.       - service: rest_command.cube_morning
  131.  
  132.   evening:
  133.     alias: Cube Evening
  134.     sequence:
  135.       # This is Home Assistant Script Syntax
  136.       - service: rest_command.cube_evening
  137.  
  138.   cube_out:
  139.     alias: Cube Off
  140.     sequence:
  141.       # This is Home Assistant Script Syntax
  142.       - service: rest_command.cube_off
  143.  
  144.   hanukkah:
  145.     alias: Cube Hanukkah
  146.     sequence:
  147.       # This is Home Assistant Script Syntax
  148.       - service: rest_command.cube_hanukkah
  149.  
  150.   christmas:
  151.     alias: Cube Christmas
  152.     sequence:
  153.       # This is Home Assistant Script Syntax
  154.       - service: rest_command.cube_christmas
  155.  
  156.   wake_up:
  157.     sequence:
  158.       - service: light.turn_on
  159.         data:
  160.           entity_id: group.lights
  161.           brightness: 255
  162.           transition: 300
  163. #      - service: homeassistant.turn_off
  164. #        entity_id: switch.smart_switch1
  165.   go_to_sleep:
  166.     sequence:
  167.       - service: light.turn_off
  168.         data:
  169.           entity_id: group.lights
  170. #          brightness: 0
  171.           transition: 300
  172.  
  173.  
  174. #############
  175.  
  176. SENSORS.YAML
  177.  
  178. #############
  179.  
  180.  
  181.   - platform: time_date
  182.     display_options:
  183.       - 'time'
  184.  
  185.  
  186.   - platform: template
  187.     sensors:
  188.       alarm_clock_hour:
  189.         value_template: '{{ states.input_number.alarm_clock_hour.state | int }}'
  190.       alarm_clock_minute:
  191.         value_template: '{{ states.input_number.alarm_clock_minute.state | int }}'
  192.       alarm_clock_time:
  193.         value_template: >-
  194.           {{ states.sensor.alarm_clock_hour.state }}:
  195.           {%- if states.sensor.alarm_clock_minute.state|length == 1 -%}
  196.             0
  197.           {%- endif -%}
  198.             {{ states.sensor.alarm_clock_minute.state }}
  199.       alarm_clock_time_long:
  200.         value_template: >-
  201.           {% if states.sensor.alarm_clock_hour.state|length == 1 -%}
  202.             0
  203.           {%- endif -%}
  204.             {{ states.sensor.alarm_clock_hour.state }}:
  205.           {%- if states.sensor.alarm_clock_minute.state|length == 1 -%}
  206.             0
  207.           {%- endif -%}
  208.             {{ states.sensor.alarm_clock_minute.state }}
  209.  
  210.  
  211. ###########
  212. INPUTBOOLEAN.YAML
  213. ############
  214.  
  215.   alarm_clock_status:
  216.     initial: off
  217.  
  218. ###################
  219. INPUTNUMBER.YAML
  220. ##################
  221.  
  222.   alarm_clock_hour:
  223.     initial: 6
  224.     min: 0
  225.     max: 23
  226.     step: 1
  227.   alarm_clock_minute:
  228.     initial: 15
  229.     min: 0
  230.     max: 55
  231.     step: 5
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top