@@ -60,7 +60,7 @@ Configuration variables:
6060 document .getElementById (" api-key" ).value = bytesArrToBase64 (array);
6161 </script >
6262
63- - **services ** (*Optional *, list): A list of user-defined services . See :ref: `api-services `.
63+ - **actions ** (*Optional *, list): A list of user-defined actions . See :ref: `api-device-actions `.
6464- **reboot_timeout ** (*Optional *, :ref: `config-time `): The amount of time to wait before rebooting when no
6565 client connects to the API. This is needed because sometimes the low level ESP functions report that
6666 the ESP is connected to the network, when in fact it is not - only a full reboot fixes it.
@@ -79,7 +79,7 @@ Actions
7979-------
8080
8181Before using any of the actions below, you'll need to tell Home Assistant to allow your device to
82- make service calls .
82+ perform actions .
8383
8484Open the ESPHome integration page on your Home Assistant instance:
8585
9191
9292#. Find your device in the device list
9393#. Click the "configure" button next to it
94- #. Check the "Allow the device to make Home Assistant service calls " box
94+ #. Check the "Allow the device to perform Home Assistant actions " box
9595#. Then click "submit".
9696
9797.. _api-homeassistant_event_action :
@@ -102,7 +102,7 @@ Then:
102102.. note ::
103103
104104 Be sure to :ref: `follow the instructions above <api-actions >` to tell Home Assistant to allow
105- your device to make service calls .
105+ your device to perform actions .
106106
107107When using the native API with Home Assistant, you can create events in the Home Assistant event bus
108108straight from ESPHome :ref: `Automations <automation >`.
@@ -127,31 +127,30 @@ Configuration variables:
127127- **variables ** (*Optional *, mapping): Optional variables that can be used in the ``data_template ``.
128128 Values are :ref: `lambdas <config-lambda >` and will be evaluated before sending the request.
129129
130- .. _api-homeassistant_service_action :
130+ .. _api-homeassistant_action-action :
131131
132- ``homeassistant.service `` Action
132+ ``homeassistant.action `` Action
133133********************************
134134
135135.. note ::
136136
137137 Be sure to :ref: `follow the instructions above <api-actions >` to tell Home Assistant to allow
138- your device to make service calls .
138+ your device to perform actions .
139139
140- When using the native API with Home Assistant, you can create Home Assistant service
141- calls straight from ESPHome :ref: `Automations <automation >`.
140+ When using the native API with Home Assistant, you can perform Home Assistant actions straight from ESPHome :ref: `Automations <automation >`.
142141
143142.. code-block :: yaml
144143
145144 # In some trigger
146145 on_... :
147146 # Simple
148- - homeassistant.service :
149- service : notify.html5
147+ - homeassistant.action :
148+ action : notify.html5
150149 data :
151150 message : Button was pressed
152151 # With templates and variables
153- - homeassistant.service :
154- service : notify.html5
152+ - homeassistant.action :
153+ action : notify.html5
155154 data :
156155 title : New Humidity
157156 data_template :
@@ -163,10 +162,10 @@ calls straight from ESPHome :ref:`Automations <automation>`.
163162 Configuration variables:
164163````````````````````````
165164
166- - **service ** (**Required **, string): The Home Assistant `Service <https://www.home-assistant.io/docs/scripts/service-calls/ >`__
167- to call .
168- - **data ** (*Optional *, mapping): Optional *static * data to pass along with the service call .
169- - **data_template ** (*Optional *, mapping): Optional template data to pass along with the service call .
165+ - **action ** (**Required **, string): The Home Assistant `Action <https://www.home-assistant.io/docs/scripts/service-calls/ >`__
166+ to perform .
167+ - **data ** (*Optional *, mapping): Optional *static * data to perform the action with .
168+ - **data_template ** (*Optional *, mapping): Optional template data to perform the action with .
170169 This is evaluated on the Home Assistant side with Home Assistant's templating engine.
171170- **variables ** (*Optional *, mapping): Optional variables that can be used in the ``data_template ``.
172171 Values are :ref: `lambdas <config-lambda >` and will be evaluated before sending the request.
@@ -182,7 +181,7 @@ the parameters in plain format.
182181 set_light_rgb :
183182 alias : ' ESPHome RGB light set'
184183 sequence :
185- - service : light.turn_on
184+ - action : light.turn_on
186185 data_template :
187186 entity_id : ' {{ light_name }}'
188187 rgb_color :
@@ -196,8 +195,8 @@ Then, in ESPHome:
196195
197196 # In some trigger
198197 on_... :
199- - homeassistant.service :
200- service : script.set_light_rgb
198+ - homeassistant.action :
199+ action : script.set_light_rgb
201200 data :
202201 light_name : ' my_light'
203202 red : ' 255'
@@ -212,7 +211,7 @@ Then, in ESPHome:
212211.. note ::
213212
214213 Be sure to :ref: `follow the instructions above <api-actions >` to tell Home Assistant to allow
215- your device to make service calls.
214+ your device to make action calls.
216215
217216When using the native API with Home Assistant, you can push tag_scanned to Home Assistant
218217straight from ESPHome :ref: `Automations <automation >`.
@@ -289,27 +288,27 @@ if logs are shown remotely.
289288 then :
290289 - logger.log : API is connected!
291290
292- .. _api-services :
291+ .. _api-device-actions :
293292
294- User-defined Services
295- ---------------------
293+ User-defined Actions
294+ --------------------
296295
297- It is also possible to get data from Home Assistant to ESPHome with user-defined services .
298- When you declare services in your ESPHome YAML file, they will automatically show up in
296+ It is also possible to get data from Home Assistant to ESPHome with user-defined actions .
297+ When you declare actions in your ESPHome YAML file, they will automatically show up in
299298Home Assistant and you can call them directly.
300299
301300.. code-block :: yaml
302301
303302 # Example configuration entry
304303 api :
305- services :
306- - service : start_laundry
304+ actions :
305+ - action : start_laundry
307306 then :
308307 - switch.turn_on : relay
309308 - delay : 3h
310309 - switch.turn_off : relay
311310
312- For example with the configuration seen above, after uploading you will see a service
311+ For example with the configuration seen above, after uploading you will see an action
313312called ``esphome.livingroom_start_laundry `` (livingroom is the node name) which you can
314313then call.
315314
@@ -319,8 +318,8 @@ Additionally, you can also transmit data from Home Assistant to ESPHome with thi
319318
320319 # Example configuration entry
321320 api :
322- services :
323- - service : start_effect
321+ actions :
322+ - action : start_effect
324323 variables :
325324 my_brightness : int
326325 my_effect : string
@@ -331,18 +330,18 @@ Additionally, you can also transmit data from Home Assistant to ESPHome with thi
331330 effect : !lambda 'return my_effect;'
332331
333332 Using the ``variables `` key you can tell ESPHome which variables to expect from Home Assistant.
334- For example the service seen above would be executed with something like this:
333+ For example the action seen above would be executed with something like this:
335334
336335.. code-block :: yaml
337336
338- # Example Home Assistant Service Call
339- service : esphome.livingroom_start_effect
337+ # Example Home Assistant Action
338+ action : esphome.livingroom_start_effect
340339 data_template :
341340 my_brightness : " {{ states.brightness.state }}"
342341 my_effect : " Rainbow"
343342
344343 Then each variable you define in the ``variables `` section is accessible in the automation
345- triggered by the user-defined service through the name you gave it in the variables section
344+ triggered by the user-defined action through the name you gave it in the variables section
346345(note: this is a local variable, so do not wrap it in ``id(...) `` to access it).
347346
348347There are currently 4 types of variables:
0 commit comments