Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script:
- notification_android:
- alias: Android notifikationer med actions
- icon: mdi:android-debug-bridge
- description: Med dette script er det nemt at sende notifikationer til en Android enhed.
- sequence:
- - service: "{{ service }}"
- data:
- title: "{{ title }}"
- message: |
- {{ message }}
- data:
- icon_url: "{{ icon_url }}"
- sticky: "{{ sticky }}"
- persistent: "{{ persistent }}"
- tag: "{{ tag }}"
- channel: "{{ channel }}"
- importance: "{{ high }}"
- chronometer: "{{ chronometer }}"
- when: "{{ when }}"
- actions: >
- {% set ns = namespace(actions = []) %}
- {% for a_action in actions %}
- {% set action = {
- "action": a_action.action_name,
- "title": a_action.action_title
- } %}
- {% set ns.actions = ns.actions + [action] %}
- {% endfor %}
- {{ ns.actions }}
- flag_notification:
- sequence:
- - service: script.notification_android
- data:
- service: notify.mobile_app_jacobs_moto
- title: "Besked fra din flagstang"
- message: "{{ message }}"
- icon_url: "{{ state_attr('sensor.next_flag_day', 'entity_picture') }}"
- persistent: true
- tag: flag_notification
- channel: Flagstang
- importance: max
- chronometer: "{{ time_offset is defined }}"
- when: >
- {% if time_offset is defined %}
- {{ ((now() | as_timestamp) + (time_offset | int)) | int }}
- {% endif %}
- actions: "{{ actions }}"
- flag_clear_notification:
- sequence:
- - service: notify.mobile_app_jacobs_moto
- data:
- message: clear_notification
- data:
- tag: flag_notification
Add Comment
Please, Sign In to add comment