Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - id: 'cast_TTS_front_door_to_speakers_if_face_detected'
- alias: "cast TTS front door to speakers if face detected"
- trigger:
- - entity_id: input_boolean.front_door_motion_sensor_face_detect_this_pass
- from: 'off'
- platform: state
- to: 'on'
- condition:
- condition: or
- conditions:
- - condition: state
- entity_id: media_player.kjokkenet
- state: 'off'
- - condition: state
- entity_id: media_player.kjokkenet
- state: 'idle'
- action:
- - service: media_player.volume_set
- data:
- entity_id:
- - media_player.kjokkenet
- volume_level: .5
- - service_template: tts.google_translate_say
- data_template:
- entity_id: media_player.kjokkenet
- message: 'At the front door:
- {% for face in states.image_processing.facebox_front_door.attributes.faces -%}
- {% if not face.name == None %}
- {{ face.name }}
- {% if not loop.last %}, {% endif -%}
- {% endif -%}
- {%- endfor %}
- {% if states.image_processing.facebox_front_door.attributes.total_faces > states.image_processing.facebox_front_door.attributes.total_matched_faces %}
- + {{ states.image_processing.facebox_front_door.attributes.total_faces - states.image_processing.facebox_front_door.attributes.total_matched_faces }} unrecognised person(s)
- {% endif -%}'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement