home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.14k stars 29.81k forks source link

Logbook does not show a state for a newly created sensor #104056

Open ildar170975 opened 10 months ago

ildar170975 commented 10 months ago

The problem

(moved from Frontend https://github.com/home-assistant/frontend/issues/16533)

I just created a sensor with a state "xyz". And a Logbook card (and a Logbook page as well) does not show a history for this sensor:

238348805-27e33393-74a8-4673-9d6f-6ba39ab057a4

Assume that Logbook card only shows CHANGES. That means that for ANY sensor which was not changed within hours_to_show the Logbook will be empty - and this is true (and logical):

238349774-6d38898b-02c5-47b5-a597-b62d82dc1fa9

This "only show changes" logic is correct since for every state a "time of state change" is displayed; if this time is beyond hours_to_show - nothing to report. A simple test: go to Dev tools and manually set sun.sun to anything else, then restore a previous state - these entries will be displayed in the Logbook:

238351990-40f668be-9433-4a14-91c8-62d736045b7b

But a sensor's creation is also a state CHANGE, that is why it is logical to show this very 1st state in the Logbook.

One more example: Here is a new created entity: 283239213-32e8aeea-300e-4d3b-bd04-536fab68a275

The history shows a correct graph - the sensor was created at ~23:25.

And same is for History page - the graph is OK:

283239812-67b0b63b-6b1c-4320-82aa-3b4c1225e1db

But the logbook is EMPTY, and I find it inconsistent:

283240087-c6a3b75e-db5b-4596-917c-bfe9cbab8792

What version of Home Assistant Core has the issue?

2023.11.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

logbook

Link to integration documentation on our website

https://www.home-assistant.io/integrations/logbook/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 10 months ago

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (logbook) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `logbook` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign logbook` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


logbook documentation logbook source (message by IssueLinks)

issue-triage-workflows[bot] commented 7 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

ildar170975 commented 6 months ago

up

issue-triage-workflows[bot] commented 3 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

ildar170975 commented 3 months ago

up

issue-triage-workflows[bot] commented 4 weeks ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

ildar170975 commented 3 weeks ago

up