logbook-card icon indicating copy to clipboard operation
logbook-card copied to clipboard

Multiple Logbook Card with auto-entities error

Open clau-bucur opened this issue 1 year ago • 1 comments

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

clau-bucur avatar Jul 22 '24 14:07 clau-bucur

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: изображение

ildar170975 avatar Jul 24 '24 22:07 ildar170975

@royto any clue on how to fix this?

clau-bucur avatar Nov 15 '24 13:11 clau-bucur

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

royto avatar Nov 15 '24 16:11 royto

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

clau-bucur avatar Nov 15 '24 21:11 clau-bucur

I can confirm this as well, When using auto entities plus custom log book I either get just a red error box or the error messageError: Please define at least one entity in entities.

however If I use auto entities with the built in logbook card it does work.

I am on an older HA Core at: 2024.7.2 (running HAOS) Wish I could provide more help but wanted to confirm this for others.

image attached (nb; I did try several different variations , none worked, so this is just one example) thanks

Image

bob454522 avatar Apr 12 '25 20:04 bob454522

I working well on my HA

I'm on 2025.04 for HA, auto entities in version 1.13.0

Image

royto avatar Apr 13 '25 18:04 royto

I've been finding strange behaviour can occur if you don't include "hours_to_show" - perhaps because of the amount of data. Sometimes it hangs the screen and never seems to return. The same code will work with another card, presumably because it doesn't have so much data to retrieve. Similarly sometimes I've been getting "Configuration Error" when later it seems to work.

EDIT: Actually now that I've got one working and doing a copy-paste-edit, I can see that I'm always getting "Configuration Error" with the same code but selecting a different label. To get it working without any change to the code, I refresh the screen.

It also looks like you get config error if auto-entities finds no entities. It would be nice if this just showed an empty table instead.

michaelblight avatar Jul 02 '25 10:07 michaelblight