[nextion] Expose custom protocol frames as automation triggers (#13248)

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
This commit is contained in:
Edward Firmo
2026-04-07 22:13:58 +00:00
committed by GitHub
co-authored by pre-commit-ci-lite[bot] Copilot Autofix powered by AI J. Nick Koston
parent 5d31f4aeba
commit ee7b38504b
7 changed files with 164 additions and 1 deletions
+26 -1
View File
@@ -286,6 +286,31 @@ display:
on_buffer_overflow:
then:
logger.log: "Nextion reported a buffer overflow!"
on_custom_text_sensor:
then:
- lambda: |-
// key: StringRef, value: StringRef
if (key == "csv") {
// parse value here, or forward to your own component
ESP_LOGD("nextion.csv", "Got CSV: %s", value.c_str());
}
on_custom_sensor:
then:
- lambda: |-
// key: StringRef, value: int32_t
if (key == "temperature_raw") {
ESP_LOGD("nextion.custom", "%s=%d", key.c_str(), value);
}
on_custom_binary_sensor:
then:
- lambda: |-
if (key == "btn1") {
ESP_LOGD("nextion.btn", "btn1=%s", ONOFF(value));
}
on_custom_switch:
then:
- lambda: |-
ESP_LOGD("nextion.sw", "%s=%s", key.c_str(), ONOFF(value));
on_page:
then:
lambda: 'ESP_LOGD("display","Display shows new page %u", x);'
@@ -304,8 +329,8 @@ display:
on_wake:
then:
lambda: 'ESP_LOGD("display","Display woke up");'
update_interval: 5s
start_up_page: 1
startup_override_ms: 10000ms # Wait 10s for display ready
touch_sleep_timeout: 3
update_interval: 5s
wake_up_page: 2