In a recent Github issue it was requested to have a look at the TOML format. An interested (and opinionated) article about the issues with YAML was linked as well. Reading through that linked article has made me wonder if the YAML format really is the best format for Automations and other things.
This made me wonder how some of my automations would look in TOML format.
A simple automation to turn of some lights when going to bed in my case would look like below:
alias = "Good Night"
mode = "single"
[[triggers]]
device_id = "9891fe7bd87963f017995dd58dbef78d"
domain = "zha"
type = "remote_button_long_press"
subtype = "remote_button_long_press"
trigger = "device"
[[actions]]
action = "light.turn_off"
[actions.data]
transition = 2
[actions.target]
entity_id = [
"light.kitchen",
"light.lounge",
"light.pantry_relay",
"light.dining_lights_relay",
"light.carport_lights_relay",
"light.deck_northern",
"light.shed_fan_light",
"light.deck_western_light",
"light.office_at_door",
"light.office_over_desk",
]
[[actions]]
action = "fan.turn_off"
[actions.target]
entity_id = [
"fan.office_fan",
"fan.dining_fan",
"fan.lounge_fan",
"fan.kitchen",
]
device_id = [
"fed61c03bc49ad8919e1782850a62853",
]
[actions.data]
[[actions]]
action = "input_boolean.turn_on"
[actions.data]
[actions.target]
entity_id = "input_boolean.asleep"
I am happy to share the original YAML code this orginated from.
I have also tried the same thing with another automation controlling our air-con that is using lots of value templates. I’d be happy to share that if anyone is interested. Fair warning though, it’s quite a bit longer
Anyway, just food for thought.
PS: Admins, if I put this in the wrong category, please advise where it should go and I’ll recreate there.