---
notify:
  - name: pushover
    platform: pushover
    api_key: !secret pushover_api_key
    user_key: !secret pushover_user_key

  - name: admin
    platform: group
    services:
      - service: mobile_app_pontius

  - name: all
    platform: group
    services:
      - service: admin
      - service: robert
      - service: living_tv

automation:
  - alias: Persistente meldingen doorsturen naar beheerder
    id: 7319632e-f122-4a54-a81c-569d5601446a
    description: Doorsturen persistente meldingen naar beheerder
    trigger:
      - event_data:
          domain: persistent_notification
          service: create
        event_type: call_service
        platform: event
    action:
      - data:
          message: >
            {% set message = trigger.event.data.service_data.message %}
            {% if 'login attempt' in message|lower %}
              {{ message }}:
              http://www.ip-tracker.org/locator/ip-lookup.php?ip={{
                message.split('from ')[1] }}
            {% else %}
              {{ message }}
            {% endif %}
        service: notify.admin
    mode: single

---
################################################################################
# Notify
################################################################################
notify:
  - name: pushover
    platform: pushover
    api_key: !secret pushover_api_key
    user_key: !secret pushover_user_key

  - name: telegram
    platform: telegram
    chat_id: !secret telegram_bot_chat_id_robert

  - name: admin
    platform: group
    services:
      - service: mobile_app_pontius

  - name: all
    platform: group
    services:
      - service: admin
      - service: robert
      - service: living_tv

################################################################################
# Telegram Bot
################################################################################
telegram_bot:
  - platform: polling
    api_key: !secret telegram_bot_api_key
    allowed_chat_ids:
      - !secret telegram_bot_chat_id_robert

################################################################################
# Automation
################################################################################
automation:
  - alias: Persistente meldingen doorsturen naar beheerder
    id: 7319632e-f122-4a54-a81c-569d5601446a
    description: Doorsturen persistente meldingen naar beheerder
    trigger:
      - event_data:
          domain: persistent_notification
          service: create
        event_type: call_service
        platform: event
    action:
      - data:
          message: >
            {% set message = trigger.event.data.service_data.message %}
            {% if 'login attempt' in message|lower %}
              {{ message }}:
              http://www.ip-tracker.org/locator/ip-lookup.php?ip={{
                message.split('from ')[1] }}
            {% else %}
              {{ message }}
            {% endif %}
        service: notify.admin
    mode: single

Add telegram platform and notifier
Add telegram platform and notifier
