tips
10 tips Yaml
One command, setting or habit at a time about Yaml: what it does, the line to copy and a caveat or two.
Automation options 3
-
Set timeout and continue_on_timeout on wait_for_trigger to decide what happens when nothing arrives.
actions: -
A repeat until loop ends when its condition is met, so add a repeat.index check to bound it.
actions: -
stop ends the whole automation or script run, and error: true marks it as failed.
- stop: "Nobody is home, nothing left to do"
Template functions 3
-
iif() turns a condition into one of two values in a single template expression.
iif(condition, if_true, if_false, if_none) -
has_value() is true only when the entity exists and is not unavailable or unknown.
Sensor is available -
today_at("18:00") returns today's date at that time, so you can compare it with now().
Apps and containers 2
-
Puts the sensor, helper and automation for one feature in a single YAML package file.
packages: !include_dir_named packages -
Defines a settings block once and reuses it in several services of one compose file.
x-common: &common
Linting 2
-
Print yamllint results as one machine-readable line per problem.
yamllint -f parsable config.yaml -
Switch yamllint to a more forgiving preset so real YAML errors stand out.
yamllint -d relaxed docker-compose.yml
Nothing in this filter yet.