WTH, why can't we test triggers or json in the template editor?

The template editor is great. It would be awesome if we had 3 modes in the template editor.

Mode1 (Normal)

The page would default to what we currently have, where you just test a template without any pre populated variables.

Mode2 (JSON Source)

The UI would have 2 fields. A JSON field and the existing template field.

The template field would automatically have 2 variables populated by the JSON field. value and value_json. These variables would behave the exact same way as any field that resolves json or value. I.e. rest sensors, mqtt entities, etc.

This would allow us to see when our json is invalid because value_json wouldn’t be populated (just like if it occured via our configuration)

Mode3 (Trigger Source)

The UI would have 2 fields. A trigger selector and the existing template field.

The trigger selector would just allow us to select a trigger. Pretty simple.

The template field would have a trigger variable populated by the trigger selector. The user would still have to trigger it manually (Press the physical switch, change the state, etc) in order for the template field to resolve a result.

I guess I should probably finish this :laughing: it got stalled out in review and then I forgot about it. Thanks for the reminder!

1 Like