VO
Size: a a a
VO
IB
VO
VO
IB
IB
VO
IB
IB
IB
IB
VO
VO
VO
VO
VO
IB
ДЦ
- alias: test_4
initial_state: 'true'
trigger:
- platform: state
entity_id:
- binary_sensor.keypad_k_btn_01
- binary_sensor.keypad_k_btn_02
- binary_sensor.keypad_k_btn_03
- binary_sensor.keypad_k_btn_04
- binary_sensor.keypad_k_btn_05
- binary_sensor.keypad_k_btn_06
- binary_sensor.keypad_k_btn_07
- binary_sensor.keypad_k_btn_08
- binary_sensor.keypad_k_btn_09
- binary_sensor.keypad_k_btn_10
- binary_sensor.keypad_k_btn_11
condition:
- condition: template
value_template: "{{not trigger.from_state.state in ['unavailable', 'unknown', 'none']}}"
- condition: template
value_template: "{{not trigger.to_state.state in ['unavailable', 'unknown', 'none']}}"
action:
- service_template: >
{% if (is_state('light.esp01_led_strip_hb_led','off') and trigger.to_state.state == 'on') or (is_state('light.esp01_led_strip_hb_led','on') and trigger.to_state.name != states('input_text.led_strip_hb_last')) %}
script.led_strip_hb_on
{% else %}
script.led_strip_hb_off
{% endif %}
data_template:
strip_name: light.esp01_led_strip_hb_led
effect_name: >
{% if trigger.to_state.name == 'Keypad_K_btn_01' %}
none
{% elif trigger.to_state.name == 'Keypad_K_btn_02' %}
random
{% elif trigger.to_state.name == 'Keypad_K_btn_03' %}
strobe
{% elif trigger.to_state.name == 'Keypad_K_btn_04' %}
flicker
{% elif trigger.to_state.name == 'Keypad_K_btn_05' %}
rainbow
{% elif trigger.to_state.name == 'Keypad_K_btn_06' %}
color wipe
{% elif trigger.to_state.name == 'Keypad_K_btn_07' %}
scan
{% elif trigger.to_state.name == 'Keypad_K_btn_08' %}
twinkle
{% elif trigger.to_state.name == 'Keypad_K_btn_09' %}
random twinkle
{% elif trigger.to_state.name == 'Keypad_K_btn_10' %}
fireworks
{% elif trigger.to_state.name == 'Keypad_K_btn_11' %}
adressable flicker
{% endif %}
- service: input_text.set_value
data_template:
entity_id: input_text.led_strip_hb_last
value: "{{ trigger.to_state.name }}"
A
B
- alias: test_4
initial_state: 'true'
trigger:
- platform: state
entity_id:
- binary_sensor.keypad_k_btn_01
- binary_sensor.keypad_k_btn_02
- binary_sensor.keypad_k_btn_03
- binary_sensor.keypad_k_btn_04
- binary_sensor.keypad_k_btn_05
- binary_sensor.keypad_k_btn_06
- binary_sensor.keypad_k_btn_07
- binary_sensor.keypad_k_btn_08
- binary_sensor.keypad_k_btn_09
- binary_sensor.keypad_k_btn_10
- binary_sensor.keypad_k_btn_11
condition:
- condition: template
value_template: "{{not trigger.from_state.state in ['unavailable', 'unknown', 'none']}}"
- condition: template
value_template: "{{not trigger.to_state.state in ['unavailable', 'unknown', 'none']}}"
action:
- service_template: >
{% if (is_state('light.esp01_led_strip_hb_led','off') and trigger.to_state.state == 'on') or (is_state('light.esp01_led_strip_hb_led','on') and trigger.to_state.name != states('input_text.led_strip_hb_last')) %}
script.led_strip_hb_on
{% else %}
script.led_strip_hb_off
{% endif %}
data_template:
strip_name: light.esp01_led_strip_hb_led
effect_name: >
{% if trigger.to_state.name == 'Keypad_K_btn_01' %}
none
{% elif trigger.to_state.name == 'Keypad_K_btn_02' %}
random
{% elif trigger.to_state.name == 'Keypad_K_btn_03' %}
strobe
{% elif trigger.to_state.name == 'Keypad_K_btn_04' %}
flicker
{% elif trigger.to_state.name == 'Keypad_K_btn_05' %}
rainbow
{% elif trigger.to_state.name == 'Keypad_K_btn_06' %}
color wipe
{% elif trigger.to_state.name == 'Keypad_K_btn_07' %}
scan
{% elif trigger.to_state.name == 'Keypad_K_btn_08' %}
twinkle
{% elif trigger.to_state.name == 'Keypad_K_btn_09' %}
random twinkle
{% elif trigger.to_state.name == 'Keypad_K_btn_10' %}
fireworks
{% elif trigger.to_state.name == 'Keypad_K_btn_11' %}
adressable flicker
{% endif %}
- service: input_text.set_value
data_template:
entity_id: input_text.led_strip_hb_last
value: "{{ trigger.to_state.name }}"