Can't get response_variable when stop is in nested block of script

I’m getting a similar issue here, and I’m pretty sure it’s not a scope issue.

I have a script that sends a Telegram message and expects a Action or No Action response. I have a global variable defined at the top level of the script to store the script’s outcome. Here’s a truncated version of the script to demonstrate

alias: Ask home to close windows
# ...
variables:
  result:
    no_action: false
# ...
sequence:
  - service: telegram_bot.send_message
    alias: Ask for user input on Telegram
    data:
# ...
  - wait_for_trigger:
# ...
  - choose:
# ...
    default:
      - stop: User wants manual_mode to stay on
        response_variable: result
  - variables:
      result:
        no_action: true
  - stop: Done
    response_variable: result

If I let the script play out such that the final stop: Done is reached, I get a response with:

no_action: true

If I force it to enter the default block where the early stop is, I get a response with


Nothing at all… even if I add a similar variables definition right before the stop at the same indent level, I get nothing. Also tried using a different variable altogether so that it doesn’t collide with the global one, nothing.

It’s not a scope issue, the stop command just literally doesn’t seem to pass anything as a response no matter what if it’s in a nested block.

4 Likes