本帖最后由 lidicn 于 2018-1-20 15:15 编辑
识别一个人并TTS名字【userinfo】
automation:
- alias: face_indentify
trigger:
platform: numeric_state
entity_id: image_processing.dlib_face_identify
above: 0
action:
- service: tts.baidu_say
data_template:
message: >
{% if states.image_processing.dlib_face_identify.attributes.faces %}
{{ states.image_processing.dlib_face_identify.attributes.faces[0]['name'] }} ,是你呀!
{% else %}
你好,陌生人!
{% endif %}
判断有几个人,多个人的话以执行for循环读取faces列表里面的name字段
|