hassan
(HK)
August 24, 2018, 4:08pm
1
Hello,
Can i do this for mqtt name:
name: "Nivels {{ states.sensor.choosen_direction.state |replace ("_", " ") |capitalize }}"
i need to have the name as template that changes and also the state_topic that corresponds
also is it possible to save this data as a dynamic sensor o dynamic matrix or victor
Thanks in advanced
gpbenton
(Graham)
August 25, 2018, 6:13am
2
I have never seen templates being used in the name field before, so I don’t think it is possible.
hassan
(HK)
August 27, 2018, 12:52am
3
Hello, what about this ?? is it possible ?
it is supposed to run the script 4 times everytime with the selected value
action:
- service_template: >
{%- for SelectedX in ("value_1", "value_2", "value_3", "value_4") -%}
service: script.turn_on
entity_id: script.control_data
variables:
Selected: "{{SelectedX}}"
{% endfor %}
gpbenton
(Graham)
August 27, 2018, 11:08am
4
This is way beyond my jinja skills. Anything this complex I do in Python using appdaemon.
hassan
(HK)
August 27, 2018, 12:00pm
5
gpbenton:
using
The syntax is correct but Ha gives invalid template service when executed!!!
hassan
(HK)
August 27, 2018, 10:21pm
6
how about this ??
needs a python code??
- service_template: >
{%- for SelectedX in states.input_select.chooser.attributes.options -%}
- service: script.turn_on
entity_id: script.control_script
variables:
Selected: "{{SelectedX}}"
- delay: 00:00:{{ states.sensor.tiempo_movemiento.state }}
- delay: 00:00:12
- service: script.turn_off
entity_id: script.control_script
{% endfor %}
what is the equivalent python script to this?