The other day I noticed Bandit is getting a little tubby. I might not have noticed had I not just watched him swallow his dinner in 2 bites. But I did, so I wanted to see how his weight has changed over the year. We have a LitterRobot which automatically cleans the litter. It also measures the cat’s weight. The LR has an app that has reports. Long story short, the app sucks.
However a LitterRobot integration exists, so HA to the rescue. From this integration I have sensor.bandit_weight
. This value gets updated every time he enters the unit, so maybe 2-5 times a day. Maybe more if he’s been on the catnip. I got the robot at mid-March, so that’s how far the data goes back.
So I go to the sensor’s History page and I see his weight in a chart. I assume I can customize this “report” and also assume there is a YAML equivalent. Just to test these, I changed the date range from 5/1/25-5/15/24. I then clicked the 3 dots and did a “Add current view as card”. I went to the view in question and the chart the card showed me was completely different from what I used to create the card’s YAML and. The card’s YAML:
title: History
type: history-graph
hours_to_show: 355
entities:
- sensor.bandit_weight
So it seems when saving a view, it doesn’t take a date range. My initial assumptions were wrong. I don’t know why my date range got butchered into hours_to_show. Is this because of the way sensor data is stored?
- On a slight tangent, please forgive me, but someone here is likely to know the answer. HomeAssistant is like other applications in the way they sometimes displays data, especially for dates. They use “a day ago” “a few minutes ago”, “last week”, etc. WHY?!?
Regardless the “add current view” function is flawed. What is added to the dashboard is not what the current view was.
So what am I asking for? I’m not even sure anymore. I want to be able to use the sensor history to generate reports. Like show the average weight per week. Over a specific time period. Maybe I’m asking too much for HA. Exporting to Excel should give me most of this.
Another thing I want to do is look for trends. I want to be notified if something is not normal. Each weight record is considered a “visit”. I want to be informed if the number of visits per day deviates from the norm. Maybe there’s a HACS gadget that does higher math.
I just don’t want to reinvent the wheel.