Skip to content

Commit

Permalink
Add shelly overcurrent sensor for switches (#122494)
Browse files Browse the repository at this point in the history
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".
  • Loading branch information
huettner94 authored Jul 25, 2024
1 parent 81983d6 commit eb3686a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions homeassistant/components/shelly/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit eb3686a

Please sign in to comment.