pnbruckner / ha-composite-tracker

Home Assistant Composite Device Tracker
The Unlicense
133 stars 11 forks source link

Notify no longer interacting with device tracker. #70

Closed vaemarr closed 4 months ago

vaemarr commented 5 months ago

I have an automation, it is split into 2x sub-routines (actions), that do the following:

First Action:

variables:
  target: |
    {% set x = trigger.to_state.attributes.source %} {{ states[x].object_id }}
alias: Sets the target of the notification to the person who triggered the event.

Second Action:

service: notify.mobile_app_{{ target }}
data:
  title: Shopping List
  message: >-
    {{ trigger.to_state.attributes.friendly_name }}, please review items that
    are needing purchase. Check them off when done.
  data:
    group: shopping-notification-group
    channel: Shopping
    notification_icon: mdi:cart
    color: "#A6FF96"
    clickAction: /lovelace-mushroom/house-mobile
    subtitle: Items are needed!
    car_ui: true
alias: Dispatch notification to person who entered Shopping Precinct

I am now, as of latest core update, getting the following. See attached.

I believe there were tracker changes in the latest update but as I am not a experienced coder I am uncertain if they are related.

Here are my details:

Core 2024.4.3 Supervisor 2024.04.0 Operating System 11.5 Frontend 20240404.2

Screen Shot 2024-04-21 at 8 53 51 pm

pnbruckner commented 5 months ago

There is not enough detail there to help me help you. You might want to provide the entire automation.

Even so, I'm not sure what this has to do with the composite tracker integration. Are the entities it creates behaving incorrectly somehow?

vaemarr commented 5 months ago

Sorry for delayed reply. Here is the full automation. I only raise it here because the error seems to be indicating its no longer recognising the composite tracker. The automation was working and then an update occured somewhere that has since caused this notice to appear. So just reaching out hoping you might notice something.

alias: Shopping List
description: Notifies if there are items in the shopping list.
trigger:
  - platform: zone
    entity_id:
      - person.andrew_oskam
      - person.ashley_vella
    zone: zone.pimpama_city
    event: enter
    id: zone_pc
  - platform: zone
    entity_id:
      - person.andrew_oskam
      - person.ashley_vella
    zone: zone.pimpama_woolworths
    event: enter
    id: zone_sc
  - platform: zone
    entity_id:
      - person.andrew_oskam
      - person.ashley_vella
    zone: zone.westfield_sc
    event: enter
    id: zone_wsc
  - platform: state
    entity_id:
      - todo.shopping_list
    id: shopping_list_updated
    enabled: true
condition:
  - condition: state
    entity_id: input_boolean.shopping_notifications_toggle
    state: "on"
    alias: Confirm Shopping List Notifications are Enabled
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - zone_pc
              - zone_sc
              - zone_wsc
            alias: Triggered by Someone Entering Shopping Precinct
          - condition: numeric_state
            entity_id: todo.shopping_list
            above: 0
            alias: Shopping List has at least 1 item on it
        sequence:
          - variables:
              target: >
                {% set x = trigger.to_state.attributes.source %} {{
                states[x].object_id }}
            alias: >-
              Sets the target of the notification to the person who triggered
              the event.
          - service: notify.mobile_app_{{ target }}
            data:
              title: Shopping List
              message: >-
                {{ trigger.to_state.attributes.friendly_name }}, please review
                items that are needing purchase. Check them off when done.
              data:
                group: shopping-notification-group
                channel: Shopping
                notification_icon: mdi:cart
                color: "#A6FF96"
                clickAction: /lovelace-mushroom/house-mobile
                subtitle: Items are needed!
                car_ui: true
            alias: Dispatch notification to person who entered Shopping Precinct
        alias: Someone entered Shopping Precint, Send Notification
      - conditions:
          - condition: template
            value_template: >-
              {{ trigger.to_state.state | int > trigger.from_state.state | int
              }}
            alias: >-
              When Shopping List updated, Verify list count has incremented
              (Item Added).
        sequence:
          - service: notify.notify
            data:
              title: Shopping List
              message: An item has been added to the shopping list.
              data:
                group: shopping-notification-group
                tag: shopping-notifications
                channel: Shopping
                notification_icon: mdi:cart
                color: "#A6FF96"
                clickAction: /lovelace-mushroom/house-mobile
                subtitle: Items added.
                car_ui: true
            alias: Notify Everyone, Items added to Shopping List
        alias: Send notification when items are added to the Shopping List
      - conditions:
          - condition: template
            value_template: >-
              {{ trigger.to_state.state | int < trigger.from_state.state | int
              }}
            alias: >-
              When Shopping List updated, Verify list count has decreased (Item
              Removed).
        sequence:
          - service: notify.notify
            data:
              title: Shopping List
              message: An item has been removed from the shopping list.
              data:
                group: shopping-notification-group
                tag: shopping-notifications
                channel: Shopping
                notification_icon: mdi:cart
                color: "#A6FF96"
                clickAction: /lovelace-mushroom/house-mobile
                subtitle: Items removed.
                car_ui: true
            alias: Notify Everyone, Items removed from Shopping List
        alias: Send notification when items are removed from the Shopping List
mode: queued
max: 10
pnbruckner commented 4 months ago

The automation you posted doesn't seem to match your original description (neither the automation's name, nor the entity IDs.) I can't guess what might be different.

Have you checked the automation's traces? Sorry, I can't help with this in this context. You should ask for help on the community forum or in discord.

Again, I don't see where this is indicating anything wrong with the composite integration.