Editing in YAML has a big advantage of being able to put comments within the code → to explain what a specific part of code does, or WHY is it that way.
It’s currently not possible in any way within UI. What’s even worse, if I add my comments in YAML and edit the automation/script via UI → the comments get deleted!
Feature Request 1: add a possibility to “comment” anything in automations, scripts, service calls, etc. I propose description
field added “universally” for everything feasible.
Example:
- id: '123'
alias: Some automation
description: 'The description of the whole automation - currently possible to do, nice :)'
trigger:
- platform: device
domain: mqtt
device_id: 12345
type: action
subtype: 1_single
description: 'Some explanation for the trigger - FR!'
condition: []
action:
- if:
- condition: state
entity_id: input_select.home_state
state: Bedtime
description: 'Some explanation for the condition - FR!'
then:
- service: input_select.select_option
description: 'Some explanation for the service call - FR!'
metadata: {}
data:
description: 'Why not even more nested "comments"? – FR!'
option: Daytime
target:
entity_id: input_select.home_state
mode: single
This would allow for the “comments” (“descriptions”) not to be removed by the UI → BUT ALSO: they could/should be handled by the UI.
Feature Request 2: show and allow to add/edit/remove those description
fields within the UI.
Side note: if description
is too generic, could be name-clashing, let’s make it more special like _description
, or just _desc
to be shorter, or _comment
, or $comment
, or some any other way. The point being: special key as a replacement for YAML comments, that would also be handled by the UI.
Side note 2: it would also be great for Lovelace dashboards!