-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Objects available for the value_template not listed. #32
Comments
Hi yes the documentation doesn't cover it, i will fix it. Aynyway here is the answer #23 |
Thanks for reply! Did not expect such syntax... I need to apply 'split' procedure to a string, then take n-th element out of the array/list, how would I do that? To be specific: |
you could try here is test {% set test = "1.2345#write_timestamp" %}
{{ test.split("#")[0] | float }}
I don't have such an entity to try out, you could try to turn on the debug and see the result template and play with it in HA dev tools |
Thanks for the reply! There is a confusion. The question was not how to use split, since already use it in my templates, but how to apply split in your value_template section, if there is no name of the variable which stores the attribute value? |
I understand what you ask for. All what value_template: ".split("#")[0] | float" |
Unfortunatelly, it is not valid: Thus, I guess, it shiuld transform into feature request at this stage. Motivation: Thus, having a variable, which stores a string value of the attribute would be usefull to unleash the full scale access to templating. |
Rather then making a future request, you could propose a code via PR. I'm busy at the moment so this will park at the bottom of my todo list unless you write and test the code in which case I will review it asap. |
Hello!
This is a request for the information. We all know that templating is simple, fast and fun way to achieve fantastic results, but your docs lack the list of objects accessible from the value_template section, namelly how to retrive the entity's attribute's value to process it, what is the name of that variable (attr/attribute/value...)?
Example: I have an couple of entities with an attribute's name A. How to address this attribute's value in the value_template (I belive there should be a variable to store the value, shouldn't it?)
Tiny example of value_template would explain it all...
Thanks!
The text was updated successfully, but these errors were encountered: