Thank you for your hints. 
Iāve already noticed that the energy date picker isnāt using these localStorage keys while on the page.
But I wasnāt aware that this selection is untied from the current dashboard, so leaving and reentering the dashboard in the same tab / browser-session will also not trigger a reload.
So this solution got quite a bit larger than I hoped for, but itās working. 
It is important to use specific energy collection keys for all the pickers you want to control this way and not use the default.
That way this solution is working independently from other date pickers on your dashboards.
It will call itself recursively every 10 seconds and check if you just left the dashboard with the date pickers and reset them in this case.
Otherwise it will check if youāre currently on the dashboard with the date pickers and will then reset the date pickers only if there are no touch or mouse movements in the last 5 minutes.
action: browser_mod.sequence
data:
sequence:
- service: browser_mod.javascript
data:
code: |
// IIFE to restrict scope
(function () {
'use strict';
const DAILY_DATE_PICKER_KEY = 'energy-default-period-_energy_custom_daily';
const YEARLY_DATE_PICKER_KEY = 'energy-default-period-_energy_custom_yearly';
const ENERGY_PATH_PART = 'dashboard-custom-energy/0';
const ENERGY_DASHBOARD_INACTIVITY_LIMIT = 300_000;
// Function to change date range for a specific energy date picker and it's cards
async function setEnergyRange(key, start, end) {
const hass = await window.hassConnection;
if (!hass || !hass.conn) {
console.error('BROWSER MOD DEFAULT ACTION ERROR: HASS CONNECTION NOT READY.');
return;
}
const collection = hass.conn[key];
if (!collection) {
console.error('BROWSER MOD DEFAULT ACTION ERROR: ENERGY DATE PICKER COLLECTION NOT FOUND');
return;
}
collection.setPeriod(start, end);
collection.refresh();
}
// Local Storage handling
const applyLocalStorageDefaults = () => {
if (localStorage.getItem(DAILY_DATE_PICKER_KEY) !== 'today') {
localStorage.setItem(DAILY_DATE_PICKER_KEY, 'today');
}
if (localStorage.getItem(YEARLY_DATE_PICKER_KEY) !== 'this_year') {
localStorage.setItem(YEARLY_DATE_PICKER_KEY, 'this_year');
}
};
// Time helpers
const startOfToday = () => { const d = new Date(); d.setHours(0,0,0,0); return d; };
const endOfToday = () => { const d = new Date(); d.setHours(23,59,59,999); return d; };
const startOfYear = () => { const n = new Date(); return new Date(n.getFullYear(), 0, 1, 0,0,0,0); };
const endOfYear = () => { const n = new Date(); return new Date(n.getFullYear(),11,31,23,59,59,999); };
// Dashboard presence & user activity
const currentlyOnEnergyView = () => window.location.pathname.includes(ENERGY_PATH_PART);
let lastActivity = Date.now();
let lastResetAt = 0;
let wasOnEnergyView = currentlyOnEnergyView();
const bump = () => { lastActivity = Date.now(); };
window.addEventListener('mousemove', bump, { passive: true });
window.addEventListener('touchstart', bump, { passive: true });
window.addEventListener('touchmove', bump, { passive: true });
// Call every 10 seconds
const tick = async () => {
applyLocalStorageDefaults();
const onEnergyView = currentlyOnEnergyView();
// Don't check user activity when on other dashboards
if (onEnergyView) {
const inactiveMs = Date.now() - lastActivity;
if (inactiveMs >= ENERGY_DASHBOARD_INACTIVITY_LIMIT && lastActivity > lastResetAt) {
try {
await setEnergyRange('_energy_custom_daily', startOfToday(), endOfToday());
await setEnergyRange('_energy_custom_yearly', startOfYear(), endOfYear());
lastResetAt = Date.now(); // Only once per inactivity period
} catch (e) {
console.error('BROWSER MOD DEFAULT ACTION ERROR: INACTIVITY ENERGY RESET FAILED:', e);
}
}
}
// Just left the dashboard with the energy pickers
if (wasOnEnergyView && !onEnergyView) {
try {
await setEnergyRange('_energy_custom_daily', startOfToday(), endOfToday());
await setEnergyRange('_energy_custom_yearly', startOfYear(), endOfYear());
} catch (e) {
console.error('BROWSER MOD DEFAULT ACTION ERROR: LEAVE-DASHBOARD ENERGY RESET FAILED:', e);
}
}
wasOnEnergyView = onEnergyView;
};
applyLocalStorageDefaults();
tick();
setInterval(tick, 10_000);
})();