Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

icon not set for core entity device_tracker #128

Open
Mariusthvdb opened this issue Jun 27, 2024 · 1 comment
Open

icon not set for core entity device_tracker #128

Mariusthvdb opened this issue Jun 27, 2024 · 1 comment

Comments

@Mariusthvdb
Copy link

Mariusthvdb commented Jun 27, 2024

using below config for a device_tracker has a few issues:

    entities:
      - type: custom:template-entity-row
        entity: device_tracker.private_ble_device_marijn
        active: >
          {{is_state(config.entity,'home')}}
        state: >-
          {{state_translated(config.entity)}}
        secondary: >
          Verbonden: {{states('sensor.private_ble_device_marijn_connection')}}

one of them is the icon_color, or active, which is not set anymore, but there is an open issue for that.

This issue is about the icon itself not being set.

while it should be bluetooth-connect when Home

Scherm­afbeelding 2024-06-27 om 16 22 29

it uses bluetooth-off:

Scherm­afbeelding 2024-06-27 om 16 22 22

while as you can see the tracker is Home (Thuis) and connected to its adapter.

I can force it to set the correct icon by adding the icon template

        icon: >
          {{state_attr('sensor.private_ble_device_marijn_connection','icon')}}

but, that in itself is a template entity, which is a bit odd to use in this card, when the entity itself has the correct icon 'translation' set in https://github.com/home-assistant/core/blob/dev/homeassistant/components/private_ble_device/icons.json

{
  "entity": {
    "device_tracker": {
      "device_tracker": {
        "default": "mdi:bluetooth-off",
        "state": {
          "home": "mdi:bluetooth-connect"
        }
      }
    },
    "sensor": {
      "estimated_distance": {
        "default": "mdi:signal-distance-variant"
      },
      "estimated_broadcast_interval": {
        "default": "mdi:timer-sync-outline"
      }
    }
  }
}

could it be the new icon translations are not yet supported in template-entity-row, because, as the documentation states:

entity if this evaluates to an entity id, icon, name, state and image will be taken from that entity unless manually overridden.

indicate they should be fine in this particular config using an entity.
Please have a look. thx.

@ildar170975
Copy link

ildar170975 commented Jun 29, 2024

For input_boolean & binary_sensor domains - see no issues:

image

image

    type: entities
    entities:
      - input_boolean.testing_boolean
      - type: custom:template-entity-row
        entity: input_boolean.testing_boolean
      - type: section
      - binary_sensor.testing_device_class_connectivity
      - type: custom:template-entity-row
        entity: binary_sensor.testing_device_class_connectivity

Same for automation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants