How to test variables in template editor?

Is there a way to create variables in the template editor such that they match what the variables section is?

I use the template editor to learn a lot of things and want to be able to try out jinja2 filters and whatnot I can apply to the variables…but not sure how to declare something that would be the same.

{% set %} isn’t quite the same yet as the variable templates are currently always strings (will be different in 0.118) and I’m also not sure how to create the map/array types that variables can do.

Also, I guess while I’m here, when are the variables defined in a top level automation evaluated? Can I use “trigger.to_state” type things? Or maybe even just “state.attributes” depending on where I want to use it? My guess is trigger isn’t yet set at this point. I’ll have to create some test automations to play around with these.

Ok, I think the variables are just stored as dict type, so the following seems to work well enough for testing in the template editor.

{% set devices = dict(switch=dict(outdoor_switch_1='', 
                                  outdoor_switch_2=''), 
                      light=dict(kitchen_dimmer='', living_room_dimmer=''),
                      lock=states('binary_sensor.main_entry'),
                      another_device='test2') %}

It’s not pretty, especially the further nested this goes.