OpenHab2+Zwave+Homekit

I am running OH2 with Zwave lighting switch and HomeKit addon. Setup works fine except switch status update.

F.e I turn off lights using OH or HomeKit app and see light icon indicates that it is off. But if I manually turn the light off (pressing button on switch itself), OH (or HomeKit) doesn’t update item status. So I have to guess is it on or off.

Here is what I have in conf files:

house.items
Switch LivingRoomLight “Living Room Light [%s]” [ “Lighting” ]

also tried to specify item with - Switch LivingRoomLight “Living Room Light [%s]” [ “Lighting” ] { zwave=“2:command=SWITCH_MULTILEVEL” }

house.sitemap
Switch item=LivingRoomLight

If I don’t put switch item in .items file, everything works fine. OH2 autoupdates status of the switch BUT HomeKit doesn’t see item.

So question is how make HomeKit to pull real time status of ZWave switch?

You need a rule that updates your switch. I have a similar setup, and use the following rules to make that all work:

rule "Populate lr_ReadingLamp from zwave_device_7313d737_node3_switch_binary"
when
  Item zwave_device_7313d737_node3_switch_binary received update or
  System started
then
  lr_ReadingLamp.postUpdate(zwave_device_7313d737_node3_switch_binary.state)
end

rule "lr_ReadingLamp switched"
when
        Item lr_ReadingLamp received command
then
        zwave_device_7313d737_node3_switch_binary.sendCommand(receivedCommand)
end

Thank you. Could you please share item definition for this rule ?

zwave_device_7313d737_node3_switch_binary and lr_ReadingLamp is the same device, right ?

Sure. The item zwave_device_7313d737_node3_switch_binary was created by PaperUI when the Thing was added. The item lr_ReadingLamp is not linked to the Thing at all, and its defined as: Switch lr_ReadingLamp "Living Room Reading Lamp [%s]" (livingRoom) [ "Lighting" ]

Sorry for being annoying, but it doesn’t work for me. I tried all possible and impossible variations for these rules. So rule “lr_ReadingLamp switched” works fine, it updates OH item when I use HomeKit app. But first rule where it has to populate Lamp switch status from zwave doesn’t work. Here is what i have in my conf files.

Item:
Switch lr_ReadingLamp “Living Room Reading Lamp [%s]” (livingRoom) [ “Switchable” ]

Sitemap:
Switch item=zwave_device_15811533c44_node6_switch_dimmer

Rule:
rule "Populate lr_ReadingLamp from zwave_device_15811533c44_node6_switch_dimmer"
when
Item zwave_device_15811533c44_node6_switch_dimmer received update or
System started
then
lr_ReadingLamp.postUpdate( zwave_device_15811533c44_node6_switch_dimmer.state)
end

rule "lr_ReadingLamp switched"
when
Item lr_ReadingLamp received command
then
zwave_device_15811533c44_node6_switch_dimmer.sendCommand(receivedCommand)
end

Any ideas what I am doing wrong ? I am using latest snapshot of OH2.

Just to clarify, if I physically turn off switch it updates OH status, but not HomeKit.

Fixed.

The problem is in zwave_device_15811533c44_node6_switch_dimmer . I had to create dimmer item instead of switch for HomeKit binding.

Thanks for your help.

Sorry, I didn’t realize you were using a dimmer. I have an example for a dimmer too. With my dimmer, I encountered a weird issue with HomeKit, you should take a look at my post here to see if it’s relevant to you: HomeKit Dimmer sends ON before level

Thank you so much. You saved my time :slight_smile: I have exactly the same dimmer and faced same problem. Workaround by setting that rule works perfectly.

Glad to help!