Automation tool - how to add a data template

I am updating an input_number using the automation tool editor, however I can’t see how to select a data_template: vs data:? I was able to add the data_template via directly editing the automation.yaml file, however this does not show in the editor after the fact either.

Is this a missing feature in the editor, or am I just missing something?

hardware Pi3+, supervisor 228, HassOS 4.11

template wanted: {{ (states(“input_number.workshop_heat_hours”)| float + states(“sensor.heat_workshop”) |float) }}

automation.yaml:


- data_template:
      entity_id: input_number.workshop_heat_hours
      value:
        '{{ (states("input_number.workshop_heat_hours")| float +states("sensor.heat_workshop") |float) }}'

    service: input_number.set_value

automation tool:
image

Welcome!

As per the docs:

The Automation Editor does not currently support data_template as a “Service Data” entry. For these actions, it will be necessary to edit as YAML. This can be achieved by clicking the menu (3 vertical dots) and selecting “Edit as YAML”

Personally, I’ve given up on the editor due to its shortcomings. You can have a mixed environment easily enough — put this in configuration.yaml:

automation: !include automations.yaml
automation old: !include_dir_merge_list automations

then the editor will write to automations.yaml and you can keep your hand-written automations in automations/*.yaml. This also stops the editor from deleting your comments and re-ordering your declarations.

2 Likes

Thanks, I couldn’t come up with the right search term to find the automation editor docs.

The tip will be appreciated once I start developing more complex automations. At this point I am still learning the simple principles of the language.
Perhaps a link could be added to the configuration home page.