Automatically change lovelace dashboard's code

Hi guys. I’m pretty new to HASS therefore I’m sorry if this question had been already asked. In my Home Assistant, using the AppDaemon add-on, I’ve written some code to automatically change some YAML configuration files based on some data I give to HAAS.
That’s because I didn’t want to manually write configuration files every time I want to add new devices.

Enough talking! I was wondering if something similar could be done in a lovelace dashboard, in particular if I could, somehow, automatically modify the YAML code, in order to show the new devices to the interface (I know the ‘Automatic’ dashboard already does that, but I want to personalize my dashboard).
I guess, deep down the OS, there are YAML files which are used by HAAS, if I’m right, are they accessible? Or maybe I’m wrong and there’s an easy way to do what I’d want.

Thanks in advance

If you change lovelace to yaml mode, you have your own yaml files that contain the configuration.

how can I do that?

Add this to configuration.yaml

  mode: yaml

okay I looked it up on the internet and now I’m trying to understand more from there. Huge thanks!
If I may also ask, I added the lines
since with yaml mode it must be done, but it doesn’t seem to work (HACS says ‘2 lovelace elements are not loaded properly in Lovelace’).

Please post properly formatted code, not pictures. The correct URL for cards installed via HACS is

- url: /hacsfiles/button-card/button-card.js

thanks, it worked!
I knew about the pictures but I didn’t understand how to write code in that manner