2024年11月21日星期四 下午11:02:09

Developer Tools Template

11 个月 前
#24070 引用
Phone WiFi Automation home assistant


--wifi0
{{ states.sensor.wu_qiang_de_iphone_connection_type }}
--wifi
{{ states.sensor.wu_qiang_de_iphone_ssid}}
--wifi2
{{ states('sensor.wu_qiang_de_iphone_ssid')}}
--wifi3
{{ (states('sensor.wu_qiang_de_iphone_ssid') == "Your Wifi SSID")}}


1.
{{ states.sensor.wu_qiang_de_iphone_ssid}}

=>
ChinaNet-94EA-5G-WiFi5


2.
{{ (states('sensor.wu_qiang_de_iphone_ssid') == "Your Wifi SSID")}}

=>
false


https://community.home-assistant.io/t/using-the-my-wifi-ssid-for-presence-detection/420978/11?u=msly
0
11 个月 前
#24071 引用


--wifi2
{{ states('sensor.wu_qiang_de_iphone_ssid')}}


--wifi2
ChinaNet-S5S7XA


0
11 个月 前
#24072 引用
--wifi3
{{ (states('sensor.wu_qiang_de_iphone_ssid') == "Your Wifi SSID")}}

0
11 个月 前
#24076 引用
How to enumerate entities belonging to an integration?



{% set devices = states | map(attribute='entity_id') | map('device_id') | unique | reject('eq',None) | list %}
{%- set ns = namespace(integrations = []) %}
{%- for device in devices %}
  {%- set ids = device_attr(device, 'identifiers') | list | first %}
  {%- if ids and ids | length == 2 %}
    {%- set integration, something_unique = ids %}
    {%- if integration not in ns.integrations %}
      {%- set ns.integrations = ns.integrations + [ integration ] %}
    {%- endif %}
  {%- endif %}
{%- endfor %}
{{ ns.integrations }}


https://community.home-assistant.io/t/how-to-enumerate-entities-belonging-to-an-integration/343748/5

lists all entities belong to ingtegration
{{ integration_entities('broadlink') }}

output
['sensor.30056_power', 'sensor.30056_voltage', 'sensor.30056_current', 'sensor.30056_overload', 'sensor.30056_total_consumption', 'switch.30056', 'remote.zhi_neng_yao_kong_rm_mini3', 'remote.zhi_neng_yao_kong', 'switch.philips_tv', 'switch.gree2']
0
10 个月 前
#25176 引用
turn off all lights



--light
{% for state in states.light -%}
  {%- if loop.first %}The {% elif loop.last %} and the {% else %}, the {% endif -%}
  {{ state.name | lower }} is {{state.state_with_unit}}
  {{state.entity_id }}


              
  {{state.entity_id }}
{%- endfor %}.


output


light.aqara_hub_m1s_edb6_lightbulb, the aqara  lightbulb t1 by aqara home mode homekit controller is unavailable
  light.lightbulb


              
  light.lightbulb and the 领普人体存在传感器es1zb(mi) indicator light is off
  light.linp_hb01_c930_indicator_light
            
  light.linp_hb01_c930_indicator_light.



0
9 个月 前
#28463 引用

service: xiaomi_miot.intelligent_speaker
data:
  execute: true
  throw: false
  text: 关空调
  entity_id: media_player.xiaomi_lx06_026c_play_control
  silent: true
0
9 个月 前
#28466 引用
mi ai speaker pro  dlna
service: tts.edge_tts_say
data:
  entity_id: media_player.xiao_ai_yin_xiang_6318  
  message: My name is hanna
0
8 个月 前
#28548 引用
{{states['sensor.linp_hb01_c930_occupancy_sensor'].state }}



output

someone exists


{{states['sensor.linp_hb01_c930_occupancy_sensor'] }}


output
<template TemplateState(<state sensor.linp_hb01_c930_occupancy_sensor=no one exists; model=linp.sensor_occupy.hb01, lan_ip=, mac_address=64:9E, entity_class=MiotSensorEntity, home_room=2652774286的家 客厅, miot_type=urn:miot-spec-v2:device:occupancy-sensor:0000A0BF:linp-hb01:2:0000C824, state_property=occupancy_status-2-1, occupancy_status-2-1=0, no_one_determine_time-2-2=60, has_someone_duration-2-3=0, no_one_duration-2-4=24, occupancy_sensor.illumination=0, vendor.approach_aloof=0, vendor.shielding_distance=255, vendor.body_distance=2.92, vendor.approach_distance=1, vendor.someone_judge_time=0, vendor.sensitivity=2, vendor.move_threshold_high=600613727, vendor.move_threshold_low=737669087, vendor.miro_move_high=727100762, vendor.miro_move_low=727100762, vendor.radar_function_onoff=0, vendor.approach_event_onoff=0, vendor.real_time_bitmap=0, indicator_light.on=False, state_updater=cloud, sub_entities=['indicator_light-4'], occupancy_status-2-1_desc=No One Exists, friendly_name=领普人体存在传感器ES1ZB(MI) Occupancy Sensor Status, supported_features=0 @ 2024-04-22T03:54:58.872469+08:00>)>

{{states['sensor.linp_hb01_c930_occupancy_sensor'].state }}  


=>
someone exists


{{states.sensor.linp_hb01_c930_occupancy_sensor.state}}   

=>
someone exists



20240620

has one
no one


{{states.sensor.linp_hb01_c930_occupancy_sensor.last_changed }}


output
2024-04-21 19:54:58.872469+00:00



{{states.sensor.linp_hb01_c930_occupancy_sensor.state =="no one exists"}} 

=>
True
0
8 个月 前
#28551 引用
{{states.sensor.cuco_cp2_7782_electric_current.state}}


=>

8  mA


or

Unavailable
0
8 个月 前
#29651 引用
{% for state in states.sensor %}
  传感器的ID:{{ state.entity_id }}
  传感器的类型:{{ state.domain }}
  传感器的名称:{{ state.name }}
  传感器的状态:{{ state.state }}
  传感器的属性:{{ state.attributes }}
{% endfor %}

{{ state_attr('sensor.chuangmi_212a01_9998_surge_power', 'power_consumption.surge_power') }}

output

2500
0