Home Assistant: Difference between revisions
update heading level |
Modernize automation syntax |
||
Line 413: | Line 413: | ||
{ | { | ||
alias = "Name To Display in Automations List"; | alias = "Name To Display in Automations List"; | ||
triggers = { | |||
trigger = "state"; | |||
entity_id = "binary_sensor.someid1"; | entity_id = "binary_sensor.someid1"; | ||
to = "off"; | to = "off"; | ||
for = "00:10:00"; | for = "00:10:00"; | ||
}; | }; | ||
conditions = { | |||
condition = "state"; | condition = "state"; | ||
entity_id = "binary_sensor.someid2"; | entity_id = "binary_sensor.someid2"; | ||
state = "on"; | state = "on"; | ||
}; | }; | ||
actions = { | |||
action = "light.turn_off"; | |||
entity_id = "light.someid"; | entity_id = "light.someid"; | ||
}; | }; | ||
Line 435: | Line 435: | ||
{ | { | ||
alias = "Name in Automations GUI"; | alias = "Name in Automations GUI"; | ||
triggers = { | |||
trigger = "state"; | |||
entity_id = "binary_sensor.someid"; | entity_id = "binary_sensor.someid"; | ||
to = "on"; | to = "on"; | ||
}; | }; | ||
conditions = [ | |||
{ | { | ||
condition = "state"; | condition = "state"; | ||
Line 452: | Line 452: | ||
} | } | ||
]; | ]; | ||
actions = [ | |||
{ | { | ||
ation = "notify.notify"; | |||
data = { | data = { | ||
message = "Some Notification"; | message = "Some Notification"; | ||
Line 472: | Line 472: | ||
{ | { | ||
alias = "Some Name"; | alias = "Some Name"; | ||
triggers = { | |||
trigger = "numeric_state"; | |||
entity_id = "sensor.batteries"; | entity_id = "sensor.batteries"; | ||
below = "45"; | below = "45"; | ||
}; | }; | ||
actions = { | |||
action = "notify.notify"; | |||
data = { | data = { | ||
message = "Low Battery Detected"; | message = "Low Battery Detected"; | ||
Line 490: | Line 490: | ||
{ | { | ||
alias = "Object Went Unknown"; | alias = "Object Went Unknown"; | ||
triggers = { | |||
trigger = "state"; | |||
entity_id = "switch.someid"; | entity_id = "switch.someid"; | ||
to = "unknown"; | to = "unknown"; | ||
for = "00:5:00"; | for = "00:5:00"; | ||
}; | }; | ||
actions = { | |||
action = "notify.notify"; | |||
data = { | data = { | ||
message = "Object Went Offline"; | message = "Object Went Offline"; | ||
Line 510: | Line 510: | ||
{ | { | ||
alias = "Do Something At Certain Time"; | alias = "Do Something At Certain Time"; | ||
triggers = { | |||
trigger = "time"; | |||
at = "23:00:00"; | at = "23:00:00"; | ||
}; | }; | ||
actions = { | |||
action = "climate.set_temperature"; | |||
entity_id = "climate.thermostat"; | entity_id = "climate.thermostat"; | ||
data = { | data = { |