Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Moes 4-gang touch wall switch #1228

Merged
merged 1 commit into from
Dec 25, 2021
Merged

Conversation

jjv360
Copy link
Contributor

@jjv360 jjv360 commented Dec 24, 2021

Hi, I bought a Moes 4-gang wall switch, but when I added it into HomeAssistant, there were no entities attached to the device. After googling I discovered this repo which contains "quirks", and it seems my wall switch has the same format as Tuya's 4-gang light switch...

I edited the quirk file locally (with Portainer) and added this device's model and it seems to work. After adding this line, then removing and re-adding the device, I now have 4 entities, one for each light, and I can turn them on and off successfully. It even updates HA's state correctly when turning the lights on/off at the wall.

Here's the device now working in Home Assistant, although the "Power Source" field still says "Battery or Unknown"...

working

@codecov-commenter
Copy link

Codecov Report

Merging #1228 (bfcb23d) into dev (5228c54) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev    #1228   +/-   ##
=======================================
  Coverage   80.41%   80.41%           
=======================================
  Files         207      207           
  Lines        5668     5668           
=======================================
  Hits         4558     4558           
  Misses       1110     1110           
Impacted Files Coverage Δ
zhaquirks/tuya/ts0601_switch.py 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5228c54...bfcb23d. Read the comment docs.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1619563909

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 80.416%

Totals Coverage Status
Change from base Build 1564804562: 0.0%
Covered Lines: 4558
Relevant Lines: 5668

💛 - Coveralls

@javicalle
Copy link
Collaborator

It is good practice to add the device's signature before applying the quirks. That way it is easier to know if the quirks is suitable for the device or it is not.
You can get the signature of the device from the "ZIGBEE DEVICE SIGNATURE" option of the device view.

@jjv360
Copy link
Contributor Author

jjv360 commented Dec 25, 2021

Hi, here it is without the quirk:

{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": 260,
      "device_type": "0x0051",
      "in_clusters": [
        "0x0000",
        "0x0004",
        "0x0005",
        "0xef00"
      ],
      "out_clusters": [
        "0x000a",
        "0x0019"
      ]
    }
  },
  "manufacturer": "_TZE200_1ozguk6x",
  "model": "TS0601",
  "class": "zigpy.device.Device"
}

Copy link
Collaborator

@javicalle javicalle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dmulcahey dmulcahey merged commit d5a7e9f into zigpy:dev Dec 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants