Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - id: package_track_notify
- alias: package_track_notify
- description: 通知-社區包裹通知
- mode: single
- trigger:
- - platform: state
- entity_id: sensor.my_package_tracker
- attribute: unclaimed_packages_count
- condition: []
- action:
- - variables:
- person: >
- {% if state_attr("sensor.my_package_tracker","p_name") == 'AAA' %}
- AA
- {% elif state_attr("sensor.my_package_tracker","p_name") == 'BBB' %}
- BB
- {% elif state_attr("sensor.my_package_tracker","p_name") == 'CCC' %}
- CC
- {% elif state_attr("sensor.my_package_tracker","p_name") == 'DDD' %}
- DD
- {% else %}
- {{ state_attr("sensor.my_package_tracker","p_name") }}
- {% endif %}
- - choose:
- - conditions:
- - condition: state
- entity_id: sensor.my_package_tracker
- state: '未領取'
- sequence:
- - service: notify.line_notify
- data:
- message: >
- {{ person }}的{{state_attr("sensor.my_package_tracker","postal_typeText")}}來囉!
- data:
- url: >
- {{ state_attr("sensor.my_package_tracker","postal_img") }}
- - conditions:
- - condition: state
- entity_id: sensor.my_package_tracker
- state: '已取件'
- sequence:
- - service: notify.line_notify
- data:
- message: >
- {{ person }}的{{ state_attr("sensor.my_package_tracker","postal_typeText") }}已領取
Advertisement
Advertisement