-
Notifications
You must be signed in to change notification settings - Fork 703
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
[Device Support Request] TS0601_TZE200_drs6j6m5 #3557
Comments
Ok, some update, I'm able now to control the brightness - issue was with the dp to attribute mapping. Lifud is using id This can potentially work on the same set of devices as on Zigbee2MQTT
"""Tuya dimmable led controller."""
from zigpy.profiles import zgp, zha
from zigpy.quirks import CustomCluster, CustomDevice
from zigpy.zcl.clusters.general import (
Basic,
GreenPowerProxy,
Groups,
Identify,
LevelControl,
OnOff,
Ota,
Scenes,
Time,
)
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODELS_INFO,
OUTPUT_CLUSTERS,
PROFILE_ID,
)
from zhaquirks.tuya import NoManufacturerCluster, TuyaDimmerSwitch
from zhaquirks.tuya.mcu import (
TuyaInWallLevelControl,
TuyaLevelControlManufCluster,
TuyaOnOff,
TuyaOnOffNM,
TuyaLevelControl,
TuyaOnOffManufCluster,
DPToAttributeMapping
)
class TuyaInWallLevelControlNM(NoManufacturerCluster, TuyaInWallLevelControl):
"""Tuya Level cluster for inwall dimmable device with NoManufacturerID."""
class TuyaLevelControlManufClusterLifud(TuyaLevelControlManufCluster):
"""Tuya with Level Control data points for Lifud led driver."""
dp_to_attribute: dict[int, DPToAttributeMapping] = {
1: DPToAttributeMapping(
TuyaOnOff.ep_attribute,
"on_off",
),
3: DPToAttributeMapping(
TuyaLevelControl.ep_attribute,
"current_level",
converter=lambda x: (x * 255) // 1000,
dp_converter=lambda x: (x * 1000) // 255,
)
}
class TuyaDimmableLedController(TuyaDimmerSwitch):
"""Tuya dimmable led controller."""
signature = {
MODELS_INFO: [("_TZE200_drs6j6m5", "TS0601")],
ENDPOINTS: {
1: {
PROFILE_ID: 260,
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
INPUT_CLUSTERS: [
4, 5, 61184, 0
],
OUTPUT_CLUSTERS: [25, 10],
},
242: {
PROFILE_ID: 41440,
DEVICE_TYPE: 97,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [33],
},
},
}
replacement = {
ENDPOINTS: {
1: {
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
Groups.cluster_id,
Scenes.cluster_id,
Basic.cluster_id,
TuyaLevelControlManufClusterLifud,
TuyaOnOffNM,
TuyaInWallLevelControlNM,
],
OUTPUT_CLUSTERS: [25, 10],
},
}
}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem description
I recently have bought a led driver Lifud LF-GAZ150A6250-24.
Device can be added via ZHA to HA, but there are no switches available.
Purchased from here.
Solution description
I would like to control the brightness and be able to turn off/on light.
Screenshots/Video
Screenshots/Video
[Paste/upload your media here]
Device signature
Device signature
Diagnostic information
Diagnostic information
[Paste the diagnostic information here]
Logs
Logs
Custom quirk
Custom quirk
Additional information
With the above quirk I'm able to control the on/off state, to add brightness control I've tried to use
TuyaLevelControl
,TuyaLevelControlManufCluster
andTuyaInWallLevelControl
but they didn't work for me.As I have seen, this device is supported by Zigbee2MQTT where they set
as tuya datapoint
After trying to figure out what should be send I noticed that the values within payload might need to be changed from
transition_time
totranstime
- I was trying to customizeF000LevelControlCluster
but due to not fully understanding what exactly needs to be send I was not able to control the brightness.The text was updated successfully, but these errors were encountered: