rudyberends / homebridge-loxone-proxy

Homebridge Dynamic Platform Plugin which exposes a Loxone System to Homekit
Apache License 2.0
11 stars 6 forks source link

Lock Mechanism: Lock/Unlock swapped #88

Closed TheFritz89 closed 6 months ago

TheFritz89 commented 6 months ago

The lock mechanism shows open when it's closed and wise versa. How can i change this behaviour?

rudyberends commented 6 months ago

I assume you are using a switch mapping to translate the Loxone Switch Item to an HomeKit Doorlock right?

The plugin expects the door to be locked when the switch is ON and unlocked when the switch is OFF IMG_0355

In my case the switch name starts with "Deurslot" and on this picture it is locked.

This can then be mapped in the plugin like this;

Scherm­afbeelding 2024-03-04 om 18 45 51

Which will give you this result in HomeKit; IMG_0357

If you are using the mapping, your switch in Loxone probably works the other way around right? You could fix this in Loxone by creating a dummy switch connected to the real switch and using a reversal to give the switch the opposite value. If you have a dedicated Loxone user for the plugin, you could even expose the switch to only the plugin user, so nobody else can see it in the Loxone app.

We could also make an option in the plugin code to reverse the behavior. This would require a configuration parameter in the config, so you can choose the desired behavior of the switch.

Please let me know if this is the case, and how you would like to handle this. If you prefer a change to the code, we will make this a feature request.

TheFritz89 commented 6 months ago

Thank you very much for your fast answer and your help

Yes, the switch is mapped as you assumed. The workaround with the dummy switch is working.

SCR-20240304-rnxb

If you can make it an Option in the config to change the behaviour it would be very nice.

rudyberends commented 6 months ago

I released a new beta version v1.10.0-beta.1. This should give you the requested functionality. Under "switchitem mappings" there is a toggle that reverses the order of the switch. Turning this on should give you a working doorlock on the original switch item.

Please let me know if this is working for you.

TheFritz89 commented 6 months ago

Thank you very much for your effort. It' just working without the "Reverse the switch order" Tick.