mirror of
https://github.com/esphome/esphome.git
synced 2026-02-18 15:35:59 -07:00
c1838fae6282aa8662fb10638948c863e532f1cc
This adds the ability for ESPHome-defined actions (services) to send
responses back to Home Assistant. This is the complement to the existing
feature that allows ESPHome to receive responses from HA actions.
New features:
- ExecuteServiceResponse protobuf message (ID 131) for sending responses
- call_id field in ExecuteServiceRequest for tracking service calls
- api.respond action for sending responses from YAML automations
- Support for JSON response data via data: lambda
Example usage:
```yaml
api:
actions:
- action: get_sensor_value
variables:
sensor_name: string
then:
- api.respond:
data: |-
root["value"] = id(my_sensor).state;
root["unit"] = "°C";
```
Note: This requires corresponding changes in aioesphomeapi and
home-assistant/core to handle the new messages.
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme
Multiple Licenses
361 MiB
Languages
C++
64.2%
Python
35.5%
C
0.2%
