Skip to content

Commit

Permalink
Added Awtrix light integration to automations.
Browse files Browse the repository at this point in the history
  • Loading branch information
dannytsang committed Oct 29, 2023
1 parent a8bb612 commit b1be2ce
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 10 deletions.
21 changes: 21 additions & 0 deletions packages/integrations/awtrix_light.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Created by Danny Tsang <danny@tsang.uk>

script:
send_bedroom_clock_notification:
alias: Send Bedroom Clock Notification
fields:
message:
description: Message to post
required: true
selector:
text:
multiline: true
sequence:
- service: mqtt.publish
data:
topic: "{{ states('sensor.bedroom_clock_device_topic')}}/notify"
payload_template: >-
"{
'text': '{{ message }}',
'duration': 5
}"
9 changes: 9 additions & 0 deletions packages/integrations/sleep_as_android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,15 @@ automation:
title: ":zzz: Sleep as :robot_face: Android"
log_level: "Normal"
default: []
- if:
- condition: state
entity_id: light.bedroom_clock_matrix
state: "off"
then:
- service: light.turn_on
data: {}
target:
entity_id: light.bedroom_clock_matrix
mode: single
- id: "1667424349110"
alias: "Sleep As Android: Stop Sleep Timer"
Expand Down
39 changes: 29 additions & 10 deletions packages/rooms/bedroom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,15 @@ automation:
target:
entity_id: scene.bedroom_dim_ambient_light
default: []
- if:
- condition: state
entity_id: light.bedroom_clock_matrix
state: "off"
then:
- service: light.turn_on
data: {}
target:
entity_id: light.bedroom_clock_matrix
mode: single
- id: "1621713867762"
alias: "Bedroom: No Motion"
Expand Down Expand Up @@ -1419,16 +1428,26 @@ script:
bedroom_sleep:
alias: Bedroom Sleep
sequence:
- if:
- condition: state
entity_id: input_select.home_mode
state: "Guest"
then:
- service: script.asleep_turn_everything_off
data: {}
else:
- service: script.turn_everything_off
data: {}
- parallel:
- if:
- condition: state
entity_id: input_select.home_mode
state: "Guest"
then:
- service: script.asleep_turn_everything_off
data: {}
else:
- service: script.turn_everything_off
data: {}
- if:
- condition: state
entity_id: light.bedroom_clock_matrix
state: "on"
then:
- service: light.turn_off
data: {}
target:
entity_id: light.bedroom_clock_matrix
mode: single
icon: mdi:sleep

Expand Down

0 comments on commit b1be2ce

Please sign in to comment.