HA is installed on a RASPI 4.
Is there a way to only show midnight values of a sensor in a line chart dashboard card?
Or use a custom SQL, like the following, for a chart?
SELECT strftime(‘%Y-%m-%d’, created_ts, ‘unixepoch’) as Date, avg(mean) as Weight FROM “statistics” where metadata_id = 60 and strftime(‘%H’, created_ts, ‘unixepoch’) = ‘00’ group by strftime(‘%Y-%m-%d’, created_ts, ‘unixepoch’)
You probably meant a “Statistics graph card” instead of “Statistics card” if you need a “line chart”.
Try with “daily” data - they are calculated every midnight if I am not mistaken.
You’d have to use the SQL sensor with a proper SELECT that matches your database time. That’s the only way to get a value at midnight after it’s been collected.
You can always write a template entity that gets the value at midnight, however that does not work retroactively. Meaning the data is only collected when the trigger occurs and you have to wait for the trigger to occur to get your first piece of information.