The automation/script editing UI is great, but it takes up a lot of space. Sometimes scrolling through an automation it’s easy to lose your place (especially on smaller screens) and lose track of what the automation does.
It would be nice to have a View mode that shows the automation/script concisely.
Now, you could check the YAML - but that isn’t always the easiest to understand quickly either.
I’m open to critique on this specific automation, the point of this feature request stands in general, this is just one I was working on recently and realized it was getting very long even though it’s a fairly simple automation.
For example instead of this:
Or even the YAML:
alias: Master fan hours
description: ''
trigger:
- platform: time
at: '19:30:00'
id: evening
- platform: time
at: '07:30:00'
id: morning-weekday
- platform: time
at: '10:55:00'
id: morning-weekend
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: morning-weekday
- condition: time
before: '00:00:00'
weekday:
- mon
- tue
- wed
- thu
- fri
after: '00:00:00'
sequence:
- type: turn_off
device_id: 9918c51356b7849c7bb93537ad64a88d
entity_id: switch.sonoff_s31_3_relay
domain: switch
- conditions:
- condition: trigger
id: morning-weekend
- condition: time
before: '00:00:00'
weekday:
- sun
- sat
after: '00:00:00'
sequence:
- type: turn_off
device_id: 9918c51356b7849c7bb93537ad64a88d
entity_id: switch.sonoff_s31_3_relay
domain: switch
- conditions:
- condition: trigger
id: evening
sequence:
- type: turn_on
device_id: 9918c51356b7849c7bb93537ad64a88d
entity_id: switch.sonoff_s31_3_relay
domain: switch
default: []
mode: single
You could see something like this:
Triggers:
- ID: evening
- Type: Time, At Time: 07:30:00PM
- ID: morning-weekday
- Type: Time, At Time: 07:30:00AM
- ID: morning-weekend
- Type: Time, At Time: 10:55:00AM
No conditions
Actions:
- Choose
- Option 1
- Conditions
- Triggered by: morning-weekday
- Time: Any Time, Weekdays: mon, tue, wed, thu, fri
- Actions
- Device: Master Fan, Action: Turn off Sonoff S31-3 Relay
- Conditions
- Option 2
- Conditions
- Triggered by: morning-weekend
- Time: Any Time, Weekdays: sat, sun
- Actions
- Device: Master Fan, Action: Turn off Sonoff S31-3 Relay
- Conditions
- Option 3
- Conditions
- Triggered by: evening
- Actions
- Device: Master Fan, Action: Turn on Sonoff S31-3 Relay
- Conditions
- Option 1
There could be better ways to display these too, for example if there is only the “Choose” option, that line could be removed to be more concise.
I fully acknowledge there would be some edge cases that could complicate this, but it seems like it would make automations much more human readable to do something like this.
Maybe a good enough fix would be to show the YAML version, but strip out things that humans don’t need, like device_id
s, concatenate lists (like mon,tue,wed,thu,fri
), and try to remove settings that are not used (like for time when before/after are defaults, so it boils down to “any time”).