Fix: channel-Vergleich robust mit | int statt String-Vergleich
HA parst Template-Ergebnisse, die wie Zahlen aussehen, automatisch zurück in den nativen Typ. channel == '3' (String-Vergleich) war dadurch immer False, selbst bei korrekt konfigurierten Tasten.
This commit is contained in:
parent
df43edc5c4
commit
5120617777
1 changed files with 7 additions and 7 deletions
|
|
@ -233,7 +233,7 @@ blueprint:
|
|||
label: Ausschalten
|
||||
|
||||
variables:
|
||||
channel: "{{ trigger.event.data.channel | string }}"
|
||||
channel: "{{ trigger.event.data.channel }}"
|
||||
button_1_entity: !input button_1_entity
|
||||
button_1_action: !input button_1_action
|
||||
button_2_entity: !input button_2_entity
|
||||
|
|
@ -257,7 +257,7 @@ action:
|
|||
- choose:
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: "{{ channel == '1' and button_1_entity not in [none, ''] }}"
|
||||
value_template: "{{ channel | int == 1 and button_1_entity not in [none, ''] }}"
|
||||
sequence:
|
||||
- action: "homeassistant.{{ button_1_action }}"
|
||||
target:
|
||||
|
|
@ -265,7 +265,7 @@ action:
|
|||
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: "{{ channel == '2' and button_2_entity not in [none, ''] }}"
|
||||
value_template: "{{ channel | int == 2 and button_2_entity not in [none, ''] }}"
|
||||
sequence:
|
||||
- action: "homeassistant.{{ button_2_action }}"
|
||||
target:
|
||||
|
|
@ -273,7 +273,7 @@ action:
|
|||
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: "{{ channel == '3' and button_3_entity not in [none, ''] }}"
|
||||
value_template: "{{ channel | int == 3 and button_3_entity not in [none, ''] }}"
|
||||
sequence:
|
||||
- action: "homeassistant.{{ button_3_action }}"
|
||||
target:
|
||||
|
|
@ -281,7 +281,7 @@ action:
|
|||
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: "{{ channel == '4' and button_4_entity not in [none, ''] }}"
|
||||
value_template: "{{ channel | int == 4 and button_4_entity not in [none, ''] }}"
|
||||
sequence:
|
||||
- action: "homeassistant.{{ button_4_action }}"
|
||||
target:
|
||||
|
|
@ -289,7 +289,7 @@ action:
|
|||
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: "{{ channel == '5' and button_5_entity not in [none, ''] }}"
|
||||
value_template: "{{ channel | int == 5 and button_5_entity not in [none, ''] }}"
|
||||
sequence:
|
||||
- action: "homeassistant.{{ button_5_action }}"
|
||||
target:
|
||||
|
|
@ -297,7 +297,7 @@ action:
|
|||
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: "{{ channel == '6' and button_6_entity not in [none, ''] }}"
|
||||
value_template: "{{ channel | int == 6 and button_6_entity not in [none, ''] }}"
|
||||
sequence:
|
||||
- action: "homeassistant.{{ button_6_action }}"
|
||||
target:
|
||||
|
|
|
|||
Loading…
Reference in a new issue