Because it never seem to load in my system. I think i need to use β>-β, I donβt know? I will look into it tomorrow.
But onto a much more important things! @petro I think you have donβt it (iβll do a heap of testing tomorrow) but I think I owe you a BEEPING BEEB more
They load on every system, itβs built into yaml. Your spacing needs to be correct. Notice how my templates are indented based on the field they are in.
field: >
{{...
1 Like
The Final solution!
@petro youβre a LEGEND!
blueprint:
name: A Test
description: "A Variable State Test for Target Selector input"
domain: script
input:
lights:
name: Targeted Lights
description: The Lights this Script is Targeted at.
selector:
target:
entity:
domain: light
variables:
lights: !input lights
entities: >
{%- set ns = namespace(ret=[]) %}
{%- for key in ['device_id', 'area_id', 'entity_id'] %}
{%- set items = lights.get(key, []) %}
{%- if items %}
{%- set items = [ items ] if items is string else items %}
{%- set filt = key.split('_') | first %}
{%- set items = items if filt == 'entity' else items | map(filt ~ '_entities') | sum(start=[]) %}
{%- set ns.ret = ns.ret + [ items ] %}
{%- endif %}
{%- endfor %}
{{ ns.ret | sum(start=[]) }}
filtered: "{{ entities | select( 'search' , '^light' ) | select('is_state', 'on') | list }}"
lights_on: "{{ filtered | count > 0 }}"
transition: "{{ iif ( lights_on , 90, 0 ) }}"
sequence:
- service: light.turn_on
data:
transition: "{{ transition }}"
target: !input lights
I think iβm going to cry!
2 Likes