#Any ideas why this isn't setting the

1 messages · Page 1 of 1 (latest)

willow fractal
#
target:
  entity_id: input_text.elsternwick_disruption_info
data:
  value: >
    {% if elsternwick_disruption['content']['disruptions']['metro_train'] |
    length > 0 %}
      Description: {{ elsternwick_disruption['content']['disruptions']['metro_train'][0]['description'] }}
    {% else %}
      No disruption
    {% endif %}

Action ^

#

Trace result:

Result:
params:
  domain: input_text
  service: set_value
  service_data:
    value: >-
      Description: Buses replace trains between South Yarra and Elsternwick from
      8.30pm to last service each night, Sunday 8 September to Wednesday 11
      September, due to works.
    entity_id:
      - input_text.elsternwick_disruption_info
  target:
    entity_id:
      - input_text.elsternwick_disruption_info
running_script: false
#

So it's clearly getting the description, but its not being set in the variable. If I add the | length filter on the end it gives me the length of the string and updates the variable as expected

lament needle
#

probably maximum length violation, defaults to 100 I think?

willow fractal
#

ahh yep