Repository: zigpy/zha-device-handlers (python)

Issue:
[BUG] Paulmann 501.34 Wall Switch (sw_build_id (id: 0x4000) 2.7.6_r25) cannot be used in HASSIO automations
### References:

https://github.com/zigpy/zha-device-handlers/pull/1678#issuecomment-1771660070
https://community.home-assistant.io/t/paulmann-501-34-wall-switch/418414/7?u=ajd_ht
https://de.paulmann.com/p/wandschalter-smart-home-zigbee-3.0-on-off-dimm-weiss/50134

---

### Bug description

I paired

Paulmann 501.34 Wall Switch ([Wandschalter Smart Home Zigbee 3.0 On/Off/Dimm Weiß](https://de.paulmann.com/p/wandschalter-smart-home-zigbee-3.0-on-off-dimm-weiss/50134))

![image](https://github.com/zigpy/zha-device-handlers/assets/9786634/b48cfbcd-0a57-4c2f-868c-a9f0a7c31fa7)

with

Home Assistant 2023.10.3
Supervisor 2023.10.0
Operating System 11.0
Frontend 20231005.0 - latest

and

ZHA

I cannot find any possibility to integrate the Paulmann 501.34 Wall Switch in any automation.

I only find 1 device

![image](https://github.com/zigpy/zha-device-handlers/assets/9786634/8fe3b9db-833d-435c-9537-10843688aba8)

with 4 entities

![image](https://github.com/zigpy/zha-device-handlers/assets/9786634/e5261878-ac00-4f08-b42c-07cf1004c84a)



### Steps to reproduce


1. Pair Paulmann 501.34 Wall Switch (sw_build_id (id: 0x4000) 2.7.6_r25)
2. Try to automate.

### Expected behavior

1. It should be possible to see two devices / switches
2. The following events (a1, a0, b1, b0) should be exposed and should be used in automations
![image](https://github.com/zigpy/zha-device-handlers/assets/9786634/84e566b1-7017-4213-9cec-579bc6a55b78)



### Screenshots/Video

<details><summary>Screenshots/Video</summary>

[Paste/upload your media here]

</details>


### Device signature

<details><summary>Device signature</summary>

```json
{
  "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=4644, 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": "0x0104",
      "device_type": "0x0001",
      "input_clusters": [
        "0x0000",
        "0x0001",
        "0x0003",
        "0x0b05",
        "0x1000"
      ],
      "output_clusters": [
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0006",
        "0x0008",
        "0x0019",
        "0x0300",
        "0x1000"
      ]
    },
    "2": {
      "profile_id": "0x0104",
      "device_type": "0x0001",
      "input_clusters": [
        "0x0000",
        "0x0001",
        "0x0003",
        "0x0b05",
        "0x1000"
      ],
      "output_clusters": [
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0006",
        "0x0008",
        "0x0019",
        "0x0300",
        "0x1000"
      ]
    }
  },
  "manufacturer": "Paulmann Licht GmbH",
  "model": "501.34",
  "class": "zigpy.device.Device"
}
```

</details>


### Diagnostic information

<details><summary>Diagnostic information</summary>

```json
{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2023.10.3",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.11.5",
    "docker": true,
    "arch": "aarch64",
    "timezone": "Europe/Berlin",
    "os_name": "Linux",
    "os_version": "6.1.21-v8",
    "supervisor": "2023.10.0",
    "host_os": "Home Assistant OS 11.0",
    "docker_version": "24.0.6",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "hacs": {
      "version": "1.33.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "zha_toolkit": {
      "version": "v1.1.2",
      "requirements": [
        "pytz"
      ]
    },
    "govee_lan": {
      "version": "1.0.0",
      "requirements": [
        "govee-led-wez>=0.0.15"
      ]
    },
    "govee": {
      "version": "0.2.2",
      "requirements": [
        "govee-api-laggat==0.2.2",
        "dacite==1.6.0"
      ]
    },
    "nodered": {
      "version": "3.0.1",
      "requirements": []
    },
    "gardena_smart_system": {
      "version": "1.0.0",
      "requirements": [
        "py-smart-gardena==1.3.7"
      ]
    },
    "virtual": {
      "version": "0.8.0b1",
      "requirements": []
    },
    "petkit": {
      "version": "0.1.0",
      "requirements": []
    }
  },
  "integration_manifest": {
    "domain": "zha",
    "name": "Zigbee Home Automation",
    "after_dependencies": [
      "onboarding",
      "usb"
    ],
    "codeowners": [
      "@dmulcahey",
      "@adminiuga",
      "@puddly"
    ],
    "config_flow": true,
    "dependencies": [
      "file_upload"
    ],
    "documentation": "https://www.home-assistant.io/integrations/zha",
    "iot_class": "local_polling",
    "loggers": [
      "aiosqlite",
      "bellows",
      "crccheck",
      "pure_pcapy3",
      "zhaquirks",
      "zigpy",
      "zigpy_deconz",
      "zigpy_xbee",
      "zigpy_zigate",
      "zigpy_znp",
      "universal_silabs_flasher"
    ],
    "requirements": [
      "bellows==0.36.5",
      "pyserial==3.5",
      "pyserial-asyncio==0.6",
      "zha-quirks==0.0.104",
      "zigpy-deconz==0.21.1",
      "zigpy==0.57.2",
      "zigpy-xbee==0.18.3",
      "zigpy-zigate==0.11.0",
      "zigpy-znp==0.11.5",
      "universal-silabs-flasher==0.0.14",
      "pyserial-asyncio-fast==0.11"
    ],
    "usb": [
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*2652*",
        "known_devices": [
          "slae.sh cc2652rb stick"
        ]
      },
      {
        "vid": "1A86",
        "pid": "55D4",
        "description": "*sonoff*plus*",
        "known_devices": [
          "sonoff zigbee dongle plus v2"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*sonoff*plus*",
        "known_devices": [
          "sonoff zigbee dongle plus"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*zigstar*",
        "known_devices": [
          "ZigStar Coordinators"
        ]
      },
      {
        "vid": "1CF1",
        "pid": "0030",
        "description": "*conbee*",
        "known_devices": [
          "Conbee II"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8A2A",
        "description": "*zigbee*",
        "known_devices": [
          "Nortek HUSBZB-1"
        ]
      },
      {
        "vid": "0403",
        "pid": "6015",
        "description": "*zigate*",
        "known_devices": [
          "ZiGate+"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*zigate*",
        "known_devices": [
          "ZiGate"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8B34",
        "description": "*bv 2010/10*",
        "known_devices": [
          "Bitron Video AV2010/10"
        ]
      }
    ],
    "zeroconf": [
      {
        "type": "_esphomelib._tcp.local.",
        "name": "tube*"
      },
      {
        "type": "_zigate-zigbee-gateway._tcp.local.",
        "name": "*zigate*"
      },
      {
        "type": "_zigstar_gw._tcp.local.",
        "name": "*zigstar*"
      },
      {
        "type": "_uzg-01._tcp.local.",
        "name": "uzg-01*"
      },
      {
        "type": "_slzb-06._tcp.local.",
        "name": "slzb-06*"
      }
    ],
    "is_built_in": true
  },
  "data": {
    "ieee": "**REDACTED**",
    "nwk": 13767,
    "manufacturer": "Paulmann Licht GmbH",
    "model": "501.34",
    "name": "Paulmann Licht GmbH 501.34",
    "quirk_applied": false,
    "quirk_class": "zigpy.device.Device",
    "manufacturer_code": 4644,
    "power_source": "Battery or Unknown",
    "lqi": 255,
    "rssi": -53,
    "last_seen": "2023-10-20T09:18:09",
    "available": true,
    "device_type": "EndDevice",
    "signature": {
      "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=4644, 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": "0x0104",
          "device_type": "0x0001",
          "input_clusters": [
            "0x0000",
            "0x0001",
            "0x0003",
            "0x0b05",
            "0x1000"
          ],
          "output_clusters": [
            "0x0003",
            "0x0004",
            "0x0005",
            "0x0006",
            "0x0008",
            "0x0019",
            "0x0300",
            "0x1000"
          ]
        },
        "2": {
          "profile_id": "0x0104",
          "device_type": "0x0001",
          "input_clusters": [
            "0x0000",
            "0x0001",
            "0x0003",
            "0x0b05",
            "0x1000"
          ],
          "output_clusters": [
            "0x0003",
            "0x0004",
            "0x0005",
            "0x0006",
            "0x0008",
            "0x0019",
            "0x0300",
            "0x1000"
          ]
        }
      },
      "manufacturer": "Paulmann Licht GmbH",
      "model": "501.34"
    },
    "active_coordinator": false,
    "entities": [
      {
        "entity_id": "button.paulmann_licht_gmbh_501_34_identify",
        "name": "Paulmann Licht GmbH 501.34"
      },
      {
        "entity_id": "sensor.paulmann_licht_gmbh_501_34_battery",
        "name": "Paulmann Licht GmbH 501.34"
      },
      {
        "entity_id": "sensor.paulmann_licht_gmbh_501_34_battery_2",
        "name": "Paulmann Licht GmbH 501.34"
      }
    ],
    "neighbors": [],
    "routes": [],
    "endpoint_names": [
      {
        "name": "LEVEL_CONTROL_SWITCH"
      },
      {
        "name": "LEVEL_CONTROL_SWITCH"
      }
    ],
    "user_given_name": null,
    "device_reg_id": "8ca4512d767c89afc73ce43c27275972",
    "area_id": null,
    "cluster_details": {
      "1": {
        "device_type": {
          "name": "LEVEL_CONTROL_SWITCH",
          "id": 1
        },
        "profile_id": 260,
        "in_clusters": {
          "0x0000": {
            "endpoint_attribute": "basic",
            "attributes": {
              "0x0004": {
                "attribute_name": "manufacturer",
                "value": "Paulmann Licht GmbH"
              },
              "0x0005": {
                "attribute_name": "model",
                "value": "501.34"
              },
              "0x4000": {
                "attribute_name": "sw_build_id",
                "value": "2.7.6_r25"
              }
            },
            "unsupported_attributes": {}
          },
          "0x0001": {
            "endpoint_attribute": "power",
            "attributes": {
              "0x0021": {
                "attribute_name": "battery_percentage_remaining",
                "value": 200
              },
              "0x0033": {
                "attribute_name": "battery_quantity",
                "value": 0
              },
              "0x0031": {
                "attribute_name": "battery_size",
                "value": 255
              },
              "0x0020": {
                "attribute_name": "battery_voltage",
                "value": 33
              }
            },
            "unsupported_attributes": {}
          },
          "0x0003": {
            "endpoint_attribute": "identify",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0b05": {
            "endpoint_attribute": "diagnostic",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x1000": {
            "endpoint_attribute": "lightlink",
            "attributes": {},
            "unsupported_attributes": {}
          }
        },
        "out_clusters": {
          "0x0003": {
            "endpoint_attribute": "identify",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0004": {
            "endpoint_attribute": "groups",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0005": {
            "endpoint_attribute": "scenes",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0006": {
            "endpoint_attribute": "on_off",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0008": {
            "endpoint_attribute": "level",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0019": {
            "endpoint_attribute": "ota",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0300": {
            "endpoint_attribute": "light_color",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x1000": {
            "endpoint_attribute": "lightlink",
            "attributes": {},
            "unsupported_attributes": {}
          }
        }
      },
      "2": {
        "device_type": {
          "name": "LEVEL_CONTROL_SWITCH",
          "id": 1
        },
        "profile_id": 260,
        "in_clusters": {
          "0x0000": {
            "endpoint_attribute": "basic",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0001": {
            "endpoint_attribute": "power",
            "attributes": {
              "0x0021": {
                "attribute_name": "battery_percentage_remaining",
                "value": 200
              },
              "0x0033": {
                "attribute_name": "battery_quantity",
                "value": 0
              },
              "0x0031": {
                "attribute_name": "battery_size",
                "value": 255
              },
              "0x0020": {
                "attribute_name": "battery_voltage",
                "value": 33
              }
            },
            "unsupported_attributes": {}
          },
          "0x0003": {
            "endpoint_attribute": "identify",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0b05": {
            "endpoint_attribute": "diagnostic",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x1000": {
            "endpoint_attribute": "lightlink",
            "attributes": {},
            "unsupported_attributes": {}
          }
        },
        "out_clusters": {
          "0x0003": {
            "endpoint_attribute": "identify",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0004": {
            "endpoint_attribute": "groups",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0005": {
            "endpoint_attribute": "scenes",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0006": {
            "endpoint_attribute": "on_off",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0008": {
            "endpoint_attribute": "level",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0019": {
            "endpoint_attribute": "ota",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0300": {
            "endpoint_attribute": "light_color",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x1000": {
            "endpoint_attribute": "lightlink",
            "attributes": {},
            "unsupported_attributes": {}
          }
        }
      }
    }
  }
}
```

</details>


### Logs

<details><summary>Logs</summary>

```python
[Paste the logs here]
```

</details>


### Additional information

_No response_

Pull request:
Add support for different Paulmann manufacturer name
## Proposed change
<!--
  Explain your proposed change below.
-->
Add support for slightly different Paulmann manufacturer name. Some switches have `Paulmann LichtGmbH`, newer models have `Paulmann Licht GmbH` as manufacturer name.


## Additional information
<!--
  Please include any additional information that is important to this PR.
  For example, if this PR is a potentially breaking change, mention that here.
  If this PR requires other PRs to be merged in HA Core or other projects, mention that.
  Lastly, if this PR fixes a specific issue, please include "Fixes #xxxx".
-->
Fixes #2662 


## Checklist
<!--
  Put an 'x' in all boxes that apply.
  Note: You do not need to tick all boxes before creating a PR.
-->

- [x] The changes are tested and work correctly
- [x] `pre-commit` checks pass / the code has been formatted using Black
- [x] Tests have been added to verify that the new code works


Patch:
diff --git a/zhaquirks/paulmann/__init__.py b/zhaquirks/paulmann/__init__.py
index 1d88c6f..de910e7 100644
--- a/zhaquirks/paulmann/__init__.py
+++ b/zhaquirks/paulmann/__init__.py
@@ -1,3 +1,4 @@
 """Paulmann module."""
 
 PAULMANN = "Paulmann LichtGmbH"
+PAULMANN_VARIANT = "Paulmann Licht GmbH"
diff --git a/zhaquirks/paulmann/fourbtnremote.py b/zhaquirks/paulmann/fourbtnremote.py
index 0c4c6f4..c500551 100644
--- a/zhaquirks/paulmann/fourbtnremote.py
+++ b/zhaquirks/paulmann/fourbtnremote.py
@@ -38,7 +38,7 @@ from zhaquirks.const import (
     PROFILE_ID,
     SHORT_PRESS,
 )
-from zhaquirks.paulmann import PAULMANN
+from zhaquirks.paulmann import PAULMANN, PAULMANN_VARIANT
 
 
 class PaulmannRemote4Btn(CustomDevice):
@@ -49,7 +49,7 @@ class PaulmannRemote4Btn(CustomDevice):
         # device_version=0
         # input_clusters=[0, 1, 3, 2821, 4096]
         # output_clusters=[3, 4, 5, 6, 8, 25, 768, 4096]>
-        MODELS_INFO: [(PAULMANN, "501.34")],
+        MODELS_INFO: [(PAULMANN, "501.34"), (PAULMANN_VARIANT, "501.34")],
         ENDPOINTS: {
             1: {
                 PROFILE_ID: zha.PROFILE_ID,


Test patch:
diff --git a/tests/test_paulmann.py b/tests/test_paulmann.py
index 66523e7..baac779 100644
--- a/tests/test_paulmann.py
+++ b/tests/test_paulmann.py
@@ -1,9 +1,12 @@
 """Tests for Paulmann quirks."""
 
+import pytest
+
 import zhaquirks.paulmann.fourbtnremote
 
 
-def test_fourbtnremote_signature(assert_signature_matches_quirk):
+@pytest.mark.parametrize("manufacturer", ("Paulmann LichtGmbH", "Paulmann Licht GmbH"))
+def test_fourbtnremote_signature(assert_signature_matches_quirk, manufacturer):
     """Test PaulmannRemote4Btn signature is matched to its quirk."""
     signature = {
         "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=4644, 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)",
@@ -39,7 +42,7 @@ def test_fourbtnremote_signature(assert_signature_matches_quirk):
                 ],
             },
         },
-        "manufacturer": "Paulmann LichtGmbH",
+        "manufacturer": manufacturer,
         "model": "501.34",
         "class": "paulmann.fourbtnremote.PaulmannRemote4Btn",
     }