-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add IHC8223AL #7494
Add IHC8223AL #7494
Conversation
65698888
commented
May 6, 2024
I refer to the writing method in tuya.ts, why can't mine pass. |
Was it in JavaScript format before and not modified to TypeScript format? |
src/devices/honyar.ts
Outdated
model: 'IHC8223AL', | ||
vendor: 'Honyar', | ||
description: 'Smart Power Socket 10A (with power monitoring)', | ||
fromZigbee: [fz.on_off, fzLocal.honyer_electrical_measurement, fzLocal.honyer_metering], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use modernExtend instead here? Example:
extend: [onOff(), electricityMeter()], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Continue to try to modify, this time there is no error. Please help to check if there are any mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the extend
in this PR yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't I do it the way I'm doing it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, only modernExtend is accepted since this reduces code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use modernExtend for the first time, but I am not sure whether it is successful. Please help to check it.
src/devices/honyar.ts
Outdated
onOff({powerOnBehavior: false}), | ||
electricityMeter({cluster: 'honyar'}), | ||
], | ||
onEvent: async (type, data, device) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try without this? I hope this device support reporting so polling is not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've already tried. Proactively report a problem, you have to proactively poll.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try reusing existing polling code?
Try with:
onEvent: async (type, data, device) => { | |
options: [exposes.options.measurement_poll_interval()], | |
onEvent: (type, data, device, options) => tuya.onEventMeasurementPoll(type, data, device, options), |
src/converters/fromZigbee.ts
Outdated
exposes.options.calibration('voltage', 'percentual'), exposes.options.precision('voltage'), | ||
], | ||
convert: (model, msg, publish, options, meta) => { | ||
if (meta.device.dateCode === '20170621') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, there is a bug for this particular firmware which has the wrong multiplier/divisors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I tried the following method, but it didn't work.
electricityMeter({current: {divisor: 1000}, voltage: {divisor: 1}, power: {divisor: 1}}),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try to do a reconfigure afterwards? This should work (use the yellow refresh icon on the frontend to do so)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your guidance, the display is normal after using the yellow refresh button on the front.
@@ -5140,6 +5140,23 @@ const converters2 = { | |||
return payload; | |||
}, | |||
} satisfies Fz.Converter, | |||
honyer_metering: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this one also be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@65698888 could you check if this one can be removed?
@Koenkk Hello, is there anything that needs to be modified? |
Yes, please check this comment |