Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95295

Templating question - passing data

$
0
0

@klogg wrote:

How can I pass a list of data, in this case room names, between scripts? I am trying like this which I do like this:

service: script.blah_blah
data:
  room: ['kitchen', 'sitting_room']

The script (blah_blah) that receives the data needs to pass it on to another script which I am trying to do like this:

service: script_waffle
data_template:
  room: >
   {{ room }}

All the code in both scripts work perfectly in the template editor. I test it there by setting the ‘room’ variable like this (which is how the original script passes it:
{% set room = ['kitchen', 'sitting_room'] %}

But in a ‘live’ environment the second script doesn’t work with the data passed to it like that.

My question is, how can I pass a list from one script to another script so that it stays as a list and not as a simple string, which I suspect is what is happening now ?

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95295

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>