From eb3686af06c2708c526f0838b9bfaa88e2b21698 Mon Sep 17 00:00:00 2001 From: huettner94 Date: Thu, 25 Jul 2024 20:22:18 +0200 Subject: [PATCH] Add shelly overcurrent sensor for switches (#122494) shelly: add overcurrent sensor for switches just like overvoltage shelly switches can react to overcurrent and diable the switch. Unfortunately this is is not mentioned anywhere in the documentation. It can be triggered by a device using more amps than set in "Output protections" under the name "Overcurrent in amperes". --- homeassistant/components/shelly/binary_sensor.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/homeassistant/components/shelly/binary_sensor.py b/homeassistant/components/shelly/binary_sensor.py index bc2ba3326a777..c2127828b0742 100644 --- a/homeassistant/components/shelly/binary_sensor.py +++ b/homeassistant/components/shelly/binary_sensor.py @@ -204,6 +204,15 @@ class RestBinarySensorDescription(RestEntityDescription, BinarySensorEntityDescr entity_category=EntityCategory.DIAGNOSTIC, supported=lambda status: status.get("apower") is not None, ), + "overcurrent": RpcBinarySensorDescription( + key="switch", + sub_key="errors", + name="Overcurrent", + device_class=BinarySensorDeviceClass.PROBLEM, + value=lambda status, _: False if status is None else "overcurrent" in status, + entity_category=EntityCategory.DIAGNOSTIC, + supported=lambda status: status.get("apower") is not None, + ), "smoke": RpcBinarySensorDescription( key="smoke", sub_key="alarm",