diff --git a/README.md b/README.md index 259f9be..19d6f5f 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ This integration includes beta features for adding, editing, and deleting parcel - `next_delivery_carrier`: The converted (from carrier code) carrier name of the next shipment arriving. ### Raw Data Sensor -From v1.2.0 another sensor entity is added, called `sensor.parcel_raw_shipment_data`. It contains raw json data from the API pull for debugging or custom templating. It has the following attributes: +From v1.2.0 another sensor entity is added, containing raw json data from the API pull for debugging or custom templating. Its entity ID is `sensor.parcel_raw_shipment_data` for installs configured before roughly HA 2026.4, and `sensor.parcel_app_parcel_raw_shipment_data` for newer setups (check Developer Tools → States for yours). Note this sensor is disabled by default and needs to be enabled from the entity settings. It has the following attributes: #### Raw Data Sensor Attributes As per the [Parcel App API documentation](https://parcelapp.net/help/api.html) @@ -214,4 +214,4 @@ This integration uses the Parcel REST API. Special thanks to the developer of th * * * * * -**Note:** This integration is unofficial and not affiliated with the Parcel API developers. +**Note:** This integration is unofficial and not affiliated with the Parcel API developers. \ No newline at end of file diff --git a/docs/community_templates/auto_entities.yaml b/docs/community_templates/auto_entities.yaml index e9d0741..6b99859 100644 --- a/docs/community_templates/auto_entities.yaml +++ b/docs/community_templates/auto_entities.yaml @@ -8,7 +8,9 @@ card: filter: template: > {# Fetch parcel data from sensor #} - {% set parcels = state_attr('sensor.parcel_raw_shipment_data', 'deliveries') or [] %} + {# Entity ID depends on the HA core version the integration was first set up on (naming migration ~HA 2026.4) #} + {% set raw_entity = 'sensor.parcel_app_parcel_raw_shipment_data' if states.sensor.parcel_app_parcel_raw_shipment_data is not none else 'sensor.parcel_raw_shipment_data' %} + {% set parcels = state_attr(raw_entity, 'deliveries') or [] %} {% set enroute = namespace(list=[]) %} {% set delivered = namespace(list=[]) %} @@ -31,7 +33,7 @@ filter: {% if statuscode in [2, 3, 4] %} {% set row = { 'type': 'custom:template-entity-row', - 'entity': 'sensor.parcel_raw_shipment_data', + 'entity': raw_entity, 'name': '[' ~ carrier ~ '] ' ~ name ~ ' - ' ~ barcode, 'state': 'En route', 'secondary': 'Expected: ' ~ time, @@ -41,7 +43,7 @@ filter: {% elif statuscode == 0 %} {% set row = { 'type': 'custom:template-entity-row', - 'entity': 'sensor.parcel_raw_shipment_data', + 'entity': raw_entity, 'name': '[' ~ carrier ~ '] ' ~ name ~ ' - ' ~ barcode, 'state': 'Delivered', 'secondary': 'Delivered: ' ~ time, @@ -70,4 +72,4 @@ filter: ] show_empty: true grid_options: - columns: full + columns: full \ No newline at end of file diff --git a/docs/community_templates/bubble_card.yaml b/docs/community_templates/bubble_card.yaml index 6a2cc35..177e8ba 100644 --- a/docs/community_templates/bubble_card.yaml +++ b/docs/community_templates/bubble_card.yaml @@ -3,7 +3,8 @@ type: markdown content: >- - {% set raw = state_attr('sensor.parcel_raw_shipment_data', 'deliveries') %} + {% set raw = state_attr('sensor.parcel_app_parcel_raw_shipment_data', 'deliveries') + or state_attr('sensor.parcel_raw_shipment_data', 'deliveries') %} {% set ns = namespace(deliveries = []) %} {% for order in raw | selectattr('status_code','>',0) %} {% if order.date_expected is defined %}