blueprint:
  name: Do something when a device enters a geofence
  description: |
    Requirements:
      - The Traccar Server integration
      - At least one device in Traccar that is tracked by that integration
      - Configured geofences in Traccar
  domain: automation
  author: ludeeus
  homeassistant:
    min_version: 2024.5.0
  input:
    devices:
      name: Device geofences
      description: The Traccar sensor that holds the geofence you want to act upon
      selector:
        entity:
          multiple: true
          filter:
            integration: "traccar_server"
            domain: "sensor"
    geofence:
      name: Geofence
      description: The name of the geofence
      selector:
        text:

    conditions:
      name: Conditions
      description: |
        Extra conditions you may want to add to this automation
        (Example: Home occupied, TV on, etc)
      default: []
      selector:
        condition:

    actions:
      name: Actions
      description: |
        What you want to do when a device enters the defined geofence
        (Example: Notification, turn on lights etc.)
      default: []
      selector:
        action:

trigger:
  - platform: state
    entity_id: !input devices
    to: !input geofence
condition: !input conditions
action: !input actions
mode: queued
