initial commit
This commit is contained in:
91
configuration/automation/.templates
Normal file
91
configuration/automation/.templates
Normal file
@ -0,0 +1,91 @@
|
||||
{{ label_entities(label_id('external')) | expand | map(attribute='entity_id') | select('in', label_entities("door")) | list }}
|
||||
|
||||
{{ trigger.to_state.attributes.friendly_name }}
|
||||
|
||||
# Get Area Name by Triggered EntityID
|
||||
{{ area_name(trigger.entity_id) }}
|
||||
|
||||
{{ states.binary_sensor | selectattr('entity_id','in',area_entities('Living Room')) | selectattr('attributes.device_class', 'eq', 'window') | selectattr('state','eq', 'off') | list }}
|
||||
|
||||
{{ expand(area_entities('Dining') | select('match', 'light')) | selectattr('state', 'eq', 'on') | selectattr('attributes.hs_color', 'defined') | map(attribute='entity_id') | list }}
|
||||
|
||||
{{ device_entities('67326e6412f365984dbd6cc8e9546d3e') | expand | map(attribute='entity_id') | select('match','switch.*conversation') | list }}
|
||||
|
||||
|
||||
{{ integration_entities('tasmota') | map('device_id') | list }}
|
||||
|
||||
{{ data.messages | map(attribute="content") | list | last }}
|
||||
|
||||
# Get Device Name
|
||||
{{ device_attr('67326e6412f365984dbd6cc8e9546d3e', 'name') }}
|
||||
|
||||
# Get Device Name by User
|
||||
{{ device_attr('67326e6412f365984dbd6cc8e9546d3e', 'name_by_user') }}
|
||||
|
||||
|
||||
{% set entities = device_entities('67326e6412f365984dbd6cc8e9546d3e') | expand | map(attribute='entity_id') | list %}
|
||||
{%- for e in entities %}
|
||||
{%- if 'switch' in e and 'continued' in e %}
|
||||
{{e}}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
|
||||
|
||||
{%- set t = data.messages | map(attribute="content") | list | last -%}
|
||||
{%- set a = namespace(value=false) -%}
|
||||
{%- for w in ['need', 'confirm', '?'] -%}
|
||||
{%- if w in t -%}
|
||||
{%- set a.value=true -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{{ a.value }}
|
||||
|
||||
{% set my_list = ["apple", "banana", "cherry"] %} {% set first_letters = my_list | map('first') | join('') %} {{ first_letters }}
|
||||
|
||||
|
||||
{% set ns = namespace(domains=[]) %}
|
||||
{%- for s in states -%}
|
||||
{%- set ns.domains = (ns.domains + [s.domain])|unique|list -%}
|
||||
{%- endfor %}
|
||||
I have {{ states|length }} states in Home Assistant.
|
||||
By domain these are;
|
||||
{%- for domain in ns.domains %}
|
||||
- {{ states[domain]|length }} {{ domain }}
|
||||
{%- endfor %}
|
||||
|
||||
I have 1698 states in Home Assistant.
|
||||
By domain these are;
|
||||
- 4 person
|
||||
- 43 update
|
||||
- 295 binary_sensor
|
||||
- 2 stt
|
||||
- 3 tts
|
||||
- 24 scene
|
||||
- 52 light
|
||||
- 5 script
|
||||
- 43 input_number
|
||||
- 34 input_boolean
|
||||
- 7 input_select
|
||||
- 12 zone
|
||||
- 579 sensor
|
||||
- 1 conversation
|
||||
- 38 media_player
|
||||
- 1 sun
|
||||
- 5 input_text
|
||||
- 2 input_datetime
|
||||
- 18 camera
|
||||
- 163 button
|
||||
- 61 select
|
||||
- 62 switch
|
||||
- 44 number
|
||||
- 5 fan
|
||||
- 4 todo
|
||||
- 1 weather
|
||||
- 1 remote
|
||||
- 8 device_tracker
|
||||
- 54 event
|
||||
- 1 vacuum
|
||||
- 2 cover
|
||||
- 2 lock
|
||||
- 121 automation
|
||||
- 1 climate
|
Reference in New Issue
Block a user