#Dynamically generated content in lovelace views

1 messages · Page 1 of 1 (latest)

clear perch
#

Hi all, I'm looking for ways how to dynamically show stuff on my lovelace views, e.g. my wallpanels.

I am not looking for a solution based solely on conditional cards: The decision on what is shown in the lovelace view shall be fully controllable by an external application, e.g. my state machine in node-red or other stuff. For example, I want to possibly display the graph of one sensor out of 1500 different sensors. This is because of the external tools I'm developing for myself.

Example Use Cases:

  • Show graphs of the top 10 most critical anomalies in my numerical sensors (decided by some anomaly detection project I'm tinkering with)
  • Show the top 3 buttons of 50 possible buttons most likely to be pressed next (again, decided by external logic)
  • Let an LLM generate the Lovelace YAML completely and dynamically every 5 minutes.

I hope that shows that conditional cards would be unfeasible here. Yes, I could get help from an LLM and generate all that stuff but I really don't like all the helper logic n stuff I need.

Ideas considered:

  • AFAiK there is no card which can be injected with Lovelace YAML and it renders that YAML dynamically.

  • Having a "sensor.button_entity_id" set dynamically and defining a button with entity_id: {{ states.sensor.button.entity_id.state }} is not supported AFAIK

  • Generating the lovelace yaml and making it active somehow in HA: I've read about some hacky integrations but would prefer a proper interface, don't think that is really supported, right?

  • Use Grafana Image Renderer, an Grafana IFrame or similar: I'm doing that already but I don't look the different look and feel compared to the rest of my lovelace interface. Still an OK alternative.

Looking forward to hear how you might have solved this or think what the best solution would be. Also let me know if you think this would be a sensible feature request to the Home Assistant product itself.

Thanks for reading!

hearty dragon
#

Generating the lovelace yaml and making it active somehow in HA: I've read about some hacky integrations but would prefer a proper interface, don't think that is really supported, right?

I think this is feasible?

#

Do you want everything to be externally generated, or do you want some dashboards built in the ui editor, and some dashboards to be externally generated?

#

You just need your external application to write a yaml file and dump it into the ha config directory

clear perch
#

unfortunately the latter - some externally, some 'normally' defined ..

hearty dragon
#

that's still possible

#

see from the link:

You can also add YAML dashboards when your main dashboard is UI configured: