Skip to content

Instantly share code, notes, and snippets.

@tomduijf
Last active February 20, 2024 23:57
Show Gist options
  • Save tomduijf/928e41853165135e509f to your computer and use it in GitHub Desktop.
Save tomduijf/928e41853165135e509f to your computer and use it in GitHub Desktop.
Home Assistant configuration
#################################################################
## Main and component setup
#################################################################
homeassistant:
# Name of the location where Home Assistant is running
name: Home
# Location required to calculate the time the sun rises and sets
latitude: [REDACTED]
longitude: [REDACTED]
# C for Celcius, F for Fahrenheit
temperature_unit: C
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: Europe/Amsterdam
customize:
sensor.weather_cloud_cover:
hidden: true
sensor.weather_precip:
hidden: true
sensor.weather_precip_intensity:
friendly_name: 'Rainfall'
sensor.weather_humidity:
friendly_name: 'Outdoor humidity'
sensor.weather_temperature:
friendly_name: 'Outdoor temperature'
media_player.phonexs:
hidden: true
media_player.tug:
hidden: true
script.useless_switch:
hidden: true
script.script_test:
hidden: true
script.action_sunrise:
hidden: true
script.action_sundown:
hidden: true
scene.woonkamer_ochtend:
hidden: true
#debugger:
http:
#api_password: mypass
# Set to 1 to enable development mode
# development: 1
device_tracker:
- platform: snmp
track_new_devices: no
host: 10.10.10.11
community: [REDACTED]
baseoid: 1.3.6.1.4.1.14988.1.1.1.2.1.1
- platform: snmp
track_new_devices: no
host: 10.10.10.13
community: [REDACTED]
baseoid: 1.3.6.1.4.1.14988.1.1.1.2.1.1
- platform: snmp
track_new_devices: no
host: 10.10.10.12
community: [REDACTED]
baseoid: 1.3.6.1.4.1.14988.1.1.1.2.1.1
media_player:
- platform: sonos
- platform: plex
sensor:
- platform: forecast
api_key: [REDACTED]
monitored_conditions:
- temperature
- summary
- precip_type
- precip_intensity
- cloud_cover
light:
platform: hue
switch:
- platform: mock
switches:
# Mock switch demo
Useless: off
script_test: off
downloader:
download_dir: downloads
logbook:
history:
discovery:
#conversation:
sun:
#################################################################
## Groups
#################################################################
group:
Thuis:
- group.woonkamer
- group.boven
Woonkamer:
- scene.woonkamer_normaal
- scene.woonkamer_romantic
- light.woonkamer_hanglamp
- light.woonkamer_eettafel
- light.woonkamer_tvlamp
- media_player.rasplex
Boven:
- light.overloop
- light.slaapkamer_tomfem
People:
- device_tracker.tom_phone
- device_tracker.femke_phone
- device_tracker.mam_phone
Weather:
- sun.sun
- sensor.weather_summary
- sensor.humidity
- sensor.weather_temperature
- sensor.weather_precip
- sensor.weather_precip_intensity
- sensor.weather_cloud_coverage
Achtertuin:
- media_player.portable
Testing:
- switch.useless
- switch.script_test
- script.script_debugger
#################################################################
## Scenes
#################################################################
scene:
- name: Woonkamer Normaal
entities:
light.woonkamer_eettafel:
state: on
transition: 2
brightness: 150
xy_color: [ 0.4448, 0.4066 ]
light.woonkamer_hanglamp:
state: on
transition: 2
brightness: 215
xy_color: [ 0.4448, 0.4066 ]
light.woonkamer_tvlamp:
state: on
transition: 2
brightness: 125
xy_color: [ 0.5013, 0.4242 ]
- name: Woonkamer Ochtend
entities:
light.woonkamer_eettafel:
state: on
transition: 2
brightness: 135
xy_color: [ 0.3151, 0.3251 ]
light.woonkamer_hanglamp:
state: on
transition: 2
brightness: 85
xy_color: [ 0.3151, 0.3251 ]
light.woonkamer_tvlamp:
transition: 2
state: off
- name: Woonkamer Romantic
entities:
light.woonkamer_eettafel:
state: on
transition: 2
brightness: 75
xy_color: [ 0.5926, 0.3814 ]
light.woonkamer_hanglamp:
state: on
transition: 2
brightness: 145
xy_color: [ 0.5529, 0.4107 ]
light.woonkamer_tvlamp:
state: on
transition: 2
brightness: 105
xy_color: [ 0.5013, 0.4242 ]
#################################################################
## Automations
#################################################################
automation:
- action: "RasPlex paused"
trigger:
- platform: state
entity_id: media_player.rasplex
from: 'playing'
condition:
- platform: state
entity_id: sun.sun
state: 'below_horizon'
action:
service: scene.turn_on
entity_id: scene.woonkamer_normaal
- alias: "RasPlex playing"
trigger:
- platform: state
entity_id: media_player.rasplex
to: 'playing'
condition:
- platform: state
entity_id: sun.sun
state: 'below_horizon'
action:
service: scene.turn_on
entity_id: scene.woonkamer_romantic
- alias: "Sunrise dawn"
trigger:
- platform: time
after: "06:30:00"
condition:
- platform: state
entity_id: sun.sun
state: below_horizon
action:
service: homeassistant.turn_on
entity_id: script.action_sunrise
- alias: 'Sunrise - Lights off'
trigger:
- platform: sun
event: sunrise
offset: '00:30:00'
action:
service: light.turn_off
entity_id:
- group.woonkamer
- group.boven
data:
transition: 1800
- alias: "Sunset dusk"
trigger:
- platform: sun
event: sunset
offset: '-01:30:00'
action:
service: homeassistant.turn_on
entity_id: script.sunset_dusk
- alias: 'Sunset'
trigger:
- platform: sun
event: sunset
action:
service: light.turn_on
entity_id: light.overloop
data:
brightness: 5
- alias: 'Night/Bed time'
trigger:
- platform: time
after: '23:30:00'
action:
service: light.turn_off
entity_id:
- light.beneden_eettafel
- light.beneden_tvlamp
data:
transition: 900
- alias: 'Night/Turn all off at night'
trigger:
- platform: time
after: '00:30:00'
action:
service: light.turn_off
entity_id:
- group.boven
- group.woonkamer
############## Test & debugging helpers ########
- alias: "The useless switch"
trigger:
- platform: state
entity_id: switch.useless
to: 'on'
action:
service: script.turn_on
entity_id: script.useless_switch
# Mock switch demo
- alias: "switch test"
trigger:
- platform: state
entity_id: switch.script_test
to: 'on'
action:
service: script.turn_on
entity_id: script.script_test
################################################################
## Scripts
#################################################################
script:
action_sunrise:
alias: Sunrise dawn
sequence:
- service: light.turn_on
service_data:
entity_id: light.overloop
transition: 5
brightness: 5
xy_color: [ 0.3151, 0.3251 ]
- delay:
minutes: 10
- service: scene.turn_on
service_data:
entity_id: scene.woonkamer_ochtend
transition: 5
action_sundown:
alias: Sunset dusk
sequence:
- service: scene.turn_on
service_data:
entity_id: scene.woonkamer_normaal
transition: 600
- delay:
minutes: 30
- service: light.turn_on
service_data:
entity_id: light.overloop
transition: 30
brightness: 200
xy_color: [ 0.4448, 0.4066 ]
############## Test & debugging helpers ########
script_debugger:
alias: debugger
sequence:
- service: debugger.turn_on
service_data:
entity_id: debugger.debugger
script_test:
alias: dit is een test
sequence:
- service: light.turn_on
service_data:
entity_id: light.woonkamer_eettafel
color_temp: 154
brightness: 250
- delay:
seconds: 5
- service: light.turn_on
service_data:
entity_id: light.woonkamer_eettafel
brightness: 100
color_temp: 500
- service: switch.turn_off
service_data:
entity_id: switch.script_test
useless_switch:
alias: Useless switch/Turn off
sequence:
- delay:
seconds: 2
- service: homeassistant.turn_off
service_data:
entity_id: switch.useless
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment