From response variable to input text greater than 255

I am having a hard time displaying logs from a TTLock integration because of the 255 limit so the code works but only for low responses
alias: Recopilar-logs-funciona
description: “”
triggers:

  • trigger: state
    entity_id:
    • input_boolean.recopilar
      from: “off”
      to: “on”
      conditions:
      actions:
  • action: ttlock.list_records
    metadata: {}
    data:
    page_size: 100
    page_no: 1
    start_date: “{{ states(‘input_datetime.logs_inicio’) }}”
    end_date: “{{ states(‘input_datetime.logs_fin’) }}”
    target:
    entity_id: lock.departamento_302
    response_variable: registro_puerta
  • action: input_text.set_value
    metadata: {}
    data:
    value: |2-
    {% set lista = registro_puerta[‘records’][‘lock.departamento_302’] %}
    {% if lista %}
    {{ lista | map(attribute=‘username’) | list | join(‘\n’) }}
    {% else %}
    Nadie ha entrado en el rango seleccionado.
    {% endif %}
    target:
    entity_id: input_text.logs_entrada
  • action: input_boolean.turn_off
    metadata: {}
    data: {}
    target:
    entity_id: input_boolean.recopilar
    mode: single

https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

Also…

255 is the upper limit to an input text… You need an alternative

Just so people coming later don’t get confused, the 255 limit is for any state.

Use attributes!

1 Like

Thanks a lot!!!

Noted thanks!