Add dump config

To help troubleshooting
This commit is contained in:
Edward Firmo
2024-12-25 02:11:10 +01:00
parent cca59bbe2a
commit e546fedf08
8 changed files with 164 additions and 13 deletions

View File

@@ -634,6 +634,40 @@ script:
ESP_LOGE("core_hw_relays", "No button action selected for button %" PRIu8, button);
}
- id: !extend dump_config
then:
- lambda: |-
ESP_LOGCONFIG("core_hw_relays", "Relay%s mode%s:",
id(gang_count) == 1 ? "" : "s",
id(gang_count) == 1 ? "" : "s");
ESP_LOGCONFIG("core_hw_relays", " Relay 1: %s", sl_relay_1_mode->state.c_str());
if (id(gang_count) >= 2)
ESP_LOGCONFIG("core_hw_relays", " Relay 2: %s", sl_relay_2_mode->state.c_str());
if (id(gang_count) >= 3)
ESP_LOGCONFIG("core_hw_relays", " Relay 3: %s", sl_relay_3_mode->state.c_str());
if (id(gang_count) >= 4)
ESP_LOGCONFIG("core_hw_relays", " Relay 4: %s", sl_relay_4_mode->state.c_str());
ESP_LOGCONFIG("core_hw_relays", "Relay%s state%s:",
id(gang_count) == 1 ? "" : "s",
id(gang_count) == 1 ? "" : "s");
ESP_LOGCONFIG("core_hw_relays", " Relay 1: %s", sw_relay_1->state ? "ON" : "OFF");
if (id(gang_count) >= 2)
ESP_LOGCONFIG("core_hw_relays", " Relay 2: %s", sw_relay_2->state ? "ON" : "OFF");
if (id(gang_count) >= 3)
ESP_LOGCONFIG("core_hw_relays", " Relay 3: %s", sw_relay_3->state ? "ON" : "OFF");
if (id(gang_count) >= 4)
ESP_LOGCONFIG("core_hw_relays", " Relay 4: %s", sw_relay_4->state ? "ON" : "OFF");
ESP_LOGCONFIG("core_hw_relays", "Expose Relay's LEDs to Home Assistant: %s",
YESNO(sw_expose_relays_leds_to_ha->state));
ESP_LOGCONFIG("core_hw_relays", "Boot initialization flags:");
ESP_LOGCONFIG("core_hw_relays", " Overall: %s", YESNO(id(boot_initialization_relays)));
ESP_LOGCONFIG("core_hw_relays", " Light modes: %s", YESNO(id(boot_initialization_relays_light_modes)));
ESP_LOGCONFIG("core_hw_relays", " Relay modes: %s", YESNO(id(boot_initialization_relays_relay_modes)));
ESP_LOGCONFIG("core_hw_relays", " Status LEDs: %s", YESNO(id(boot_initialization_relays_relay_leds)));
ESP_LOGCONFIG("core_hw_relays", "Restore modes:");
ESP_LOGCONFIG("core_hw_relays", " Relays: ${RELAY_RESTORE_MODE}");
ESP_LOGCONFIG("core_hw_relays", " Status LEDs: ${LIGHT_RELAYS_RESTORE_MODE}");
- id: show_relay_status
mode: restart
then: