royto / logbook-card

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

How to use hidden_state for attributes ? #111

Closed ech58 closed 7 months ago

ech58 commented 7 months ago

Bonjour Julien,

I'm trying to hide some logbook entries based on the value "alarme" of the attribute "type" but this does not work.

I add this in the card's config:

    hidden_state:
      - attribute:
          - name: type
            value: alarme

but log entries with attribute type = alarme are still displayed.

Is my syntax for hidden_state correct ? Eric

PS : Bravo pour cette carte très très utile !

Here is my complete config !

ech58 commented 7 months ago
type: custom:multiple-logbook-card
title: Notification Manager (last 5 days)
hours_to_show: 24
show:
  state: true
  duration: false
  start_date: true
  end_date: false
  icon: true
  separator: false
  entity_name: true
entities:
  - entity: script.notification_manager
    custom_logs: false
    hidden_state:
      - unavailable
      - 'off'
  - entity: sensor.global_log_notification_manager_template_sensor
    attributes:
      - value: type
      - value: title
      - value: message
    hidden_state:
      - state: unknown
      - attribute:
          - name: type
            value: alarme
    label: Notification Manager
card_mod:
  style: |
    .attribute {
      font-style: italic;
      color: LightCyan !important;
    }
royto commented 7 months ago

Hello,

attribute is not an array in hidden state. Can you try with:


type: custom:multiple-logbook-card
title: Notification Manager (last 5 days)
hours_to_show: 24
show:
  state: true
  duration: false
  start_date: true
  end_date: false
  icon: true
  separator: false
  entity_name: true
entities:
  - entity: script.notification_manager
    custom_logs: false
    hidden_state:
      - unavailable
      - 'off'
  - entity: sensor.global_log_notification_manager_template_sensor
    attributes:
      - value: type
      - value: title
      - value: message
    hidden_state:
      - state: unknown
      - attribute:
          name: type
          value: alarme
    label: Notification Manager
card_mod:
  style: |
    .attribute {
      font-style: italic;
      color: LightCyan !important;
    }
ech58 commented 7 months ago

That works !

Many thanks. Eric