Skip to content

Instantly share code, notes, and snippets.

- id: morning_wake_up_routine
alias: Morning Wake up Routine
initial_state: 'off'
condition:
condition: and
conditions:
- condition: state
entity_id: group.evening_night_light
state: 'on'
- condition: time
bedtime:
alias: Bedtime
sequence:
- service: script.turn_on
data:
entity_id: script.air_on_check
- service: homeassistant.turn_on
entity_id: light.bedroom_lamp
data:
brightness: 5
evening_night_light:
name: Evening Night Light
entities:
- automation.night_light_toggle_on
- automation.night_light_toggle_off
- alias: Night Light Toggle OFF
trigger:
- platform: state
entity_id: binary_sensor.door_window_sensor_158d0001ab573f
from: 'on'
to: 'off'
action:
service: light.turn_off
entity_id:
- light.gateway_light_34ce008d4aae
- alias: Night Light Toggle ON
trigger:
- platform: state
entity_id: binary_sensor.door_window_sensor_158d0001ab573f
from: 'off'
to: 'on'
action:
service: homeassistant.turn_on
entity_id: light.gateway_light_34ce008d4aae
data:
- platform: template
sensors:
front_door:
friendly_name: "Front Door"
value_template: >-
{% if is_state('binary_sensor.door_window_sensor_158d0001ab56bd', 'on') %}
Open
{% else %}
Closed
{% endif %}
- alias: toggle both lamps on long press
trigger:
platform: event
event_type: click
event_data:
entity_id: binary_sensor.switch_158d0001e61312
click_type: long_click_press
action:
service: switch.toggle
entity_id:
- alias: toggle entry lamp on double press
trigger:
platform: event
event_type: click
event_data:
entity_id: binary_sensor.switch_158d0001e61312
click_type: double
action:
service: switch.toggle
entity_id: switch.entry
- alias: toggle lamp on single press
trigger:
platform: event
event_type: click
event_data:
entity_id: binary_sensor.switch_158d0001e61312
click_type: single
action:
service: switch.toggle
entity_id: switch.lamp
sound_effect:
alias: Music Box
sequence:
- service: xiaomi_aqara.play_ringtone
data:
gw_mac: xxxxxxxxxxxx
ringtone_id: 27