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

feat(add): MiBoxer TR-C1ZR dimmer https://github.com/Koenkk/zigbee2mq… #7638

Merged
merged 3 commits into from
Jun 20, 2024

Conversation

mlichvar
Copy link
Contributor

This is an attempt to add support for the MiBoxer dimmer requested in Koenkk/zigbee2mqtt#19141.

It depends on Koenkk/zigbee-herdsman#1090.

I'm not sure if it this is the right approach. I don't really know what I'm doing here. At least one missing piece is reading the minimum brightness back. Suggestions welcome.

src/lib/tuya.ts Outdated
@@ -1684,8 +1693,8 @@ const tuyaModernExtend = {
return tuyaModernExtend.dpEnumLookup({name: 'power_on_behavior', lookup: lookup, type: dataTypes.enum,
expose: e.power_on_behavior(Object.keys(lookup)).withAccess(readOnly ? ea.STATE : ea.STATE_SET), ...args});
},
tuyaLight(args?: modernExtend.LightArgs & {minBrightness?: boolean, switchType?: boolean}) {
args = {minBrightness: false, powerOnBehavior: false, switchType: false, ...args};
tuyaLight(args?: modernExtend.LightArgs & {minBrightness?: boolean, minBrightness2?: boolean, switchType?: boolean}) {
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
tuyaLight(args?: modernExtend.LightArgs & {minBrightness?: boolean, minBrightness2?: boolean, switchType?: boolean}) {
tuyaLight(args?: modernExtend.LightArgs & {minBrightness?: 'attribute' | 'command', switchType?: boolean}) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added also "none" for devices that cannot set minimum brightness. Not sure if that is right.

@mlichvar
Copy link
Contributor Author

Thanks for the suggestions. I updated the commit.

I was able to capture the attribute that the Tuya gateway is requesting and I could add it to Z2M, but strangely the response contains the value in the position of the data type, causing errors like:

'Error: ZCL command 0xa4c138cda399565f/1 lightingColorCtrl.read([61698], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Read for '7' not available)'

With the convertGet removed, I still get z2m: No converter available for 'get' 'min_brightness' () and the CI is failing. I'm not sure if that STATE_SET does what I think it does or if it is set correctly.

@Koenkk Koenkk merged commit aafe5c6 into Koenkk:master Jun 20, 2024
2 checks passed
@Koenkk
Copy link
Owner

Koenkk commented Jun 20, 2024

Thanks!

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.

2 participants