Markdown card : add a simple entry via script

Hello,
I never used the markdown card before.

I have a pellet stove.
I have a script that I run manualy (button) when I add a new bag of pellet, (so I can calculate stuff like running time, nb a bags, etc)

I just want a markdown card (or any texte card) that can keep track of when I added a bag, like a log basicaly.

Something that looks like this

1 - 4/11/2024 - 8h
2 - 8/11/2024 - 11h
3 - 12/11/2024 - 13h
4 - 15/11/2024 - 13h21
5 - 19/11/2024 - 8h30

So each time I run the script, it adds an entry with the next number, date and time.

I have absolutely no idea how to do that.
can anyone point me in the right direction ?

Thx a lot

Ho and I’m not sure I want to use the logbook custom entry because :

1- I need to manualy add the past value
2 - in case of error, in markdown i can easyly modify the entry

That’s the reason i was thinking of markdown

You need to provide a bit more details, where are these values stored (sensor attribute, file?) and how does that look like?

nothing is stored.
I just have a sensor that keep track of the number of bag used.
My script just +1 on this sensor each time it runs.

for the rest I just want to add one line

xx - date - time

somewhere.

the example I provided, is done manualy, in my google Keep.

HA card needs to read that data from somewhere (usually state or attribute) so WHERE do you store this info then?

that’s the whole question :smiley:

Nowhere yet, I was looking to create a text helper to append every time, but I don’t know how to do it.

I was looking to add a line a in markdown card, but i don’t know how to do it.

there I am ^^

Deleted earlier comment as I only gradually seem to understand where you are right now. Need to give it a bit of a thought.
What do you want to display in the end, a table or a graph?

I Just found a solution with the shopping list, and created a dedicated list
So I add a new item when my script tiggers, and insert the date and time.

But markdown would have been much more fun.
And I really don’t need the option of a shopping list (description, task done, etc)

My goal is basicaly to create a custom log, but editable, so the logger is out of the question.

Found this one thread, for sumppumplog…seems to cover what you want to store data in a file, you can then read the file back into the HA / markdown

Save state to text file - Home Assistant Community

the code is working, and i entered manually what’s been done in the past

I really didn’t think of storing in separate file.

That could do it.

I’ll look into it
thx a lot :slight_smile:

A less ‘nice’ solution is to use the to-do lists, you can use actions to add things to that too.
EDIT: and you should not need 1,2,3…markdown allows to sort on date(time)

1 2 3 is just to keep track of the bag number as I have 70 of them for the whole winter

Hello, Thx for your replies
I’ll stick with the to-list, after a couple of days it suits my need, and modified with Card-mod for better design.