royto / logbook-card

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

History (number of days) doesn't show the correct log entries #78

Closed mstuij closed 10 months ago

mstuij commented 10 months ago

The option History to show that number of days is not correct.

Set the history option to 1 you see the entries of the last 24 hours (27 oct and 26 oct):

image

Set the history option to 2. Now you dont see the entries of today (27 oct) anymore: image

Also there is an entry at the bottom: Unknown. That item should not be visible.

image

I have created dummy entities to log all my automations. The config of such a dummy entity looks like this:

input_button:
  automation_covers_log_entity:
    name: Automation covers log
    icon: mdi:window-shutter       
royto commented 10 months ago

Hello, version 1.13.1 should fix the issue with missing custom logs.

About the last entry, can you provide more information about this ? Maybe check in the developer console, in the network tab, the response of the call to the history API. The URL should looks something like this https://YOUR_HA_URL/api/history/period/2023-10-25T20:29:25.120Z?filter_entity_id=automation_covers_log_entity&end_time=2023-10-27T20:29:25.120Z

mstuij commented 10 months ago

Thanks the numbers of days are working!

About the Unknown, this the the response:

[
    [
        {
            "entity_id": "input_button.automation_covers_log_entity",
            "state": "unknown",
            "attributes": {
                "icon": "mdi:window-shutter",
                "friendly_name": "Automation covers log"
            },
            "last_changed": "2023-10-21T13:40:46.840994+00:00",
            "last_updated": "2023-10-21T13:40:46.840994+00:00"
        },
        {
            "entity_id": "input_button.automation_covers_log_entity",
            "state": "unknown",
            "attributes": {
                "icon": "mdi:window-shutter",
                "friendly_name": "Automation covers log"
            },
            "last_changed": "2023-10-22T18:31:13.815679+00:00",
            "last_updated": "2023-10-22T18:31:13.815679+00:00"
        },
        {
            "entity_id": "input_button.automation_covers_log_entity",
            "state": "unknown",
            "attributes": {
                "icon": "mdi:window-shutter",
                "friendly_name": "Automation covers log"
            },
            "last_changed": "2023-10-27T04:10:04.357675+00:00",
            "last_updated": "2023-10-27T04:10:04.357675+00:00"
        }
    ]
]
royto commented 10 months ago

I think this is because it not custom logs ... so it gets from history api call.

Can you try to add this config

hidden_state:
  - unknown
mstuij commented 10 months ago

Thanks that did the trick. Problem solved.