royto / logbook-card

Logbook card for Home Assistant UI Lovelace
GNU General Public License v3.0
204 stars 9 forks source link

Multiple Logbook Card with auto-entities error #128

Open clau-bucur opened 4 months ago

clau-bucur commented 4 months ago

Describe the bug I'm unable to combine multiple-logbook-card with auto-entities and I get the following error in the console: card custom:multiple-logbook-card Error: Please define at least one entity in entities.

Here's a sample of the code I've tried:

type: custom:auto-entities
card:
  type: custom:multiple-logbook-card
filter:
  include:
    - group: group.motion_area_living

Tried with other examples too, even with the complete code from https://github.com/royto/logbook-card/issues/123#issuecomment-2171818036

Tried with the built-in logbook card, it works properly:

type: custom:auto-entities
card:
  type: logbook
filter:
  include:
    - group: group.motion_area_living

image

ildar170975 commented 4 months ago

My test. Create a new view, place 2 similar cards:

type: custom:auto-entities
card:
  type: custom:multiple-logbook-card
  hours_to_show: 1
filter:
  include:
    - entity_id: device_tracker.ac*
type: vertical-stack
cards:
  - type: custom:auto-entities
    card:
      type: custom:multiple-logbook-card
      hours_to_show: 1
    filter:
      include:
        - entity_id: device_tracker.ac*

i.e this is same card - but the 2nd one is placed inside vertical-stack. Should be displayed as изображение

If the 1st card is shown in UI editor - no issues: изображение

In case of the 2nd card - it is not shown & there is an error "Please define at least one entity" in console: изображение

clau-bucur commented 1 week ago

@royto any clue on how to fix this?

royto commented 1 week ago

it's a weird behaviour ...

I found a workaround that seems to work (adding an entity and then exclude it ...)

Not sure it is a bug on logbook card or auto-entities ...

type: vertical-stack
cards:
  - type: custom:auto-entities
    card:
      type: custom:multiple-logbook-card
      hours_to_show: 1
      entities: 
        - sun.sun
    filter:
      include:
        - entity_id: device_tracker.ac*
      exclude:
        - entity_id: sun.sun
clau-bucur commented 1 week ago

It doesn't seem to be working for me. Neither two of these examples show any card. The referenced groups are valid and contain entities which are included in the recorder.

type: custom:auto-entities
card:
  type: entities
  entities:
    - sun.sun
filter:
  include:
    - group: group.door_window_area_living
    - group: group.light_area_living
    - group: group.motion_area_living
  exclude:
    - entity_id: sun.sun
type: vertical-stack
cards:
  - type: custom:auto-entities
    card:
      type: entities
      entities:
        - sun.sun
    filter:
      include:
        - group: group.door_window_area_living
        - group: group.light_area_living
        - group: group.motion_area_living
      exclude:
        - entity_id: sun.sun