-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.yaml
79 lines (74 loc) · 2.09 KB
/
scripts.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ventilate_for_15_mins:
# alias: "Ventilate for 15 mins"
# sequence:
# - service: homeassistant.turn_on
# data:
# entity_id: switch.cinema_ventilation
# - delay:
# minutes: 15
# - service: homeassistant.turn_off
# data:
# entity_id: switch.cinema_ventilation
update_library:
alias: Update Kodi Library
sequence:
- alias: Call Kodi update
service: kodi.call_method
data:
entity_id: media_player.kodi
method: VideoLibrary.Scan
#garage_door:
# alias: Garage door
# sequence:
# - condition: state
# entity_id: input_boolean.garage_door_enabled
# state: 'on'
# - service: switch.toggle
# entity_id: switch.garage_door_raw
# - delay:
# seconds: 120
# - service: homeassistant.turn_off
# entity_id: input_boolean.garage_door_enabled
garage_door_trigger:
alias: Garage door
sequence:
- condition: state
entity_id: input_boolean.garage_door_lock
state: 'off'
- service: shell_command.garage_door
#twinkly_random_color:
# sequence:
# - service: shell_command.twinkly
# data:
# args: >
# set_mode:color
# set_color:red={{ [0, 0, 128, 255] | random }},green={{ [0, 0, 128, 255] | random }},blue={{ [0, 0, 128, 255] | random }}
# set_brightness:100
#
#twinkly_vanilla:
# sequence:
# - service: shell_command.twinkly
# data:
# args: >
# set_mode:color
# set_color:red=0,green=0,blue=0,white=255
# set_brightness:40
twinkly_effects_cycle:
fields:
target:
description: "target entity_id"
sequence:
- service: light.turn_on
target:
entity_id: "{{ target }}"
data:
effect: >
{%- set effects = state_attr(target, "effect_list") %}
{%- set effect = state_attr(target, "effect") %}
{%- if effect %}
{%- set effect_index = effects.index(effect) %}
{%- set next_index = (effect_index + 1) % effects|length %}
{%- else %}
{%- set next_index = 0 %}
{%- endif %}
{{- effects[next_index] }}