Does anyone know a way to get the old logbook back? The one without the time filter and entity id?
Or maybe a way to show the last X hours instead of only two?
tia.
Does anyone know a way to get the old logbook back? The one without the time filter and entity id?
Or maybe a way to show the last X hours instead of only two?
tia.
Rollback to version 0.112.4
Submit a feature request.
In Discord, @Bram_Kragten helped me with something like this. It will show all of today and yesterday when opening the logbook. Unfortunately, it only works once so going back to the logbook will reset the interval to the two hour period. I then have to reload the page to get the period extended.
<config>/configuration.yaml
frontend:
extra_module_url:
- /local/logbook-day.js
<config>/www/logbook-day.js
customElements.whenDefined("ha-panel-logbook").then(() => {
setTimeout(() => {
const element = document
.querySelector("home-assistant")
.shadowRoot.querySelector("home-assistant-main")
.shadowRoot.querySelector("app-drawer-layout partial-panel-resolver")
.querySelector("ha-panel-logbook");
const start = new Date(Date.now() - 86400000);
start.setHours(0);
start.setMinutes(0);
start.setSeconds(0);
start.setMilliseconds(0);
element._startDate = start;
const end = new Date();
end.setHours(end.getHours() + 1);
end.setMinutes(0);
end.setSeconds(0);
end.setMilliseconds(0);
element._endDate = end;
}, 0);
});
Something like this should work:
const checkRoute = (ev) => {
if (ev.detail.value.path === "/logbook") {
setLogbookRange();
}
};
const setLogbookRange = () => {
setTimeout(() => {
const element = document
.querySelector("home-assistant")
.shadowRoot.querySelector("home-assistant-main")
.shadowRoot.querySelector("app-drawer-layout partial-panel-resolver")
.querySelector("ha-panel-logbook");
const start = ((d) => new Date(d.setDate(d.getDate() - 1)))(new Date());
start.setHours(0);
start.setMinutes(0);
start.setSeconds(0);
start.setMilliseconds(0);
element._startDate = start;
const end = new Date();
end.setHours(end.getHours() + 1);
end.setMinutes(0);
end.setSeconds(0);
end.setMilliseconds(0);
element._endDate = end;
}, 0);
};
customElements.whenDefined("home-assistant").then(() => {
setTimeout(() => {
document
.querySelector("home-assistant")
.shadowRoot.querySelector("app-location")
.addEventListener("route-changed", checkRoute);
}, 0);
});
customElements.whenDefined("ha-panel-logbook").then(setLogbookRange);