As a user able to create scenes,
I want to be able to pass one or more variables to the « Start the scene » block
So that I can create standard scenes that would only change based on these variables.
For example, there is a scene that sends a Telegram message, and this scene is called by several scenes.
The difference is that you can pass to this variable the user to whom to send the information and the message.
In my case I would like to be able to make a standard scene that would make an HTTP request to Node-RED to send a message to my Sonos.
And I would like to be able to call this scene in several scenes by passing it the room and the message as parameters.
I propose to enhance the Start Scene action by allowing parameters to be passed to it.
I present a use case:
- In many of my scenes, I systematically do two things: send an audio message to my smart speaker and send the same message as text via Telegram to my phone. Thus, if I am at home, I hear the information, and if I am outside, I receive the information.
- When building the scene, this forces me to add a
Send a message action and define the message, and add a Speak on a speaker action by defining the same message. And since I often build the message with a variable, it really needs to be entered manually because copying/pasting with variables is not possible.
- It would be much more practical to have a scene
Broadcast the info that accepts a text parameter, and that this scene performs both actions. And then from any scene, I could achieve both effects in a single action: calling the scene with the text as a parameter.
I therefore propose the following improvement:
- In the
Configuration section of a scene, or in a new section between Configuration and Triggers, have the ability to define one or more parameters by giving them a name (and possibly a type).
- In the scene, be able to use these parameters as variables {{ param1. Parameter name }}, {{ param2. Parameter name }}.
- In the
Start Scene action, if it is a scene with parameters, be able to define the parameter(s) in fields.
Thanks @StephaneB for the request, very clear with the use case, and thanks @spenceur for spotting it!
I’ll leave it to you: @StephaneB you’re a moderator, you can merge this topic into the older one (the 2022 one keeps the history, and we don’t lose your detailed content in the process).
More broadly, don’t hesitate to manage duplicates among yourselves without waiting for me, it allows me to focus fully on development and it’s a real help 