mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-05-15 12:34:42 +00:00
Return bed led scripts
This commit is contained in:
@@ -18,3 +18,29 @@ sensor:
|
||||
icon: "mdi:signal"
|
||||
unit_of_measurement: "lqi"
|
||||
value_template: "{{ value_json.linkquality }}"
|
||||
|
||||
script:
|
||||
bed_led_on:
|
||||
sequence:
|
||||
- delay: "00:00:01"
|
||||
- service: light.turn_on
|
||||
entity_id: light.bed_led
|
||||
- delay: "00:00:03"
|
||||
- service: light.turn_on
|
||||
entity_id: light.bed_led
|
||||
data_template:
|
||||
brightness_pct: "{{ brightness_pct | default(100) }}"
|
||||
|
||||
bed_led_toggle:
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: light.bed_led
|
||||
state: "off"
|
||||
sequence:
|
||||
- service: script.bed_led_on
|
||||
|
||||
default:
|
||||
- service: light.turn_off
|
||||
entity_id: light.bed_led
|
||||
|
||||
@@ -21,11 +21,6 @@ automation:
|
||||
input:
|
||||
z2m_topic: "z2m_deconz/bedside_switch"
|
||||
click:
|
||||
- service: script.bed_led_toggle
|
||||
data_template:
|
||||
brightness_pct: >-
|
||||
{% if is_state('input_select.bedroom_mode', 'night') %} 40 {% else %} 100 {% endif %}
|
||||
|
||||
- service: light.toggle
|
||||
data_template:
|
||||
entity_id: >-
|
||||
@@ -38,6 +33,12 @@ automation:
|
||||
brightness_pct: >-
|
||||
{% if is_state('input_select.bedroom_mode', 'night') %} 40 {% else %} 100 {% endif %}
|
||||
|
||||
- service: script.bed_led_toggle
|
||||
data_template:
|
||||
brightness_pct: >-
|
||||
{% if is_state('input_select.bedroom_mode', 'night') %} 40 {% else %} 100 {% endif %}
|
||||
|
||||
|
||||
double_click:
|
||||
- service: light.toggle
|
||||
entity_id: light.bedside
|
||||
|
||||
Reference in New Issue
Block a user