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

Main entity still required #56

Closed usernein closed 2 years ago

usernein commented 2 years ago

Describe the bug I read in the release notes that a main entity is not required anymore, but i'm still getting an error when i don't set "entity" I'm using v1.4.1

Screenshots

Captura de Tela 2022-09-21 às 14 48 59

Desktop (please complete the following information):

This is the yaml:

type: custom:room-card
title: Quarto
entities:
  - entity: light.quarto
    state_color: true
    show_name: false
  - entity: media_player.tv
    show_name: false
  - entity: switch.velocidade_1
    icon: mdi:fan-speed-1
    show_icon: true
    show_name: false
  - entity: switch.velocidade_2
    icon: mdi:fan-speed-2
    show_icon: true
    show_name: false
  - entity: switch.velocidade_3
    icon: mdi:fan-speed-3
    show_icon: true
    show_name: false
marcokreeft87 commented 2 years ago

Can you check your console? Does it say 1.4.0 or 1.4.1?

marcokreeft87 commented 2 years ago

Good thing is, I can confirm that 1.4.1 doesnt have the issue. But its not ready for release :(

thewolfman56 commented 2 years ago

Mine shows 1.4.1

image

marcokreeft87 commented 2 years ago

In Developer tools console I meant

thewolfman56 commented 2 years ago

My apologies. I have never used the developer tools to view the download version. I could look at it for you, but would need to know how.

marcokreeft87 commented 2 years ago

Press F12 and it should be on the tab " console ". Refresh the page and you will see it

marcokreeft87 commented 2 years ago

Try version 1.5.0 and see if it works

markwoodward86 commented 2 years ago

Came here to report the same issue. I confirm 1.5.0 resolves the bug

markwoodward86 commented 2 years ago

although it does look like 'title' is not being picked up any longer

Mobile_View_–_Home_Assistant

thewolfman56 commented 2 years ago

Press F12 and it should be on the tab " console ". Refresh the page and you will see it

My apologies. I was looking in the Home Assistant Developer Tools. On the Chrome console, my version is 1.4.0 even though HACS shows I downloaded 1.4.1.

I'll try to download 1.5.0

marcokreeft87 commented 2 years ago

although it does look like 'title' is not being picked up any longer

Mobile_View_–_Home_Assistant

Could be a cache issue. Do you have a way to clear it? Otherwise I will look at it tomorrow.

Or try without hide_title ?

marcokreeft87 commented 2 years ago

Press F12 and it should be on the tab " console ". Refresh the page and you will see it

My apologies. I was looking in the Home Assistant Developer Tools. On the Chrome console, my version is 1.4.0 even though HACS shows I downloaded 1.4.1.

I'll try to download 1.5.0

Yes I had the same issue. HA is super weird with caching unfortunately

thewolfman56 commented 2 years ago

Restarted HA and downloaded 1.5.0. Cleared cache and now had to set "show_icon: true" for the 2nd row switches (wasn't necessary previously, but not a problem to fix)

I am having the same issue with the title, but mine may be even stranger as I had info entities on the Title row. Now they are mixed in and overlap with the first row of entities. image

marcokreeft87 commented 2 years ago

@thewolfman56 check out v1.5.1 I think I found the issue

marcokreeft87 commented 2 years ago

although it does look like 'title' is not being picked up any longer

Mobile_View_–_Home_Assistant

Can you try 1.5.1?

thewolfman56 commented 2 years ago

although it does look like 'title' is not being picked up any longer Mobile_View_–_Home_Assistant

Can you try 1.5.1?

Seems to be working as it had previously. Title shows up for me.

type: custom:room-card
title: Pool
hide_title: false
icon: mdi:pool
show_icon: true
info_entities:
  - entity: sensor.water_sensor_1
    show_icon: false
  - entity: sensor.water_sensor_1
    show_icon: true
    icon: mdi:pool-thermometer
  - entity: binary_sensor.heat_pump
    name: Heat Pump
    show_name: true
rows:
  - entities:
      - entity: light.pool_lights_no
        name: Pool Light Group
        tap_action:
          action: toggle
        hold_action:
          action: more-info
      - entity: light.baja_light
        tap_action:
          action: toggle
      - entity: light.pool_lights
        tap_action:
          action: toggle
      - entity: light.grotto_light
        tap action: toggle
      - entity: light.waterfall_light
        name: Waterfall Lights
        tap_action:
          action: toggle
  - entities:
      - entity: switch.waterfall_scene_switch
        name: Waterfall
        icon: mdi:pool
        show_icon: true
      - entity: switch.waterfall_scene_switch
        name: Waterslide
        icon: mdi:slide
        show_icon: true

image

thewolfman56 commented 2 years ago

And thanks to this issue, I was able to see that I had used the same scene switch twice in the 2nd row even though I changed the icon.

aIexus commented 2 years ago

Why it is not possible to show icon when main entity is not defined?

marcokreeft87 commented 2 years ago

Why it is not possible to show icon when main entity is not defined?

Because with the icon you control the entity. If you only want to show an icon you can use hide_title: true. Its all in the wiki :)

aIexus commented 2 years ago

Plus I have strange error [TypeError: t is undefined] when I make undefined the main entity:

           - type: custom:room-card
             title: Hallway
             hide_title: false
             icon: mdi:door-closed-lock
            #  entity: sensor.hallway_lumi_weather_temperature
             show_icon: true
            #  tap_action: none
            #  double_tap_action: none
             entities:
               - entity: light.hallway_rgb_bulb
                 show_icon: true
                 state_color: true
                 name: Light
               - entity: binary_sensor.tapo_camera_motion
                 show_icon: true
                 state_color: true
                 hide_unavailable: true
                 name: Motion
               - entity: camera.tapo_camera_sd
                 show_icon: true
                 name: Camera
               - entity: binary_sensor.hallway_entrance_door_contact
                 show_icon: true
                 state_color: true
                 name: Door
             info_entities:
               - entity: sensor.hallway_lumi_weather_humidity
                 format: precision1
               - entity: sensor.hallway_lumi_weather_temperature
                 format: precision1
aIexus commented 2 years ago

Why it is not possible to show icon when main entity is not defined?

Because with the icon you control the entity. If you only want to show an icon you can use hide_title: true. Its all in the wiki :)

I want to use title + icon, but without control :) I want to have cool look icon+title :)