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".
This commit is contained in:
huettner94 2024-07-25 20:22:18 +02:00 committed by GitHub
parent 81983d66f4
commit eb3686af06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -204,6 +204,15 @@ RPC_SENSORS: Final = {
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",