Skip to content

Instantly share code, notes, and snippets.

@manuelbernhardt
Created June 25, 2020 11:22
Show Gist options
  • Save manuelbernhardt/522e4c780c060195e1b7910647f38e8d to your computer and use it in GitHub Desktop.
Save manuelbernhardt/522e4c780c060195e1b7910647f38e8d to your computer and use it in GitHub Desktop.
Home assistant configuration for Tradfri
- id: '1'
alias: Restore Light at day entrance
trigger:
- entity_id: light.entrance_spot_1,light.entrance_spot_2,light.entrance_spot_3,light.entrance_spot_4
from: 'off'
platform: state
to: 'on'
- entity_id: light.entrance_spot_1,light.entrance_spot_2,light.entrance_spot_3,light.entrance_spot_4
from: unavailable
platform: state
to: 'on'
condition:
- after: 07:00:00
before: '19:00:00'
condition: time
action:
- data:
brightness: 203
color_temp: 370
entity_id:
- light.entrance_spot_1
- light.entrance_spot_2
- light.entrance_spot_3
- light.entrance_spot_4
service: light.turn_on
- id: '2'
alias: Restore Light at day bedroom
trigger:
- platform: state
entity_id:
- light.ceiling_bulb
from: 'off'
to: 'on'
- platform: state
entity_id:
- light.ceiling_bulb
from: unavailable
to: 'on'
condition:
condition: time
after: 07:00:00
before: '19:00:00'
action:
- service: light.turn_on
data:
entity_id:
- light.ceiling_bulb
brightness: 203
color_temp: 370
- id: '3'
alias: Restore Light at day kitchen
trigger:
- platform: state
entity_id:
- light.kitchen_spot_1
- light.kitchen_spot_2
- light.kitchen_spot_3
from: 'off'
to: 'on'
- platform: state
entity_id:
- light.kitchen_spot_1
- light.kitchen_spot_2
- light.kitchen_spot_3
from: unavailable
to: 'on'
condition:
condition: time
after: 07:00:00
before: '19:00:00'
action:
- service: light.turn_on
data:
entity_id:
- light.kitchen_spot_1
- light.kitchen_spot_2
- light.kitchen_spot_3
brightness: 203
color_temp: 370
- id: '4'
alias: Restore Light at day bathoom
trigger:
- platform: state
entity_id:
- light.bulb_mirror_1
- light.bulb_mirror_2
- light.spot_bathroom_1
- light.spot_bathroom_2
- light.spot_bathroom_3
- light.bathroom_spot_4
- light.bathroom_spot_5
from: 'off'
to: 'on'
- platform: state
entity_id:
- light.bulb_mirror_1
- light.bulb_mirror_2
- light.spot_bathroom_1
- light.spot_bathroom_2
- light.spot_bathroom_3
- light.bathroom_spot_4
- light.bathroom_spot_5
from: unavailable
to: 'on'
condition:
condition: time
after: 07:00:00
before: '19:00:00'
action:
- service: light.turn_on
data:
entity_id:
- light.bulb_mirror_1
- light.bulb_mirror_2
- light.spot_bathroom_1
- light.spot_bathroom_2
- light.spot_bathroom_3
- light.bathroom_spot_4
- light.bathroom_spot_5
brightness: 203
color_temp: 370
- id: '5'
alias: Restore Light at day living room
trigger:
- platform: state
entity_id:
- light.spot_living_room
- light.sofa_licht
from: 'off'
to: 'on'
- platform: state
entity_id:
- light.spot_living_room
- light.sofa_licht
from: unavailable
to: 'on'
condition:
condition: time
after: 07:00:00
before: '19:00:00'
action:
- service: light.turn_on
data:
entity_id:
- light.spot_living_room
- light.sofa_licht
brightness: 203
color_temp: 370
- id: '6'
alias: Restore Light at day kids bedroom
trigger:
- platform: state
entity_id:
- light.kid_bedroom_1
- light.ceiling
from: 'off'
to: 'on'
- platform: state
entity_id:
- light.kid_bedroom_1
- light.ceiling
from: unavailable
to: 'on'
condition:
condition: time
after: 07:00:00
before: '19:00:00'
action:
- service: light.turn_on
data:
entity_id:
- light.kid_bedroom_1
- light.ceiling
brightness: 203
color_temp: 370
- id: '7'
alias: Restore Light at day toilet
trigger:
- platform: state
entity_id:
- light.toilet_spot
from: 'off'
to: 'on'
- platform: state
entity_id:
- light.toilet_spot
from: unavailable
to: 'on'
condition:
condition: time
after: 07:00:00
before: '19:00:00'
action:
- service: light.turn_on
data:
entity_id:
- light.toilet_spot
brightness: 203
color_temp: 370
- id: '8'
alias: Dim Light at night entrance
trigger:
- entity_id:
- light.entrance_spot_1
- light.entrance_spot_2
- light.entrance_spot_3
- light.entrance_spot_4
from: 'off'
platform: state
to: 'on'
- entity_id:
- light.entrance_spot_1
- light.entrance_spot_2
- light.entrance_spot_3
- light.entrance_spot_4
from: unavailable
platform: state
to: 'on'
- at: '19:00:00'
platform: time
condition:
- condition: time
after: '19:00:00'
before: '06:00:00'
action:
- service: light.turn_on
data:
entity_id:
- light.entrance_spot_1
- light.entrance_spot_2
- light.entrance_spot_3
- light.entrance_spot_4
brightness: 2
color_temp: 454
- id: '9'
alias: Dim Light at night bedroom parents
trigger:
- entity_id:
- light.ceiling_bulb
from: 'off'
platform: state
to: 'on'
- entity_id:
- light.ceiling_bulb
from: unavailable
platform: state
to: 'on'
- at: '19:00:00'
platform: time
condition:
- condition: time
after: '19:00:00'
before: '06:00:00'
action:
- service: light.turn_on
data:
entity_id:
- light.ceiling_bulb
brightness: 2
color_temp: 454
- id: '10'
alias: Dim Light at night kitchen
trigger:
- entity_id:
- light.kitchen_spot_1
- light.kitchen_spot_2
- light.kitchen_spot_3
from: 'off'
platform: state
to: 'on'
- entity_id:
- light.kitchen_spot_1
- light.kitchen_spot_2
- light.kitchen_spot_3
from: unavailable
platform: state
to: 'on'
- at: '19:00:00'
platform: time
condition:
- condition: time
after: '19:00:00'
before: '06:00:00'
action:
- service: light.turn_on
data:
entity_id:
- light.kitchen_spot_1
- light.kitchen_spot_2
- light.kitchen_spot_3
brightness: 2
color_temp: 454
- id: '11'
alias: Dim Light at night bedroom kids
trigger:
- entity_id:
- light.kid_bedroom_1
- light.ceiling
from: 'off'
platform: state
to: 'on'
- entity_id:
- light.kid_bedroom_1
- light.ceiling
from: unavailable
platform: state
to: 'on'
- at: '19:00:00'
platform: time
condition:
- condition: time
after: '19:00:00'
before: '06:00:00'
action:
- service: light.turn_on
data:
entity_id:
- light.kid_bedroom_1
- light.ceiling
brightness: 2
color_temp: 454
- id: '12'
alias: Dim Light at night living room
trigger:
- entity_id:
- light.spot_living_room
- light.sofa_licht
from: 'off'
platform: state
to: 'on'
- entity_id:
- light.spot_living_room
- light.sofa_licht
from: unavailable
platform: state
to: 'on'
- at: '19:00:00'
platform: time
condition:
- condition: time
after: '19:00:00'
before: '06:00:00'
action:
- service: light.turn_on
data:
entity_id:
- light.spot_living_room
- light.sofa_licht
brightness: 2
color_temp: 454
- id: '13'
alias: Dim Light at night bathroom
trigger:
- entity_id:
- light.bulb_mirror_1
- light.bulb_mirror_2
- light.spot_bathroom_1
- light.spot_bathroom_2
- light.spot_bathroom_3
- light.bathroom_spot_4
- light.bathroom_spot_5
from: 'off'
platform: state
to: 'on'
- entity_id:
- light.bulb_mirror_1
- light.bulb_mirror_2
- light.spot_bathroom_1
- light.spot_bathroom_2
- light.spot_bathroom_3
- light.bathroom_spot_4
- light.bathroom_spot_5
from: unavailable
platform: state
to: 'on'
- at: '19:00:00'
platform: time
condition:
- condition: time
after: '19:00:00'
before: '06:00:00'
action:
- service: light.turn_on
data:
entity_id:
- light.bulb_mirror_1
- light.bulb_mirror_2
- light.spot_bathroom_1
- light.spot_bathroom_2
- light.spot_bathroom_3
- light.bathroom_spot_4
- light.bathroom_spot_5
brightness: 2
color_temp: 454
- id: '14'
alias: Dim Light at night toilet
trigger:
- entity_id:
- light.toilet_spot
from: 'off'
platform: state
to: 'on'
- entity_id:
- light.toilet_spot
from: unavailable
platform: state
to: 'on'
- at: '19:00:00'
platform: time
condition:
- condition: time
after: '19:00:00'
before: '06:00:00'
action:
- service: light.turn_on
data:
entity_id:
- light.toilet_spot
brightness: 2
color_temp: 454
- id: '1592905095081'
alias: Update tradfri state
description: ''
trigger:
- platform: time_pattern
seconds: '10'
condition: []
action:
- data: {}
service: python_script.update_tradfri
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment