OH3 Rollershutter and Apple HomeKit

Hi all,

I was about to config rollershutters with slats in OH3 and want to gave access to it over Apple HomeKit. So i followed the example here HomeKit Add-on - System Integrations | openHAB , especially the advanced part of rollershutters:

Then i created the config in the model view:

the angle of the slats can then be adjusted under the rollershutter settings in, for example, Apple Home:

after moving the slider nothing happens. Instead i found the following entries in the openhab.log:

2021-01-01 16:56:29.673 [WARN ] [ssories.HomekitCharacteristicFactory] - Item type Dimmer is not supported for JalousieWZ_Lamellen. Only NumberItem is supported.

Is there something wrong with the example in the OH documentation or is my configuration not correct?

btw i did not try to change the item type.

Thanks,

1 Like

The documentation looks correct to me…

thank you for your answer. I changed the item type to number but then the slider disappears in Home app:

how you configuration looks like? can you try to rename you rollershutter to a different name - this will force home app to create a new one instead of updating an existing one.

i renamed the item and yes, the slider came back. But when i move the slider, nothing happens with the slats, only the angle percentage get’s changed. There’s also no entries in the log.

To my configuration: My rollershutters get controlled by an ABB knx rollershutter actor. This actor has special functions to control the slats. I use knxd on RasPi connected over USB to an ABB USB/S 1.1 bridge component. Here’s the respective OH3 channel config for the rollershutter actor:

  - id: Ch_2117
    channelTypeUID: knx:rollershutter
    label: Jalousie 2.1.1.7
    description: null
    configuration:
      upDown: 0/0/31
      stopMove: 0/0/32
      position: 0/0/33+0/0/34
  - id: Ch_2118
    channelTypeUID: knx:number
    label: Lamellen 2.1.1.8
    description: null
    configuration:
      ga: 0/0/35+0/0/36

the rest of the config should be seen above.

btw the config with dimmer was working fine within OH3, just not with homekit.

looks like HomeKit expects only NumberItem but your KNX setup prefers DimmerItem.
i would say, homekit should support dimmer as well. i will add supports for Dimmer to HomeKit binding, until then you would need to work with additional item and rule.

e.g.

JalousieWZ_Lamellen ... {knx channel..}
JalousieWZ_Lamellen_HK ... {homekit=..


rule HK_KNX_mapping for JalousieWZ_Lamellen
when
Item JalousieWZ_Lamellen_HK received update 
then
    JalousieWZ_Lamellen.sendCommand(JalousieWZ_Lamellen_HK.state)
end 
2 Likes

Pull request is submitted. once it gets merged and new version of binding is released, you can use dimmer items

1 Like

@MikeFo
question to double-check my understanding:

  • which values you get from KNX when your slat is completely open / close?

is it 0 % = closed, 100 %=open? or different range/ semantic ?

@yfre should be the way you described, at least when i see the log

2021-01-05 21:06:58.461 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'JalousieAktor1_Lamellen2118' received command 0
2021-01-05 21:06:58.463 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'JalousieAktor1_Lamellen2118' predicted to become 0
2021-01-05 21:06:58.465 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'JalousieAktor1_Lamellen2118' changed from 100 to 0
2021-01-05 21:07:25.370 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'JalousieAktor1_Lamellen2118' received command 100
2021-01-05 21:07:25.371 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'JalousieAktor1_Lamellen2118' predicted to become 100
2021-01-05 21:07:25.372 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'JalousieAktor1_Lamellen2118' changed from 0 to 100 

and here’s the output from the busmonitor:

the description in ETS says basically the same:

ok. thank you.
it means we need a translation. HomeKit/Home app works with angels: -90 to +90.
-90 and +90 means closed
0 means open.

this can be done with rules as well.

Hi guys, I am having the EXACT same issue when trying to add the slat angle from KNX Rollershutters to HomeKit. I think that everyone with KNX will have this issue. So happy to read your active conversation on this.
I have it now running in a quite complicated way but working.

For each rollershutter in the house:
1 Rollershutter Equipment Group [HomeKit…]

  • 1 Rollershutter Item for Position [HomeKit…]
  • 1 Dimmer Item for Slat Angle
  • 1 Number Item for Slat Angle Conversion HomeKit [HomeKit…]

1 Rule for each rollershutter which writes from the dimmer to number including conversion and 1 Rule for the other direction

can you share the rule so that i can double check the logic? i would implement this rule then directly into the homekit addone so that it will do conversion without the rule

**Of course, these are the two rules **

Rule which writes from NumberItem to DimmerItem and which converts the range from [-90 … +90] to [0 … 100]

triggers:
  - id: "1"
    configuration:
      itemName: MyNumberItem
    type: core.ItemCommandTrigger
conditions: []
actions:
  - inputs: {}
    id: "3"
    configuration:
      type: application/vnd.openhab.dsl.rule
      script: >-
        var Number cmd = receivedCommand as DecimalType
        KNXInstallation_RaffstoreLamellenDimmerItem.sendCommand( cmd * 50.0/90.0 + 50.0 )
    type: script.ScriptAction

Rule which writes from DimmerItem to NumberItem and which converts the range from [0…100] to [-90 … +90]

triggers:
  - id: "1"
    configuration:
      itemName: KNXInstallation_RaffstoreLamellenDimmerItem
    type: core.ItemStateChangeTrigger
conditions: []
actions:
  - inputs: {}
    id: "2"
    configuration:
      type: application/javascript
      script: >+
        events.postUpdate('MyNumberItem', itemRegistry.getItem('KNXInstallation_RaffstoreLamellenDimmerItem').getState() * 90.0/50.0 -90.0);

    type: script.ScriptAction
2 Likes

Hi @yfre,
mine are working from 0° - 90°.
I was never able to configure on homekit…
Anyways: is there a possibility to switch between -90°/90° or 0°/90° ?

by default, home app expect -90 to +90 range. we need to implement kind of mapping in openhab, either using rules as shared above or put in the addon code

I only can tell I’m using somfy binding - in the somfy app you can choose if its -90°/90° or 0°/90°.
Anyways: OH3 + Somfy Binding recognized my blinds can do 0°/90°.
0 % → closed
50 % → 45°
100 % → opened

Number as in documentations didn’t give my any result.

ok. it is not 0-90 but 0%-100%
so, it is similar to what @Sebastian_Jonas has. so, his rules should work for you as well

pull request with the fix is created

it implements the logic as in the rules from @Sebastian_Jonas

once pull request is merged, you can update the homekit addon and remove the rules.

2 Likes

Super cool! Big thank you!!

Thank you! I will check that as soon as possible.