marcokreeft87 / room-card

Show multiple entity states, attributes and icons in a single card in Home Assistant's Lovelace UI
MIT License
228 stars 38 forks source link

Wrong Icons shown for Motion devices in Info Entities #316

Closed jane-t closed 9 months ago

jane-t commented 9 months ago

Which version of Room Card?

1.08.03 Describe the bug A clear and concise description of what the bug is. Since upgrading all my Motion Sensors on the room card in the Info area are showing with a default icon not the motion one. They do appear correctly on a home assistant standard entity card.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

image

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

I suspect this is related to the new logic for Icons introduced in 2024.2, all my motion devices are either ZHA connected or ESPHome

YAML ` type: custom:room-card title: Kitchen icon: mdi:chef-hat show_icon: true entity: binary_sensor.kitchen_occupied tap_action: action: navigate navigation_path: /lovelace-yaml-rooms/kitchen state_color: true entities:

marcokreeft87 commented 9 months ago

You are posting the yaml of another room as the screenshot. Can you post the yaml of the same room plz?

jane-t commented 9 months ago

Sorry

image
jane-t commented 9 months ago

They all have the same problem.

marcokreeft87 commented 9 months ago

Maybe it's me but you have 7 entities in the yaml and 4 in the picture.

But besides that, could it be that the device class isn't motion? Because mine are working fine

jane-t commented 9 months ago
type: custom:room-card
title: Kitchen
icon: mdi:chef-hat
show_icon: true
entity: binary_sensor.kitchen_occupied
tap_action:
  action: navigate
  navigation_path: /lovelace-yaml-rooms/kitchen
state_color: true
entities:
  - entity: light.kitchen_lights
    name: Main
    tap_action:
      action: toggle
  - entity: light.utility_light
    name: Utility
    tap_action:
      action: toggle
  - media_player.kitchen

  - entity: climate.zone_4_kitchen
    tap_action:
        action: more-info
    state_color: true
    name: Heating
info_entities:
  - entity: binary_sensor.kitchen_ep1_occupancy
    show_icon: true
    state_color: true
  - entity: sensor.no_4_temp
    tap_action:
      action: more-info
      entity: climate.zone_4_kitchen

  - entity: sensor.no_4_target
    tap_action:
      action: more-info
marcokreeft87 commented 9 months ago

Only difference in yaml I can find is that I don't have the state_color: true.

Can you try without?

jane-t commented 9 months ago
image

More info for Occupancy icon for Kitchen

jane-t commented 9 months ago

Sorry removing the state colour does not fix it. I checked and the device class for the Kitchen EP1 Occupancy is device_class: occupancy friendly_name: Kitchen ep1 Occupancy

marcokreeft87 commented 9 months ago

That's what I thought. The icon you see is the default occupation icon.

Guess it's your configuration, because you are the first reporting this and mine is working correctly.

I can't help you I'm afraid.

jane-t commented 9 months ago

Ok, I just don't understand why the icon on the Room card is different to that on the More info pop up.

marcokreeft87 commented 9 months ago

I've had that issue before. Did you set the icon in a yaml file configuration?

jane-t commented 9 months ago

No, they are just the default ones from the class. Obviously I can set them in the room card or the entity but I have not and just let the default ones appear. Which is why I suspected something with the icon changes being implemented in 2024.2

jane-t commented 9 months ago

Ok, as an experiment I manually set the Kitchen sensor to mdi:home on the entity and the room card displayed correctly. So it is probably something to do with the inheritance of the new icon formats.

marcokreeft87 commented 9 months ago

No, they are just the default ones from the class. Obviously I can set them in the room card or the entity but I have not and just let the default ones appear. Which is why I suspected something with the icon changes being implemented in 2024.2

Well I know for a fact that the default icon for occupancy isn't a house icon

jane-t commented 9 months ago

I can work around the problem by manually setting the icons so if no one else is getting the problem it must be something odd. Sorry to have bothered you.

marcokreeft87 commented 9 months ago

I can work around the problem by manually setting the icons so if no one else is getting the problem it must be something odd. Sorry to have bothered you.

That's ok. Wish I could have helped.

geoffmellis commented 9 months ago

Just updated HA and having the exact issue as above.

EDIT: Have restored backup to 2024.1.6 and icons are appearing as previous so must be something to do with 2024.2.1

jane-t commented 9 months ago
image

I have been experimenting some more. I created a new dashboard, which shows that the Entities card is giving different results to the Room Card. This has only happened since 2024.2 with the new requirements for Icons was installed.

The above shows the output.

views:
  - title: Home
    cards:
      - type: custom:room-card
        title: Bedroom
        icon: mdi:bed
        show_icon: true
        entity: binary_sensor.bedroom_occupied
        tap_action:
          action: navigate
          navigation_path: /lovelace-yaml-rooms/bedroom
        state_color: true
        entities:
          - entity: light.bedroom_1_main_light
            name: Main
          - entity: light.tas_plug_2
            name: Cupboard
            tap_action:
              action: toggle
          - entity: light.ensuite_light
            name: Ensuite
            state_color: true
            show_icon: true
            tap_action:
              action: toggle
          - entity: fan.ensuite_light_fan
            name: Extractor
            state_color: true
            show_icon: true
            tap_action:
              action: toggle
          - entity: switch.tp2_tv
            state_color: true
            icon: mdi:television
            show_icon: true
            name: TV
            tap_action:
              action: toggle
          - entity: media_player.fire_tv_192_168_50_105
            hide_if:
              conditions:
                - condition: equals
                  entity: switch.tp2_tv
                  value: 'off'
          - entity: climate.zone_5_bedroom_1
            tap_action:
              action: more-info
            state_color: true
            name: Heating
        info_entities:
          - entity: binary_sensor.bedroom_motion
            show_icon: true
            state_color: true
          - entity: binary_sensor.ensuite_sensor_occupancy
            show_icon: true
            state_color: true
          - sensor.no_5_temp
          - sensor.no_5_target
      - type: entities
        entities:
          - entity: binary_sensor.ensuite_sensor_motion
          - entity: binary_sensor.ensuite_sensor_occupancy
          - entity: fan.ensuite_light_fan
          - entity: binary_sensor.bedroom_motion
          - entity: binary_sensor.lumi_lumi_sensor_motion_aq2_occupancy
marcokreeft87 commented 9 months ago

Yeah like I said, mine are working great and as long as I can't reproduce I can't help you unfortunately. Maybe someone else got the same issue and can help you.

But it seems the have to do with the entities you have

jane-t commented 9 months ago

Ok. I have fixed my install so I thought I would post it here for anyone else with the same problem. HACS showed I had 1.08.03, but looking at the js in the www folder it did not have the new hass value. I removed room-card and reinstalled it and that corrected the problem.

marcokreeft87 commented 9 months ago

Ah the old HACS keeping the cache issue. Forgot about that. Yeah HACS is in fact a terrible peace of software. I pointed some stuff out to the developers and they were rude to me about it. So yeah it's in their hands, but we plugin/card developer must deal with it.

Glad you are helped now!

marcokreeft87 commented 9 months ago

Is it OK to close this issue?

jane-t commented 9 months ago

Yes, no problem