zha-device-handlers icon indicating copy to clipboard operation
zha-device-handlers copied to clipboard

Add quirk for Sonoff ZBMINIR2

Open lcheng33775823 opened this issue 1 year ago • 1 comments

Proposed change

Add quirk for Sonoff ZBMINIR2

Additional information

Checklist

  • [x] The changes are tested and work correctly
  • [x] pre-commit checks pass / the code has been formatted using Black
  • [] Tests have been added to verify that the new code works

lcheng33775823 avatar Oct 15 '24 12:10 lcheng33775823

Codecov Report

Attention: Patch coverage is 91.30435% with 2 lines in your changes missing coverage. Please review.

Project coverage is 89.44%. Comparing base (4d53f30) to head (82b7d05). Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
zhaquirks/sonoff/zbminir2.py 91.30% 2 Missing :warning:
Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #3428   +/-   ##
=======================================
  Coverage   89.44%   89.44%           
=======================================
  Files         311      312    +1     
  Lines       10031    10054   +23     
=======================================
+ Hits         8972     8993   +21     
- Misses       1059     1061    +2     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features:

codecov[bot] avatar Oct 15 '24 12:10 codecov[bot]

Hi @TheJulianJES, I've created a PR. Is there anything I need to do before merging it?

lcheng33775823 avatar Oct 28 '24 08:10 lcheng33775823

Thank you very much for your assistance.

lcheng33775823 avatar Oct 31 '24 14:10 lcheng33775823

@TheJulianJES Can this be merged? Z2M has had proper support for this device for a while, and it would be a shame to block it over variable naming.

pngunit avatar Nov 18 '24 22:11 pngunit

I have tested the Quirk, few insights:

  • external trigger mode config works great
  • the detached mode config doesn't work right for me with switch in edge trigger mode: switch position updates HA entity state, and HA ends up confused
  • I miss inching configuration (as ewelink cluster command)

tomasgatial avatar Nov 20 '24 14:11 tomasgatial

I just got this device today, tried this quirk and can confirm it's still a bit weird when using detached mode like tomas said.

So I'm new to these types of devices, but is it normal that when using the external trigger mode of a pulse trigger, the relay switch shows up as on for a second, then reverts to false? This seems like it would make it basically impossible to distinguish between double-tapping the switch or holding the switch for a while. Wouldn't this be what the sensor is for?

marcohamersma avatar Nov 23 '24 22:11 marcohamersma

I can confirm the strange behavior in detached mode. It looks like the state of the relay and also the state of the external switch are mapped to the switch entity.

I tried the detached mode with the same device (firmware 0x00001002) with Z2M without any issues. The state of the relay is mapped to the switch entity and on external switch use, the HA device receives toggle actions.

arnekaiser avatar Dec 02 '24 18:12 arnekaiser

Since the behavior differs from Z2M, please create an issue in this repo and link it here.

TheJulianJES avatar Dec 02 '24 19:12 TheJulianJES

I've just created a new issue for this in #3579

marcohamersma avatar Dec 03 '24 16:12 marcohamersma