youridijk / homebridge-kaku-ics2000

HomeKit support for Klik Aan Klik Uit ICS-2000
Apache License 2.0
21 stars 6 forks source link

Dimmers are shown as switches #8

Closed RonaldR closed 1 year ago

RonaldR commented 1 year ago

Hi! Thanks for this plugin! Some of my lights in kaku are dimmable, but in homebridge/homekit they now show up as switches. Is this a setting I missed?

Thanks!

youridijk commented 1 year ago

You did nothing wrong! Every device has an integer defining which device type it is (zigbee switch, dimmable, etc). The list of device types that are dimmable devices isn't complete. If you can provide the device types of your devices, I will add them to the plugin. You can find this integer behind your device name when homebridge is booting ('Loaded device from cache: [device name]: [your device type]' . In addition to that, I will add an option to the plugin settings where you can specify which devices are dimmable.

RonaldR commented 1 year ago

Awesome, thanks! This is an example of a dimmable light: [ICS-2000] Loaded device from cache: Eet tafel: 2

RonaldR commented 1 year ago

Added a PR: https://github.com/youridijk/homebridge-kaku-ics2000/pull/9

youridijk commented 1 year ago

Thanks for your PR!

RonaldR commented 1 year ago

Are you going to publish the new version to npmjs?

youridijk commented 1 year ago

Yes I will. I always wait a few days so I can test it on my own homebridge setup. I will publish it this evening.

RonaldR commented 1 year ago

Thanks! Unfortunately my dimmers are still shown as switches in homebridge and homekit. I also tried to put the dimmers in dimmableOverrides but that did not change anything. I did clear the cache and restarted homebridge. I have this kind of dimmers: https://klikaanklikuit.nl/product/multi-inbouwdimmer/

Next to that, kaku smoke detectors are device type 43, which are now shown as switches. (maybe better to hide them?) (https://klikaanklikuit.nl/product/slimme-draadloze-rookmelder/)

youridijk commented 1 year ago

You could try to re-add the homebridge hub to your home. I will add a debug log to this plugin that logs which device is supposed to be a switch and which a dimmable.

I’m still not sure which device types are which devices but you can hide devices using the deviceBlacklist property in the homebridge config.

RonaldR commented 1 year ago

I tried the re-add, but they are still switches.

RonaldR commented 1 year ago

Since 1.0.6 the lights now show as dimmers (and switches), but they are not working. Getting this log: [homebridge-kaku-ics2000] This plugin generated a warning from the characteristic 'Brightness': characteristic value expected valid finite number and received "undefined" (undefined). See https://homebridge.io/w/JtMGR for more info.

youridijk commented 1 year ago

My guess is that the different device types use different data from the status array. The current behavior of dimmable devices is based on the devices I can test with. Maybe you could figure out which data your devices use for the dim level? I documented the research of others (especially from the python variant of this plugin) and my own. For now, you need to manually interact with the KAKU api, but I am working on a REST server so anyone can easily communicate with the KAKU api.

RonaldR commented 1 year ago

I added a PR to add device type 2 functionality: https://github.com/youridijk/homebridge-kaku-ics2000/pull/13

youridijk commented 1 year ago

Thanks for the PR! I published a new version with your fixes. For now it's fine, but I will make a good way to define the functions integers for on/off, brightness, etc for every device type.