Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
451471c
Add to component index (#5605)
swoboda1337 Nov 12, 2025
a99f785
Merge branch 'beta' into next
swoboda1337 Nov 12, 2025
c62590b
Merge branch 'current' into next
jesserockz Nov 12, 2025
8e79065
[select] Update documentation to use .current_option() method (#5562)
bdraco Nov 12, 2025
7cf6fa3
[rx8130] Add timezone setting for rx8130 platform (#5598)
lboue Nov 12, 2025
15ec4da
[nrf52] Dcdc (#5596)
tomaszduda23 Nov 13, 2025
2e3e305
Merge branch 'beta' into next
swoboda1337 Nov 13, 2025
bacc84f
Add 2025.11.0 Release Notes (#5617)
bdraco Nov 16, 2025
688fc08
Add security best practices documentation for users (#5612)
bdraco Nov 16, 2025
3e8d61d
Add automated release notes generator with AI-powered summaries (#5616)
bdraco Nov 16, 2025
d81a8ec
Merge branch 'beta' into next
jesserockz Nov 17, 2025
4f24388
[config] Document additional extend/remove supported behavior (#5523)
jpeletier Nov 17, 2025
15636e7
[core] Add support for setting environment variables (#5635)
swoboda1337 Nov 17, 2025
8cc821b
Merge branch 'current' into next
jesserockz Nov 17, 2025
a0d8801
[wifi][esp32_improv] Update default timeouts to 90s (#5639)
bdraco Nov 18, 2025
eff0c29
Merge branch 'current' into next
jesserockz Nov 18, 2025
c2ba845
Merge branch 'current' into next
jesserockz Nov 19, 2025
48c9caa
Merge branch 'beta' into next
jesserockz Nov 19, 2025
a6f8ffe
[nrf52,gpio] High voltage (#5595)
tomaszduda23 Nov 19, 2025
505be83
[epaper_spi] Add `7.3in Spectra-E6` model (#5646)
jesserockz Nov 19, 2025
0b3caec
Merge branch 'beta' into next
swoboda1337 Nov 19, 2025
499ab17
Merge branch 'current' into next
swoboda1337 Nov 19, 2025
fffe051
STTS22H component documentation (#5275)
B48D81EFCC Nov 20, 2025
7965873
Add documentation for HC8 CO2 sensor (#5613)
omartijn Nov 20, 2025
87d6be1
Doc for optional humidity sensor in climate_ir component (#5161)
damib Nov 20, 2025
8178cb0
[mcp3204] differential mode support (#5634)
markodraca Nov 21, 2025
90fd6c3
Add BM8563 time component documentation (#5542)
abmantis Nov 21, 2025
152485d
Add new model JC4880P443 to MIPI DSI documentation (#5670)
23900 Nov 24, 2025
dd41644
Wifi AP Condition (#5607)
AzonInc Nov 24, 2025
b4dc0bc
Add thermopro BLE support (#5593)
sittner Nov 24, 2025
f105481
[prometheus] New metrics for text and event components plus some exam…
jzucker2 Nov 24, 2025
6acef43
[api] Connected Condition - state_subscription_only flag (#5624)
AzonInc Nov 24, 2025
7a95fd3
Fix Typos / Duplicated Text (#5655)
Renegade605 Nov 20, 2025
a8beafe
Link blog post for network::get_use_address() migration in 2025.11.0 …
bdraco Nov 20, 2025
e4f736b
[climate] Document public accessor methods for custom modes in 2025.1…
bdraco Nov 20, 2025
006776c
[changelog] Fix blog post links in 2025.11.0 changelog (#5656)
bdraco Nov 20, 2025
0679435
[mipi_rgb] Clarify use of transform (#5649)
clydebarrow Nov 20, 2025
980a594
ESPNow fixes (#5658)
swoboda1337 Nov 21, 2025
dcb4ad3
[lvgl] Enhance 'indicator' styling options description (#5661)
clydebarrow Nov 22, 2025
9085591
Update board ID link in esp32.md (#5662)
ENK0DED Nov 23, 2025
ba15117
Merge branch 'current' into next
swoboda1337 Nov 24, 2025
a68b952
Add more lvgl arc update parameters (#5667)
bdm310 Nov 25, 2025
5e073bb
[esp32] Use the IDF I2C implementation on Arduino (#5671)
swoboda1337 Nov 25, 2025
5d9de66
[lvgl] Document `multiple_widgets_per_cell` grid layout option (#5674)
clydebarrow Nov 25, 2025
ad61504
Improve handling of cross page links (#5672)
swoboda1337 Nov 25, 2025
0a0f2e3
[lvgl] Document automatic padding on layouts (#5610)
clydebarrow Nov 26, 2025
c8af9ba
[lvgl] Document update_when_display_idle option (#5615)
clydebarrow Nov 27, 2025
3fff36b
[lvgl] Document scroll properties (#5620)
clydebarrow Nov 27, 2025
3b32d36
[lvgl] Document `text:` option for `button` (#5637)
clydebarrow Nov 27, 2025
644c924
[epaper_spi] Add SSD1677 and Seeed EE04 with Waveshare 4.26 (#5628)
clydebarrow Nov 27, 2025
7c8aaad
Fix exemple state logging for binary sensor values (#5664)
ngraziano Nov 25, 2025
fb6d7d8
Fix spelling (#5678)
swoboda1337 Nov 25, 2025
9adb3c9
Fix media and oi.esphome.io links (#5679)
clydebarrow Nov 25, 2025
239fb5d
Add OpenThread text sensors configuration example (#5524)
lboue Nov 26, 2025
ee2c299
Merge branch 'current' into next
swoboda1337 Nov 27, 2025
b8eaed4
Fix links (#5690)
swoboda1337 Nov 28, 2025
3014543
Add shorthand (#5684)
swoboda1337 Nov 28, 2025
e31f532
[packages] clarify package inclusion methods (#5681)
jpeletier Nov 28, 2025
eb025f7
[mipi_spi] add JC4827W543 (#5659)
jpeletier Nov 29, 2025
cf6b183
[psram] C5 docs (#5708)
swoboda1337 Dec 1, 2025
34dd2ab
[gree] `turbo`, `light`, `health`, `xfan` switches (#5698)
nagyrobi Dec 3, 2025
c5e1ac7
CC1101 docs (#5614)
lygris Dec 3, 2025
e6aecb6
[wifi] Clarify fast_connect behavior and add hidden network documenta…
bdraco Nov 28, 2025
1d49c7b
Add DFRobot Edge101 Ethernet configuration example (#5686)
vincegre Nov 28, 2025
ebfebff
[remote_receiver] Add missing default value for idle config option (#…
swoboda1337 Dec 1, 2025
748b326
[psram] Fix breaking change for psram missing key info (#5707)
jesserockz Dec 1, 2025
3a84daf
[esp32_cam] Add PSRAM requirement note to ESP32 Camera Component (#5710)
pzich Dec 1, 2025
5da58d7
Merge branch 'current' into next
swoboda1337 Dec 3, 2025
4ee8b84
[cst816] Add CST836 and CST816D to supported chips list (#5718)
swoboda1337 Dec 3, 2025
c95b735
[wifi_info] Document a new wifi power mode text sensor (#5512)
kahrendt Dec 3, 2025
e9d2054
[esp32] Document freertos_in_iram advanced option (#5693)
bdraco Dec 4, 2025
82fe88a
[esp32] Document ringbuf_in_iram advanced option (#5694)
bdraco Dec 4, 2025
9959473
Add missing information for inkplate (#5696)
serl Dec 4, 2025
f2c2e3f
Update rf_bridge.md (#5695)
phoenix-9 Dec 4, 2025
f9653c3
Bump actions/stale from 10.1.0 to 10.1.1 (#5720)
dependabot[bot] Dec 4, 2025
3919df6
fix: Unintuitive config documentations for ES8311 (#5691)
whc2001 Dec 4, 2025
1489f80
Update mcp230xx.md - update datasheets to current versions and links…
nepozs Dec 4, 2025
8d331cf
Add warning about sensor membrane tampering (#5496)
manuel-rw Dec 4, 2025
2d04d20
Add Seeed Studio XIAO ESP32-S3 PoE to Bluetooth Proxy device list (#5…
Bohrium332 Dec 4, 2025
754e860
[cookbook] Fix power_meter action and sensor ID references (#5721)
swoboda1337 Dec 4, 2025
cb716a8
Added the link to the PAJ7620 Gesture Sensor (#5722)
apaex Dec 4, 2025
1a92a33
Clarify address configuration for BMI160 sensor (#5717)
kamahat Dec 4, 2025
33e8669
[es8311] Remove MIN and MAX from mic_gain documentation (#5723)
swoboda1337 Dec 4, 2025
962f17d
Merge branch 'current' into next
swoboda1337 Dec 5, 2025
8762b26
[esp32] Add ESP32-C61 documentation (#5724)
swoboda1337 Dec 5, 2025
357eff5
[hub75] Document new display component (#5463)
stuartparmenter Dec 5, 2025
e170c00
Adding documentation for idle mode for SPS30 sensor (#5713)
c0mputerguru Dec 5, 2025
cced7c6
Add M5CORE2 model to display documentation (#5730)
lboue Dec 5, 2025
35c8c63
Update docs for ESP32-C5, C61, and P4 variant support (#5731)
swoboda1337 Dec 5, 2025
51cbe4d
[ethernet] Add LAN8670 PHY support documentation (#5400)
xorbit Dec 5, 2025
5576727
Clarify default values for max_send_queue (#5569)
lboue Dec 5, 2025
939fa9e
[esp32_can] add notice about multiple CAN controllers (#5355)
patagonaa Dec 5, 2025
590ccdc
Add docs for the upload and empty config options of the new device wi…
maximmaxim345 Dec 5, 2025
c6dc24f
[cc1101] Add missing details (#5728)
swoboda1337 Dec 6, 2025
ad8fa48
[api] Docs for device action responses (#5688)
jesserockz Dec 6, 2025
c6ac18c
Set update_interval on micronova's entities instead on hub (#5709)
edenhaus Dec 8, 2025
1c86185
[micronova] Remove memory_write_location (#5745)
edenhaus Dec 8, 2025
63ecea1
HLW8032 documentation (#4124)
rici4kubicek Dec 8, 2025
1c04dc4
[micronova] Add update_interval to switch entity (#5747)
edenhaus Dec 8, 2025
c345f46
[i2c] New low power configuration variable (#5704)
arno1801 Dec 8, 2025
d49e160
[pca9685] Document phase_balancer option (#5748)
swoboda1337 Dec 8, 2025
c13f14e
[usb_cdc_acm] New component documentation (#5555)
kbx81 Dec 9, 2025
ab4afc1
Update Bluetooth Proxy buy links for GL-S10 and LilyGO T-ETH-POE (#5727)
bdraco Dec 5, 2025
8c4948e
Update readme logo (#5726)
jesserockz Dec 5, 2025
5806b4f
Increase operations-per-run (#5733)
swoboda1337 Dec 6, 2025
065d2ff
Improve readability of Log Levels (#5735)
Undearius Dec 7, 2025
2c93861
Revise pull request template for component images (#5738)
rwrozelle Dec 8, 2025
74070be
Replace deprecated clk_mode with clk (#5744)
TimoPtr Dec 8, 2025
21bac0c
Add example to handle both on_click and longpress (#5746)
avbentem Dec 8, 2025
4287be3
Update LD2450 URL's (#5749)
smarthome-10 Dec 8, 2025
12037ec
Improve longpress example for binary sensor (#5753)
avbentem Dec 9, 2025
82f3b4d
Add example to handle both on_click and longpress (#5746)
avbentem Dec 8, 2025
5bb9550
Improve longpress example for binary sensor (#5753)
avbentem Dec 9, 2025
20bafc5
Add example to handle both on_click and longpress (#5746)
avbentem Dec 8, 2025
a14636b
Improve longpress example for binary sensor (#5753)
avbentem Dec 9, 2025
312e859
Merge branch 'current' into next
swoboda1337 Dec 9, 2025
9e84ed9
[micronova] Add required location and address to custom button and se…
edenhaus Dec 9, 2025
185fb5a
[mipi_rgb] Add Waveshare 3.16 (#5732)
clydebarrow Dec 9, 2025
f4c6cc4
Bump version to 2025.12.0b1
swoboda1337 Dec 10, 2025
5a2bab8
Update changelog for 2025.12.0b1
swoboda1337 Dec 10, 2025
2f800df
Escape special char and add hub75 image
swoboda1337 Dec 10, 2025
31c52e8
Fix hub75 link
swoboda1337 Dec 10, 2025
bfc9ac2
Fix BM8563 image
swoboda1337 Dec 10, 2025
3ea41b6
Fix dark-invert
swoboda1337 Dec 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions all_automations.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
"grove_tb6612fng.run",
"grove_tb6612fng.standby",
"grove_tb6612fng.stop",
"hc8.calibrate",
"homeassistant.action",
"homeassistant.event",
"homeassistant.service",
Expand Down
1 change: 1 addition & 0 deletions content/automations/all_actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ title: ""
- **fingerprint_grow:** `aura_led_control`, `cancel_enroll`, `delete`, `delete_all`, `enroll`, `led_control`
- **globals:** `set`
- **grove_tb6612fng:** `break`, `change_address`, `no_standby`, `run`, `standby`, `stop`
- **hc8:** `calibrate`
- **homeassistant:** `event`, `service`, `tag_scanned`
- **http_request:** `get`, `post`, `send`
- **htu21d:** `set_heater`, `set_heater_level`
Expand Down
358 changes: 358 additions & 0 deletions content/changelog/2025.12.0.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content/changelog/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ description: "Changelog"
title: "Changelog"
---

{{< redirect url="/changelog/2025.11.0.html" >}}
{{< redirect url="/changelog/2025.12.0.html" >}}
8 changes: 8 additions & 0 deletions content/components/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ Create update entities simplifying management of OTA updates.
"SPI Bus","components/spi","spi.svg",""
"TinyUSB","components/tinyusb","usb.svg","dark-invert"
"UART","components/uart","uart.svg",""
"USB CDC-ACM","components/usb_cdc_acm","usb.svg","dark-invert"
"USB Host","components/usb_host","usb.svg","dark-invert"
"USB UART","components/usb_uart","usb.svg","dark-invert"
{{< /imgtable >}}
Expand Down Expand Up @@ -240,6 +241,7 @@ Sensors are organized into categories; if a given sensor fits into more than one
"GCJA5","components/sensor/gcja5","gcja5.svg","Particulate","",""
"GP2Y1010AU0F","components/sensor/gp2y1010au0f","gp2y1010au0f.png","Particulate","",""
"Grove Multichannel Gas V2","components/sensor/grove_gas_mc_v2","grove-gas-mc-v2.png","NO₂ & CO & Ethanol & Volatile organics","",""
"HC8","components/sensor/hc8","hc8.png","CO₂","",""
"HM3301","components/sensor/hm3301","hm3301.jpg","Particulate","",""
"iAQ-Core","components/sensor/iaqcore","iaqcore.jpg","eCO₂ & Volatile organics","",""
"MH-Z19","components/sensor/mhz19","mhz19.jpg","CO₂ & Temperature","",""
Expand Down Expand Up @@ -291,6 +293,7 @@ Sensors are organized into categories; if a given sensor fits into more than one
"Mopeka Pro Check LP","components/sensor/mopeka_pro_check","mopeka_pro_check.jpg","Tank level"
"Mopeka Standard Check LP","components/sensor/mopeka_std_check","mopeka_std_check.jpg","Tank level"
"RuuviTag","components/sensor/ruuvitag","ruuvitag.jpg","Temperature & Humidity & Accelerometer"
"ThermoPro BLE","components/sensor/thermopro_ble","thermopro_tp357.jpg","Temperature & Humidity"
"Xiaomi BLE","components/sensor/xiaomi_ble","xiaomi_mijia_logo.jpg","Various"
{{< /imgtable >}}

Expand Down Expand Up @@ -335,6 +338,7 @@ Sensors are organized into categories; if a given sensor fits into more than one
"Daly BMS","components/sensor/daly_bms","daly_bms.jpg","Voltage & Current & Power"
"DSMR","components/sensor/dsmr","dsmr.svg","Electrical counter"
"HLW8012","components/sensor/hlw8012","hlw8012.svg","Voltage & Current & Power"
"HLW8032","components/sensor/hlw8032","hlw8032.png","Voltage & Current & Power"
"INA219","components/sensor/ina219","ina219.jpg","DC Current"
"INA226","components/sensor/ina226","ina226.jpg","DC Current & Power"
"INA228","components/sensor/ina2xx","ina228.jpg","DC Voltage & Current & Power & Charge"
Expand Down Expand Up @@ -380,6 +384,7 @@ Sensors are organized into categories; if a given sensor fits into more than one
"EMC2101","components/emc2101","emc2101.jpg","Temperature",""
"ENS160","components/sensor/ens160","ens160.jpg","eCO₂ & Air Quality",""
"ENS210","components/sensor/ens210","ens210.jpg","Temperature & Humidity",""
"HC8","components/sensor/hc8","hc8.png","CO₂",""
"HDC1080","components/sensor/hdc1080","hdc1080.jpg","Temperature & Humidity",""
"HDC2010","components/sensor/hdc2010","hdc2010.png","Temperature & Humidity",""
"HHCCJCY10 (MiFlora Pink)","components/sensor/xiaomi_hhccjcy10","xiaomi_hhccjcy10.jpg","Soil moisture & Temperature & Light",""
Expand Down Expand Up @@ -416,6 +421,7 @@ Sensors are organized into categories; if a given sensor fits into more than one
"SHTCx","components/sensor/shtcx","shtc3.jpg","Temperature & Humidity",""
"SMT100","components/sensor/smt100","smt100.jpg","Moisture & Temperature",""
"STS3X","components/sensor/sts3x","sts3x.jpg","Temperature",""
"STTS22H","components/sensor/stts22h","stts22h.jpg","Temperature",""
"TC74","components/sensor/tc74","tc74.jpg","Temperature",""
"TEE501","components/sensor/tee501","TEE501.png","Temperature",""
"TE-M3200","components/sensor/tem3200","tem3200.jpg","Temperature & Pressure",""
Expand Down Expand Up @@ -999,6 +1005,7 @@ at the {{< docref "light/fastled" "FastLED Light" >}}.

{{< imgtable >}}
"Time Core","components/time/index","clock-outline.svg","dark-invert"
"BM8563 RTC","components/time/bm8563","bm8563.svg",""
"DS1307 RTC","components/time/ds1307","clock-outline.svg","dark-invert"
"RX8130 RTC","components/time/rx8130","clock-outline.svg","dark-invert"
"GPS Time","components/time/gps","crosshairs-gps.svg","dark-invert"
Expand Down Expand Up @@ -1037,6 +1044,7 @@ Used for creating infrared (IR) or radio frequency (RF) remote control transmitt
ESPHome to cellular networks. **Does not encompass Wi-Fi.**

{{< imgtable >}}
"CC1101","components/cc1101","cc1101.webp",""
"IR Remote Climate","components/climate/climate_ir","air-conditioner-ir.svg","dark-invert"
"Remote Receiver","components/remote_receiver","remote.svg","dark-invert"
"Remote Transmitter","components/remote_transmitter","remote.svg","dark-invert"
Expand Down
185 changes: 179 additions & 6 deletions content/components/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ api:
> The defaults are set to balance memory usage with allowing multiple simultaneous connections.

- **max_send_queue** (*Optional*, int): The maximum number of messages that can be queued for sending per connection before the connection is dropped. Must be between 1 and 64.
Defaults to `5` for ESP8266/RP2040, `8` for ESP32/BK72xx/RTL87xx/LN882x, `16` for host platform. This prevents memory exhaustion when a client is slow or network-stalled.
Defaults to:
- `5` for ESP8266/RP2040,
- `8` for ESP32/BK72xx/LN882x/nRF52/RTL87xx,
- `16` for host platform.

This prevents memory exhaustion when a client is slow or network-stalled.
Each queued message uses approximately 8-12 bytes of overhead plus the message size.

> [!NOTE]
Expand Down Expand Up @@ -385,25 +390,51 @@ api:
- logger.log: "API client disconnected!"
```

## Conditions

{{< anchor "api-connected_condition" >}}

## `api.connected` Condition
### `api.connected` Condition

This [Condition](/automations/actions#all-conditions) checks if at least one client is connected to the ESPHome native API.

#### Configuration variables

- **state_subscription_only** (*Optional*, boolean): If enabled, only counts clients that have subscribed to entity state updates. This filters out logger-only connections (such as `esphome logs` command), which can cause false positives when waiting for Home Assistant. Defaults to `false`.

This [Condition](/automations/actions#all-conditions) checks if at least one client is connected to the ESPHome
native API. Please note client not only includes Home Assistant, but also ESPHome's OTA log output
if logs are shown remotely.
**Check if any client is connected:**

```yaml
on_...:
if:
condition:
api.connected:
then:
- logger.log: API is connected!
- logger.log: Client is connected to API!
```

The lambda equivalent for this is `id(api_id).is_connected()`.

**Check if a client subscribed to entity states is connected (typically Home Assistant):**

```yaml
on_boot:
- wait_until:
condition:
api.connected:
state_subscription_only: true
- logger.log: Home Assistant is connected!
- homeassistant.event:
event: esphome.device_booted
```

The lambda equivalent for this is `id(api_id).is_connected(true)`.

**Use Cases:**

- Use `state_subscription_only: false` (default) to detect any API connection
- Use `state_subscription_only: true` when you need to ensure Home Assistant (or other connections that subscribe to states) is connected before sending events or calling services, preventing errors from logger-only connections

{{< anchor "api-device-actions" >}}

## User-defined Actions
Expand All @@ -412,6 +443,10 @@ It is also possible to get data from Home Assistant to ESPHome with user-defined
When you declare actions in your ESPHome YAML file, they will automatically show up in
Home Assistant and you can call them directly.

> [!NOTE]
> User-defined actions can also send responses back to the calling client using the `api.respond` action.
> See [Action Responses](#action-responses) for details.

```yaml
# Example configuration entry
api:
Expand Down Expand Up @@ -471,6 +506,144 @@ Each of these also exist in array form:
- bool[]: An array of boolean values. C++ type: `std::vector<bool>`
- ... - Same for other types.

### Action Responses

User-defined actions can send responses back to the calling client (such as Home Assistant). This enables
bidirectional communication where actions can report success/error status or return structured JSON data.

#### Response Modes

The response behavior is controlled by the `supports_response` option, which can be set explicitly or
auto-detected based on your action configuration:

- **none** (default): No response is sent. The action is "fire and forget".
- **status**: Reports success/error status without data. Auto-detected when `api.respond` is used without `data:`.
- **optional**: Returns JSON data when the client requests it. Auto-detected when `api.respond` is used with `data:`.
- **only**: Always returns JSON data. Must be set explicitly. Use this for query-type actions.

#### Configuration variables

- **supports_response** (*Optional*, string): The response mode for this action. One of `none`, `status`,
`optional`, or `only`. If not specified, the mode is auto-detected based on `api.respond` usage in the action.

#### Trigger variables

When `supports_response` is not `none`, the following variables are available in the action:

- **call_id** (`uint32_t`): A unique identifier for this action call. Used internally by `api.respond`.
- **return_response** (`bool`): Only available in `optional` mode. Indicates whether the client requested
a response. You don't typically need to check this - `api.respond` handles it automatically.

### `api.respond` Action

This action sends a response back to the client that called the user-defined action. It can report
success/error status and optionally include JSON data.

#### Configuration variables

- **success** (*Optional*, boolean, [templatable](/automations/templates)): Whether the action succeeded.
Defaults to `true`.
- **error_message** (*Optional*, string, [templatable](/automations/templates)): An error message to include
when `success` is `false`. Defaults to an empty string.
- **data** (*Optional*, [lambda](/automations/templates#config-lambda)): A lambda that populates a JSON object
with response data. The lambda receives a `root` variable of type [`JsonObject`](https://arduinojson.org/v7/api/jsonobject/)
that you can populate with key-value pairs.

#### Status Response Example

Report success or error without returning data:

```yaml
api:
actions:
- action: validate_input
variables:
value: int
then:
- if:
condition:
lambda: 'return value < 0;'
then:
- api.respond:
success: false
error_message: "Value must be positive"
else:
- api.respond:
success: true
```

#### Data Response Example

Return structured JSON data to the caller:

```yaml
api:
actions:
- action: get_sensor_data
variables:
sensor_name: string
then:
- api.respond:
data: !lambda |-
root["sensor"] = sensor_name;
root["value"] = id(my_sensor).state;
root["unit"] = "°C";
root["timestamp"] = id(homeassistant_time).now().timestamp;
```

This action will be auto-detected as `optional` mode because it uses `api.respond` with `data:`.

#### Query Action Example

For actions that always return data (like queries), explicitly set `supports_response: only`:

```yaml
api:
actions:
- action: get_device_info
supports_response: only
then:
- api.respond:
data: !lambda |-
root["hostname"] = App.get_name();
root["version"] = ESPHOME_VERSION;
root["uptime"] = millis() / 1000;
```

#### Nested JSON Data

You can create complex nested JSON structures:

```yaml
api:
actions:
- action: get_full_status
supports_response: only
then:
- api.respond:
data: !lambda |-
root["device"]["name"] = "living_room";
root["device"]["version"] = 1;
root["sensors"]["temperature"] = id(temp_sensor).state;
root["sensors"]["humidity"] = id(humidity_sensor).state;
```

#### Calling from Home Assistant

Actions with response support appear in Home Assistant with their response mode indicated. You can call
them and receive the response data:

```yaml
# Home Assistant automation example
action: esphome.device_get_sensor_data
data:
sensor_name: "living_room"
response_variable: sensor_response
```

The response will be available in the `sensor_response` variable with the structure you defined in the
`data:` lambda.

## Advantages over MQTT

The ESPHome native API has many advantages over using MQTT for communication with Home
Expand Down
60 changes: 38 additions & 22 deletions content/components/canbus/esp32_can.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ params:
{{< anchor "esp32-can" >}}

The ESP32 has an integrated CAN controller and therefore doesn't necessarily need an external controller.
Some variants (ESP32-C5, ESP32-C6, ESP32-P4) have multiple CAN controllers - see [Multiple CAN Controllers](#multiple-can-controllers) below.
You only need to specify the RX and TX pins. Any GPIO will work.

```yaml
Expand Down Expand Up @@ -39,28 +40,43 @@ canbus:

The following table lists the bit rates supported by the component for ESP32 variants:

| bit_rate | ESP32 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- |
| 1KBPS | | x | x | x | x | x |
| 5KBPS | | x | x | x | x | x |
| 10KBPS | | x | x | x | x | x |
| 12K5BPS | | x | x | x | x | x |
| 16KBPS | | x | x | x | x | x |
| 20KBPS | | x | x | x | x | x |
| 25KBPS | x | x | x | x | x | x |
| 31K25BPS | | | | | | |
| 33KBPS | | | | | | |
| 40KBPS | | | | | | |
| 50KBPS | x | x | x | x | x | x |
| 80KBPS | | | | | | |
| 83K38BPS | | | | | | |
| 95KBPS | | | | | | |
| 100KBPS | x | x | x | x | x | x |
| 125KBPS (Default) | x | x | x | x | x | x |
| 250KBPS | x | x | x | x | x | x |
| 500KBPS | x | x | x | x | x | x |
| 800KBPS | x | x | x | x | x | x |
| 1000KBPS | x | x | x | x | x | x |
| bit_rate | ESP32 | Other variants* |
| ----------------- | ----- | --------------- |
| 1KBPS | | x |
| 5KBPS | | x |
| 10KBPS | | x |
| 12K5BPS | | x |
| 16KBPS | | x |
| 20KBPS | | x |
| 25KBPS | x | x |
| 31K25BPS | | |
| 33KBPS | | |
| 40KBPS | | |
| 50KBPS | x | x |
| 80KBPS | | |
| 83K3BPS | | |
| 95KBPS | | |
| 100KBPS | x | x |
| 125KBPS (Default) | x | x |
| 250KBPS | x | x |
| 500KBPS | x | x |
| 800KBPS | x | x |
| 1000KBPS | x | x |

Other variants: ESP32-C3, ESP32-C5, ESP32-C6, ESP32-H2, ESP32-P4, ESP32-S2, ESP32-S3

> [!NOTE]
> ESP32-C2 and ESP32-C61 do not have TWAI/CAN hardware and are not supported.

## Multiple CAN Controllers

Some ESP32 variants have multiple CAN (TWAI) controllers:

- **ESP32-C5**: 2 controllers
- **ESP32-C6**: 2 controllers
- **ESP32-P4**: 3 controllers

All other supported variants have a single controller. ESP32-C2 and ESP32-C61 do not have CAN hardware.

## Wiring options

Expand Down
Loading