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

Add IHC8223AL #7494

Closed
wants to merge 46 commits into from
Closed

Add IHC8223AL #7494

wants to merge 46 commits into from

Conversation

65698888
Copy link
Contributor

@65698888 65698888 commented May 6, 2024

IHC8223AL(z2m用)

@65698888
Copy link
Contributor Author

65698888 commented May 6, 2024

I refer to the writing method in tuya.ts, why can't mine pass.

@65698888
Copy link
Contributor Author

65698888 commented May 6, 2024

Was it in JavaScript format before and not modified to TypeScript format?

model: 'IHC8223AL',
vendor: 'Honyar',
description: 'Smart Power Socket 10A (with power monitoring)',
fromZigbee: [fz.on_off, fzLocal.honyer_electrical_measurement, fzLocal.honyer_metering],
Copy link
Owner

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()],

Copy link
Contributor Author

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.

Copy link
Owner

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

Copy link
Contributor Author

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?

Copy link
Owner

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.

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 use modernExtend for the first time, but I am not sure whether it is successful. Please help to check it.

onOff({powerOnBehavior: false}),
electricityMeter({cluster: 'honyar'}),
],
onEvent: async (type, data, device) => {
Copy link
Owner

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.

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've already tried. Proactively report a problem, you have to proactively poll.

Copy link
Owner

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:

Suggested change
onEvent: async (type, data, device) => {
options: [exposes.options.measurement_poll_interval()],
onEvent: (type, data, device, options) => tuya.onEventMeasurementPoll(type, data, device, options),

exposes.options.calibration('voltage', 'percentual'), exposes.options.precision('voltage'),
],
convert: (model, msg, publish, options, meta) => {
if (meta.device.dateCode === '20170621') {
Copy link
Owner

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?

Copy link
Contributor Author

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}}),

Copy link
Owner

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)

Copy link
Contributor Author

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: {
Copy link
Owner

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?

Copy link
Owner

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?

@65698888
Copy link
Contributor Author

@Koenkk Hello, is there anything that needs to be modified?

@Koenkk
Copy link
Owner

Koenkk commented Jun 22, 2024

Yes, please check this comment

@65698888 65698888 closed this Sep 30, 2024
@65698888 65698888 deleted the patch-1 branch September 30, 2024 07:40
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