Dashboard variables#109
Conversation
|
Seems a very promising feature!
|
|
@ildar170975 Just checked, it's working as you said. |
|
@swiergot |
|
@swiergot |
|
@ildar170975 Here it is: |
|
The current usage for global var is: Assume we have multiple dashboards in yaml mode. where the But still we have to store ALL our vars in ONE file. where So far it works OK, thank you very much! And we came to my proposal. That is why I propose to omit the "variables" level; and we may rename the section to "config_template_card_vars". What do you think? |
|
Makes sense. I don't expect any other configuration than variables to end up there. |
|
Great thanks! Started testing. |
|
Strange, it does not work.
|
|
This may simply be a cache issue. First, if you have Then try to open this in the web browser: http://HA-HOST:8123/hacsfiles/config-template-card/config-template-card.js I suspect it will be the old version. Press F5 to refresh. Then reload the dashboard. |
Shame on me.
Have just "js" file. I copied "gz" file, then ran "gunzip xx.gz".
Checked it's content right after unzipping, found a desired "config_template_card_vars" keyword ))). Thanks a lot once more! |
|
You're welcome. Thank you for testing and feedback. |
|
Very cool! Looks great! Sorry for the delay, haven't been keeping up on my repos as of late. |
|
Thanks. Updating both the .js and .js.gz files did the trick! Awesome. |
If you need to use the same variable in multiple cards, then instead of defining it in each card's
variablesyou can do that once for the entire dashboard.Both arrays and objects are supported, just like in card's local variables. It is allowed to mix the two types, i.e. use an array in dashboard variables and an object in card variables, or the other way around. If both definitions are arrays, then dashboard variables are put first in
vars. In the mixed mode,varshave array indices and as well as variable names.