automations.yaml
This commit is contained in:
+6
-6
@@ -4613,11 +4613,11 @@
|
|||||||
'', ''_'')) ~ ''_color'') | replace(''#'', '''') | lower }}'
|
'', ''_'')) ~ ''_color'') | replace(''#'', '''') | lower }}'
|
||||||
- variables:
|
- variables:
|
||||||
spool_id: '{% set ns = namespace(id='''') %}{% for e in integration_entities(''spoolman'')
|
spool_id: '{% set ns = namespace(id='''') %}{% for e in integration_entities(''spoolman'')
|
||||||
%}{% if e.endswith(''_color_hex'') and (states(e) | replace(''#'', '''')
|
%}{% if e.endswith(''_color_hex'') and (state_attr(e[:-10], ''location'')
|
||||||
| lower) == color and (state_attr(e[:-10], ''location'') | default('''',
|
| default('''', true) | lower) == (''cfs lite '' ~ old_slot.split(''_'')[-1])
|
||||||
true) | lower) == ''cfs lite'' %}{% set b = e[:-10] %}{% if (states(b)
|
%}{% set b = e[:-10] %}{% if (states(b) | float(0)) > 0 and ns.id ==
|
||||||
| float(0)) > 0 and ns.id == '''' %}{% set ns.id = states(b ~ ''_id'')
|
'''' %}{% set ns.id = states(b ~ ''_id'') %}{% endif %}{% endif %}{% endfor
|
||||||
%}{% endif %}{% endif %}{% endfor %}{{ ns.id }}'
|
%}{{ ns.id }}'
|
||||||
- if:
|
- if:
|
||||||
condition: template
|
condition: template
|
||||||
value_template: '{{ grams | float > 0 }}'
|
value_template: '{{ grams | float > 0 }}'
|
||||||
@@ -4817,7 +4817,7 @@
|
|||||||
{% set label = 'Slot ' ~ n ~ ' ' ~ (cname if cname not in ['','unknown','unavailable'] else (flabel if flabel not in ['','unknown','unavailable'] else ('#' ~ (c | upper)))) %}
|
{% set label = 'Slot ' ~ n ~ ' ' ~ (cname if cname not in ['','unknown','unavailable'] else (flabel if flabel not in ['','unknown','unavailable'] else ('#' ~ (c | upper)))) %}
|
||||||
{% set sp = namespace(id='', rem=0, fw=0) %}
|
{% set sp = namespace(id='', rem=0, fw=0) %}
|
||||||
{% for e in integration_entities('spoolman') if e.endswith('_color_hex') %}
|
{% for e in integration_entities('spoolman') if e.endswith('_color_hex') %}
|
||||||
{% if sp.id == '' and (states(e) | replace('#','') | lower) == c and (state_attr(e[:-10],'location') | default('', true) | lower) == 'cfs lite' %}
|
{% if sp.id == '' and (state_attr(e[:-10],'location') | default('', true) | lower) == ('cfs lite ' ~ n) %}
|
||||||
{% set sp.id = e[:-10] %}
|
{% set sp.id = e[:-10] %}
|
||||||
{% set sp.rem = states(e[:-10]) | float(0) %}
|
{% set sp.rem = states(e[:-10]) | float(0) %}
|
||||||
{% set sp.fw = state_attr(e[:-10],'filament_weight') | float(0) %}
|
{% set sp.fw = state_attr(e[:-10],'filament_weight') | float(0) %}
|
||||||
|
|||||||
Reference in New Issue
Block a user