Add simple data template ability to visual editor

I created a irrigation automation completely using the visual editor with dedicated Lovelace page. Fantastic! Where this broke was when I wanted to set the runtime dynamically in Lovelace using an input_datetime.
Instead of

- service: timer.start
  data:
    duration: '30'

I am now using

- service: timer.start
  data_template:
    duration: '{{ states.input_datetime.irrigation_frontyard_run_time.state }}'

which is fine BUT
it completely breaks the ability to use the visual editor for further editing

The above line is embedded in a complex Choose operation at which the visual editor swithes into YAML view - but doesn’t even display all to the end

This gave me a heart attach until I found that switching to “Edit in YAML” still showed the whole automation

I love the ability with the new visual editor - but it kin of defeats the purpose if a simple chnage such as this completely breaks it.

Hi and welcome to the forum.

Please have a read of point 11 here, then edit your post to correctly format your configuration examples.

The automation editor is currently intended for basic automations. Templates are considered “advanced” automation and you should be comfortable using YAML if using them.

Template support may be added to the editor in future but I don’t think it is a priority right now.

Also, don’t forget to vote for your own request.

Hi Tom,
I understand what you are saying regarding templating.
I get it done - with a lot of googling etc. - the visual editor is just so much faster.

I just felt weird to me that it is possible to use an input_datetime as a trigger condition whereas it is not possible to use it to set a timer duration. That seems to be a rather common use case.

Still giving it my vote :slight_smile:

I (respectfully) disagree. Since the introduction of blueprints there are simple examples that make this item much more needed then you say.
Simple example is the “low battery level notification blueprint”. It is capable of sending notifications of the sensors that have low battery. So you go into the editor and do the things you do. Until you get to the notification part. In the sideline it says: “{{sensors}} is replaced with the names of sensors being low on battery.”
You then start editing your message and as soon as you type in the {{ the whole action field turns into this yaml box. This is certainly not the thing I expected, let alone wanted. I still wanted to set a target and a title to the message, but it’s all gone.

I see your point but that is something you should take up with the creator of the blueprint.

And again I strongly disagree. This is something that will be added more and more by blueprints or by integrations. Yet in the integration Alarmo it does work as intended. So why would it be so hard (and dismissed by you) for the HA core to implement?

It’s not up to me. I’m merely relaying previous sentiment expressed by the developers.

Ok, when and where (Github)? Because then it is better for me to take this discussion over there.

Discord mostly.