Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Feature request: Define Entities using YAML Template #120

Closed
teskanoo opened this issue Dec 31, 2022 · 3 comments
Closed

Feature request: Define Entities using YAML Template #120

teskanoo opened this issue Dec 31, 2022 · 3 comments

Comments

@teskanoo
Copy link

Not sure if this is possible but thought it might be worth asking.

My use-case is to chart the various entities that are used in a Bayesian sensor.

I currently use a combination of the custom auto-entities card and generic history graph to achieve this, but of course do not have the massive advantage of being able to scroll through time as I can with the fantastic history-explorer-card

generic history graph
image
I generate the entities list for the history-graph using the template: attribute of custom:auto-entities

{%- set bayes_sensor = 'binary_sensor.teskanoo_home_bayesian' -%}
{%- set ns = namespace(test_entities=[]) -%}
{%- set bayes_observations = state_attr(bayes_sensor, 'observations') -%}
{%- set ns = namespace(entities=[]) -%}
{%- for observation in bayes_observations -%}
  {%- set entity_id = observation.get('entity_id') -%}
  {%- set ns.entities = ns.entities + [entity_id] -%}
{%- endfor -%}
{{ ns.entities | unique | list }}

So my question is, would there be any chance of allowing the graph->entities node to be populated from a YAML template - I have tried this using [auto-entities] in combination with [history-explorer-card] to achieve something similar, but have had no success as the entities node for [history-explorer-card] is not a top level node

Thanks for your consideration - so very grateful for your wonderful work and continued enhancements on this card

@alexarch21
Copy link
Owner

I personally try to stay away as far as I possibly can from Jinja, so I don't really know how these auto generated cards work. How would that work in practice, what exactly would you need the history explorer card to do for that to work ? And what exactly is preventing it from working as it is now ?

@alexarch21
Copy link
Owner

Any updates on this or can I close this issue ?

@alexarch21
Copy link
Owner

I'm closing this due to lack of information and feedback.

@alexarch21 alexarch21 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants