mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-30 20:56:52 +00:00
Use context data to debug templates
New context data option on the Developer Tools -> Template tab makes it easier to debug automations. Can just copy and paste the YAML from from the traces instead of creating a bunch of variables in Jinja at the top.
This commit is contained in:
parent
364fdc00f7
commit
5c29959324
@ -40,6 +40,6 @@ It is also useful to go to **{% my server_controls title="Configuration -> Serve
|
||||
If your automation uses templates in any part, you can do the following to make sure it works as expected:
|
||||
|
||||
1. Go to **{% my developer_template title="Developer tools -> Template" %}** tab.
|
||||
2. Create all variables (sources) required for your template as described at the end of [this](https://www.home-assistant.io/docs/configuration/templating/#processing-incoming-data) paragraph.
|
||||
3. Copy your template code and paste it in Template editor straight after your variables.
|
||||
4. If necessary, change your sources' value and check if the template works as you want and does not generate any errors.
|
||||
1. In your trace go through the steps preceeding the one with your template and copy what you need from the `changed variables` tabs into `Context data for template` in the Template tab. *Tip: `trigger` and `this` are set in the very first step*
|
||||
1. Copy your template code and paste it in Template editor straight after your variables.
|
||||
1. Change the template and (if necessary) sources' value until the template works as expected without errors.
|
||||
|
Loading…
x
Reference in New Issue
Block a user