Homekit windows and door status

The status of my windows and my doors is reversed in Apple Homekit. When the windows are open, they are shown as closed, and when the windows are closed, they are shown as open in Homekit. So the status is reversed. In Openhab, the state is displayed correctly. How can this problem be solved?
I use Openhab 3.0.1 with the binding from Livisi (innogy)

1 Like

Hi,
You can try to add the

inverted = true

via code for the contact sensor, but I am not sure whether it is already supported in your version or not.

If it doesn’t work, you have to update your HomeKit binding to a newer Snapshot version.

Best regards
Dirk

1 Like

@dirkdirk Thank you very much for your help. I have updated homekit to the latest snapshot version, but now the service no longer starts. Version 3.0.1 was previously installed.
I get these errors:

Error executing command: Error executing command on bundles:
Error starting bundle 269: Could not resolve module: org.openhab.io.homekit [269]
Unresolved requirement: Import-Package: org.osgi.framework; version="[1.9.0,2.0.0)"

Sorry, but I can’t help you wirh this error. Worked for me without any problems.
Maybe try another snapshot version or @yfre knows how to fix this?

@nohi79 how you have installed new version? using karaf update command and putting jar into addon folder?
have you tried to restart openhab?
as the last solution i would try to uninstall and install the binding again, using karaf commands uninstall and install

@yfre I have updated the version via the karaf console. But I did not put a jar file in the addons directory. I didn’t know that you had to do that too. I’ll try that out right away.

@yfre I have now placed the jar file in the addons folder. But I still get the error message when I start the service.

actually installing from karaf is the better way to do it. i know errors similar to your when addon installed using addon folder and not karaf.
no sure why you get this error when install using karaf. the only idea i have to to uninstall, restart openhab and install again using karaf

@yfre @dirkdirk Since I did not get any further with the Homekit update, I have now installed Milestone version 3.1.0.M3. All services are now running again, including the latest Homekit integration. But now back to my problem. Unfortunately, the inverted function does not work. When the window is closed, “open” is still displayed, and when the window is open, “closed” is displayed in Homekit.

This is deposited with “Code”:
value: Window
config:
inverted: “true”

inverted: true is default setting for windows and doors, try with inverted: “false”

@yfre perfect, thx. The status now works correctly for my windows. Unfortunately, it does not work for the door with inverted false. Is there another trick for doors?

doors and windows are working exactly in the same way. it is copy&paste code. so, should work with inverted in the same way.
do you use the same item type? e.g. switch or contact for both, window and door?

@yfre I have completely restarted openhab again. Now the door also works correctly. (The door is also set up as a contact.) Many thanks for the good and quick help!

Another question. When I open the window now, it is correctly displayed as open in Homekit. However, it still says an opening rate of 1%. But there is actually only one open and closed status for me. How can I remove the percentage?

Door and Window in homekit are motorized doors and windows, which have current and target open state in percentage. you can add current / target position and set them to 0% or 100% depending on status (open/close). e.g. using rules.

but if you dont need percentage then use “ContactSensor” instead of Windows/Door. for ContactSensor you can select in home app the icon, which can icon for windows or for door.

@yfre Perfect. With the contact sensor, it’s exactly what I wanted. Thank you very much :slight_smile: