View template output from a script/automation

In trying to make template scripts, one of the biggest walls I hit is with debugging the output. Other than the template editor in the UI, there is no way to reasonably see what templates output, to make matters worse some templates seem to offer additional variables, but there is no way to debug these in the template editor in the UI.

It would be really nice if home assistant could log the output values from any automation that run, so I could see what the compiled template was to have a chance at debugging it. Take for example right now, one of my automations is causing this error: Invalid data for call_service at pos 1: not a valid value for dictionary value @ data['entity_id']. I have no idea what pos 1 was because I can only see the template string in my config, and the Logbook UI component is not much help as it just shows the current state of a component (in this case “automation was triggered” - but not what it was triggered with)