AlexxIT / SonoffLAN

Control Sonoff Devices with eWeLink (original) firmware over LAN and/or Cloud from Home Assistant
https://github.com/AlexxIT/Blog
MIT License
2.71k stars 414 forks source link

[Feature request] Add custom sensors as PIR Sensor #1221

Open xia0linz1 opened 1 year ago

xia0linz1 commented 1 year ago

I get a 3-gan WiFi switch with a build-in PIR sensor, detected as Coolkit CKA-DM4-GL. The switch work perfectly, but the PIR sensor can not been added automatically. After checking integration debug, the device provide additional device attributes “Alert” to describe motion detect state. So I add custom sensors config

sonoff:
  devices:
    1000XXXXX3:
      device_class: [light, light, light]
  sensors: [alert]

The alert sensor is created, but state remains "1" permanently.

Checking debug log, I find the device only push notification “Alert: 1” when the PIR sensor is occupied, but don't push any notification to reset the status. (I think that's why rfbridge PIR sensor gets a config “timeout” to reset the state) I use develop tool to manually set the alert sensor's state to "0" after timeout, the sensor works perfectly as expected.

So is there any way to add custom sensors as a PIR sensor, while the integration can reset the state automatically? Or Please consider adding this feature.

AlexxIT commented 1 year ago

https://github.com/AlexxIT/SonoffLAN#issues

afarago commented 11 months ago

Workaround in #1260