HA的 templates 页面指引
1、查看所有HA接入设备id及属性
在HA中的 templates 页面中输入以下代码:
{{ "_".ljust(90, "_") }}
{%- set domains = [states.light, states.switch, states.automation, states.device_tracker, states.group, states.media_player, states.proximity, states.script, states.zone, states.zwave, states.binary_sensor, states.sensor, states.calendar ] %}
{{ "Entity ID".ljust(50) }}{{ "Entity Name" }}
{{ "Attribute Name".ljust(50) }}{{ "Attribute Value" }}
{%- for domain in domains -%}
{% for item in domain %}
{{ "_".ljust(90, "_") }}
{{ item.entity_id.ljust(50) }}
{{ "State".ljust(50) }}: {{ item.state}}
{{ "Domain".ljust(50) }}: {{ item.domain}}
{{ "Object ID".ljust(50) }}: {{ item.object_id}}
{{ "Last Updated".ljust(50) }}: {{ item.last_updated}}
{{ "Last Changed".ljust(50) }}: {{ item.last_changed}}
{%- for attrib in item.attributes|sort() %}
{%- if attrib is defined %}
{{attrib.ljust(50)}}: {{ item.attributes[attrib] }}
{%- endif %}
{%- endfor %}
{%- endfor %}
{%- endfor %}
2、只查看所有HA接入设备id,不含属性
在HA中的 templates 页面中输入以下代码:
{%- set domains = [states.light, states.switch, states.automation, states.device_tracker, states.group, states.media_player, states.proximity, states.script, states.zone, states.zwave, states.binary_sensor, states.sensor, states.calendar ] %}
{{ "Entity ID".ljust(50) }} {{ "Entity Name" }}
{%- for domain in domains %}
{% for item in domain %}
{{ item.entity_id.ljust(50) }} {{ item.name }}
{%- endfor %}
{%- endfor %}
|