Historical state attribute tracking?

Ultimately, I’m tracking our newborn feedings and the corresponding amounts daily, I’ve turned the entries from other variables into a combined sensor with the attribute data, I’d like to know (after say, a week) how many times are we feeding from 23:30 - 03:30

Since history stats, etc. creates and tracks off state (which I can’t do with the amount of information) anyone have grand ideas on how I can track (over time) the state attributes? The below is 2 entries of a designated 12 feeding times throughout the day (yes, it’s way overkill on that count - but, why not?)

The individual “feeding times” and corresponding feeding count are reset daily at midnight

  - sensor:
     - name: Hadleys Feeding Times
       state: >
         {{ states('var.feeding_count') }}
       attributes:
           1st_feeding_time: "{{ state_attr('var.feeding_1','feeding_time') }}"
           1st_feeding_amount: "{{ states('var.feeding_1') }}"
           2nd_feeding_time: "{{ state_attr('var.feeding_2','feeding_time') }}" 
           2nd_feeding_amount: "{{ states('var.feeding_2') }}"

Don’t know if this is good enough but perhaps you can write it to an input_text and display this in a markdown card?
So each time a new feed is done then you do state: "{{ states(input_text) }} [some line delimiter] new feed"
And in the markdown card you split it on the line delimiter and make new lines in the markdown card.

Thanks for the suggestion! Not sure if that would be an efficient solution to do analytics (i.e. stats around feeding times from 2330 - 0300). Like the idea of Markdown for a dashboard purpose though!

Hi bbow987,

If I hear you correctly, you want to take the value of an attribute and store it in history. The best way would be to create a template sensor that reflects the same data as that attribute, assuming it’s a number, and give it a state_class and a unit of measurement and it is supposed to show up in history for you.

Thanks @Sir_Goodenough - ive thought that route as well, only problem i foresee is if i want to store a weeks worth of data. Understanding the state field has a 255 character limit if im not mistaken, which if i have 30 attributes with chararcters within (15 feeding attributes with time, and ounces) i feel like that would fill the state pretty quickly unless im thinking of this incorrectly?

Why not just use th Excel integration?

Looking for visualizations and notifications to our phones, are you able to write to the file then extract that data in an automation?

Don’t think so…
Perhaps a calendar that you add things to?

After thinking about this, I think this is a simple and straight forward solution that can work. I appreciate the thiught!!