PiotrMachowski / Home-Assistant-Lovelace-HTML-Jinja2-Template-card

This card displays provided Jinja2 template as an HTML content of a card. It uses exactly the same engine as Home Assistant in Developer tools.
MIT License
68 stars 10 forks source link

List of files from a directory #9

Closed tunerooster closed 3 years ago

tunerooster commented 3 years ago

I would like to get a list of files from a directory. Ideally, I would like to spawn a shell command (ls -t | head) to do this, like node's "child_process" package. Is it possible to:

If not, is there any way to do this?

The files would be stored in a list which I would traverse... Thanks!!

PiotrMachowski commented 3 years ago

It's not possible to do it in a card, you would have to create a sensor for it. This one should do the job: https://www.home-assistant.io/integrations/sensor.command_line/