Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - id: outside_open_lock
- alias: Outside open lock
- trigger:
- platform: state
- entity_id: sensor.frontdoorlock_action
- to: lock
- condition:
- condition: template
- value_template: "{{ trigger.to_state.attributes['action_id'] == 0 }}" #Unlock outside the door
- action:
- service: notify.line_notify
- data:
- message: |
- {% if trigger.to_state.attributes['method'] =="biological" %} #指紋
- {% if trigger.to_state.attributes['key_id'] == 2 %}
- 人員2進門
- {% elif trigger.to_state.attributes['key_id'] == 3 %}
- 人員3進門
- {% elif trigger.to_state.attributes['key_id'] == 15 %}
- 人員15進門
- {% elif trigger.to_state.attributes['key_id'] == 20 %}
- 人員20進門
- {% else %}
- BIO ID: {{ trigger.to_state.attributes['key_id'] }} 進門
- {% endif %}
- {% elif trigger.to_state.attributes['method'] =="nfc" %} #NFC
- {% if trigger.to_state.attributes['key_id'] == 18 %}
- 人員19進門
- {% else %}
- NFC ID: {{ trigger.to_state.attributes['key_id'] }} 進門
- {% endif %}
- {% else %} #不是指紋也不是NFC
- Method: {{ trigger.to_state.attributes['method'] }} #解鎖方式
- User ID: {{ trigger.to_state.attributes['key_id'] }} #USER ID
- {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement