TedTolboom / com.mcohome

Homey app for Z-wave devices of MCOhome
MIT License
8 stars 15 forks source link

Physical buttons not updating switch state in Homey #68

Open Wysie opened 1 year ago

Wysie commented 1 year ago

Switch state not being updated in Homey after physical buttons are pressed. Seems like an old issue but it’s happening again. Thanks for building this!

I’m using a Homey Pro 2023.

Wysie commented 1 year ago

Hi there, I was able to narrow it down further. It seems like it’s all the 4-gang switches that are not giving feedback. The rest of the switches update the status fine.

Wysie commented 1 year ago

Hi there, I enabled debug mode and ran, I believe I've found the issue (not sure how to fix it). Mainly, for 4-gang switch, there is no _onReport being sent. See the log here:

2023-08-01_23-54-14

For the others (1-gang and 2-gang), I can see an onReport:

2023-08-01_23-57-17 2023-08-01_23-54-55

I believe this is likely the cause of the issue.

Wysie commented 1 year ago

In device.js for Switch 4-Plus, I changed: this.registerCapability('onoff', 'BASIC'); to this.registerCapability('onoff', 'SWITCH_BINARY');

All seems to work now!

Wysie commented 1 year ago

I've tried changing it back to BASIC and also added:

this.registerReportListener('BASIC', 'BASIC_REPORT', report => { this.setCapabilityValue('onoff', !!report.Value); });

But it still doesn't work. Changed back to SWITCH_BINARY for now.