Home Assistant: Difference between revisions

N42 (talk | contribs)
update heading level
Modernize automation syntax
Line 413: Line 413:
         {
         {
           alias = "Name To Display in Automations List";
           alias = "Name To Display in Automations List";
           trigger = {
           triggers = {
             platform = "state";
             trigger = "state";
             entity_id = "binary_sensor.someid1";
             entity_id = "binary_sensor.someid1";
             to = "off";
             to = "off";
             for = "00:10:00";
             for = "00:10:00";
           };
           };
           condition = {
           conditions = {
             condition = "state";
             condition = "state";
             entity_id = "binary_sensor.someid2";
             entity_id = "binary_sensor.someid2";
             state = "on";
             state = "on";
           };
           };
           action = {
           actions = {
             service = "light.turn_off";
             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";
           trigger = {
           triggers = {
             platform = "state";
             trigger = "state";
             entity_id = "binary_sensor.someid";
             entity_id = "binary_sensor.someid";
             to = "on";
             to = "on";
           };
           };
           condition = [
           conditions = [
             {
             {
               condition = "state";
               condition = "state";
Line 452: Line 452:
             }
             }
           ];
           ];
           action = [
           actions = [
             {
             {
               service = "notify.notify";
               ation = "notify.notify";
               data = {
               data = {
                 message = "Some Notification";
                 message = "Some Notification";
Line 472: Line 472:
         {
         {
           alias = "Some Name";
           alias = "Some Name";
           trigger = {
           triggers = {
             platform = "numeric_state";
             trigger = "numeric_state";
             entity_id = "sensor.batteries";
             entity_id = "sensor.batteries";
             below = "45";
             below = "45";
           };
           };
           action = {
           actions = {
             service = "notify.notify";
             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";
           trigger = {
           triggers = {
             platform = "state";
             trigger = "state";
             entity_id = "switch.someid";
             entity_id = "switch.someid";
             to = "unknown";
             to = "unknown";
             for = "00:5:00";
             for = "00:5:00";
           };
           };
           action = {
           actions = {
             service = "notify.notify";
             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";
           trigger = {
           triggers = {
             platform = "time";
             trigger = "time";
             at = "23:00:00";
             at = "23:00:00";
           };
           };
           action = {
           actions = {
             service = "climate.set_temperature";
             action = "climate.set_temperature";
             entity_id = "climate.thermostat";
             entity_id = "climate.thermostat";
             data = {
             data = {