Edit esp-reterminal-e1001.yaml

This commit is contained in:
ESPHome Device Builder
2026-08-02 16:27:18 +12:00
parent ed4758f1c8
commit ed59a3c62c
+25 -15
View File
@@ -1251,7 +1251,8 @@ interval:
#:########################################################################################:# #:########################################################################################:#
# MQTT COMMANDS: # MQTT COMMANDS:
# Retained On/ON allows sleep; retained Off/OFF prevents sleep for OTA/development. # Retained ON allows sleep; retained OFF prevents sleep for OTA/development.
# Payload matching is case-insensitive.
# This extends common/mqtt_common.yaml with device-specific subscriptions. # This extends common/mqtt_common.yaml with device-specific subscriptions.
#:########################################################################################:# #:########################################################################################:#
mqtt: mqtt:
@@ -1259,24 +1260,33 @@ mqtt:
on_message: on_message:
- topic: "${mqtt_command_topic}/deepsleep" - topic: "${mqtt_command_topic}/deepsleep"
payload: "On" then:
- if:
condition:
lambda: |-
std::string command = x;
for (char &character : command) {
if (character >= 'A' && character <= 'Z') character += 'a' - 'A';
}
return command == "on";
then: then:
- script.execute: apply_sleep_allowed - script.execute: apply_sleep_allowed
else:
- topic: "${mqtt_command_topic}/deepsleep" - if:
payload: "ON" condition:
then: lambda: |-
- script.execute: apply_sleep_allowed std::string command = x;
for (char &character : command) {
- topic: "${mqtt_command_topic}/deepsleep" if (character >= 'A' && character <= 'Z') character += 'a' - 'A';
payload: "Off" }
then: return command == "off";
- script.execute: apply_sleep_prevented
- topic: "${mqtt_command_topic}/deepsleep"
payload: "OFF"
then: then:
- script.execute: apply_sleep_prevented - script.execute: apply_sleep_prevented
else:
- logger.log:
level: WARN
format: "Ignoring invalid deep-sleep MQTT payload: %s"
args: ["x.c_str()"]
#:########################################################################################:# #:########################################################################################:#
# DEEP SLEEP: # DEEP SLEEP: