Skip to content

Commit 8874797

Browse files
author
Antonio ...
committed
debug: Force start charger with error-level logging to bypass suppression (v0.9.14-debug)
1 parent 81fef2c commit 8874797

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

‎custom_components/ev_smart_charger/manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"domain": "ev_smart_charger",
33
"name": "EV Smart Charger",
4-
"version": "0.9.13",
4+
"version": "0.9.14-debug",
55
"documentation": "https://github.com/antbald/ha-ev-smart-charger",
66
"issue_tracker": "https://github.com/antbald/ha-ev-smart-charger/issues",
77
"codeowners": ["@antbald"],

‎custom_components/ev_smart_charger/solar_surplus.py‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,37 @@ async def _async_periodic_check(self, now=None) -> None:
748748
}
749749
)
750750

751+
# === CRITICAL DEBUG: Force log and action ===
752+
_LOGGER.error(f"🔍 [DEBUG] Reached decision logic: current={current_amps}A, target={target_amps}A, charger_is_on={charger_is_on}")
753+
754+
# IMMEDIATE ACTION: If charger is OFF and we have surplus, START IT NOW
755+
if not charger_is_on and target_amps > 0:
756+
_LOGGER.error(f"🚀 [FORCE START] Charger OFF with {target_amps}A target - STARTING NOW")
757+
try:
758+
# Set amperage first
759+
await self.hass.services.async_call(
760+
"number",
761+
"set_value",
762+
{"entity_id": self._charger_current, "value": target_amps},
763+
blocking=True,
764+
)
765+
_LOGGER.error(f"✅ Set amperage to {target_amps}A")
766+
767+
# Start charger
768+
await self.hass.services.async_call(
769+
"switch",
770+
"turn_on",
771+
{"entity_id": self._charger_switch},
772+
blocking=True,
773+
)
774+
_LOGGER.error(f"✅ Started charger switch")
775+
_LOGGER.info("=" * 80)
776+
return
777+
except Exception as e:
778+
_LOGGER.error(f"❌ Exception starting charger: {e}")
779+
import traceback
780+
_LOGGER.error(traceback.format_exc())
781+
751782
# === ENHANCEMENT 2A: Grid Import Delay Protection ===
752783
current_time = time.time()
753784

0 commit comments

Comments
 (0)