Communication Problem of WindowCovering

Tags: #<Tag:0x00007efec399e828>

Hey everyone,
I guess I’m still quite new to openHAB, so please bare with me with this topic.

I’m using the Busch Jäger free@home automation system including a couple of roller shutters. I have a BJ bridge running and working. All configured things can be controlled over PaperUI, for example. I also have the Homekit Binding configured and running. I was able to pair the Home App with openHAB and I see all my things in the Home App, as well. The only thing that is not working, is controlling the roller shutters.
When I alter the position of the roller shutter in the Home App I can see in the openHAB log file that the values are changing, but the roller shutters are not moving.
I have no idea what I am doing wrong and thought that maybe some one could point me in the right direction. I am willing to share log files or other configuration data - I just don’t know what data you need to see :wink:
Any help would be greatly appreciated!
Thanks

Can we see those entries in your events.log?
And the entries when you successfully control from PaperUI or your proper UI, for comparison?

2020-09-18 07:06:18.703 [thome.event.ExtensionEvent] - Extension ‘misc-homekit’ has been installed.
2020-09-18 07:07:34.184 [ome.event.ItemCommandEvent] - Item ‘Rollade_Buero’ received command 50
2020-09-18 07:07:34.202 [vent.ItemStateChangedEvent] - Rollade_Buero changed from 100 to 50
2020-09-18 07:07:49.570 [ome.event.ItemCommandEvent] - Item ‘Rollade_Buero’ received command 70
2020-09-18 07:07:49.583 [vent.ItemStateChangedEvent] - Rollade_Buero changed from 50 to 70
2020-09-18 07:07:49.910 [ome.event.ItemCommandEvent] - Item ‘Rollade_Buero’ received command 73
2020-09-18 07:07:49.924 [vent.ItemStateChangedEvent] - Rollade_Buero changed from 70 to 73
2020-09-18 07:07:51.634 [ome.event.ItemCommandEvent] - Item ‘Rollade_Buero’ received command 87
2020-09-18 07:07:51.648 [vent.ItemStateChangedEvent] - Rollade_Buero changed from 73 to 87
2020-09-18 07:07:52.778 [ome.event.ItemCommandEvent] - Item ‘Rollade_Buero’ received command 53
2020-09-18 07:07:52.787 [vent.ItemStateChangedEvent] - Rollade_Buero changed from 87 to 53
2020-09-18 07:07:53.064 [ome.event.ItemCommandEvent] - Item ‘Rollade_Buero’ received command 25
2020-09-18 07:07:53.075 [vent.ItemStateChangedEvent] - Rollade_Buero changed from 53 to 25
2020-09-18 07:07:53.201 [ome.event.ItemCommandEvent] - Item ‘Rollade_Buero’ received command 23
2020-09-18 07:07:53.214 [vent.ItemStateChangedEvent] - Rollade_Buero changed from 25 to 23
2020-09-18 07:07:54.486 [ome.event.ItemCommandEvent] - Item ‘Rollade_Buero’ received command 51
2020-09-18 07:07:54.522 [vent.ItemStateChangedEvent] - Rollade_Buero changed from 23 to 51
2020-09-18 07:07:54.775 [ome.event.ItemCommandEvent] - Item ‘Rollade_Buero’ received command 61
2020-09-18 07:07:54.788 [vent.ItemStateChangedEvent] - Rollade_Buero changed from 51 to 61
2020-09-18 07:07:54.935 [ome.event.ItemCommandEvent] - Item ‘Rollade_Buero’ received command 65
2020-09-18 07:07:54.946 [vent.ItemStateChangedEvent] - Rollade_Buero changed from 61 to 65

2020-09-18 07:08:39.292 [ome.event.ItemCommandEvent] - Item ‘EG_Buero_Jalousie’ received command DOWN
2020-09-18 07:08:39.312 [nt.ItemStatePredictedEvent] - EG_Buero_Jalousie predicted to become DOWN
2020-09-18 07:08:42.914 [ome.event.ItemCommandEvent] - Item ‘EG_Buero_Jalousie’ received command STOP
2020-09-18 07:08:44.312 [ome.event.ItemCommandEvent] - Item ‘EG_Buero_Jalousie’ received command UP
2020-09-18 07:08:44.318 [nt.ItemStatePredictedEvent] - EG_Buero_Jalousie predicted to become UP
2020-09-18 07:08:44.324 [vent.ItemStateChangedEvent] - EG_Buero_Jalousie changed from 100 to 0
2020-09-18 07:08:48.394 [ome.event.ItemCommandEvent] - Item ‘EG_Buero_Jalousie’ received command STOP

Sorry, its not a pretty format …The top entries are the ones over the Home App and the bottom ones are the ones over PaperUI.

Thanks for your help.

the issue is:

  • your blinds supports only commands UP and DOWN. these are also commands sent by paper UI
  • homekit sends absolute position, e.g. 0%, 50%, 70%, 100%

please check whether your BJ blinds also support absolute positions. probably you need to check on BJ bridge configuration.

if not, then you need to write a rule which would convert absolute positions to UP/DOWN. e.g. current position is 10, target 50 then we need to send UP command for 5 seconds. i saw somewhere this kind of rules here in forum but could not find it anymore.

2 Likes

I just tried a different setup, first the Home App commands and then the PaperUI commands.

2020-09-18 08:15:08.511 [ome.event.ItemCommandEvent] - Item ‘Rollade_Buero’ received command 40
2020-09-18 08:15:08.537 [nt.ItemStatePredictedEvent] - Rollade_Buero predicted to become 40
2020-09-18 08:15:08.579 [vent.ItemStateChangedEvent] - Rollade_Buero changed from 65 to 40
2020-09-18 08:15:13.307 [ome.event.ItemCommandEvent] - Item ‘Rollade_Buero’ received command 68
2020-09-18 08:15:13.330 [nt.ItemStatePredictedEvent] - Rollade_Buero predicted to become 68
2020-09-18 08:15:13.381 [vent.ItemStateChangedEvent] - Rollade_Buero changed from 40 to 68
2020-09-18 08:15:13.558 [ome.event.ItemCommandEvent] - Item ‘Rollade_Buero’ received command 74
2020-09-18 08:15:13.570 [nt.ItemStatePredictedEvent] - Rollade_Buero predicted to become 74
2020-09-18 08:15:13.585 [vent.ItemStateChangedEvent] - Rollade_Buero changed from 68 to 74

2020-09-18 08:16:08.103 [ome.event.ItemCommandEvent] - Item ‘Rollade_Buero’ received command DOWN
2020-09-18 08:16:08.120 [nt.ItemStatePredictedEvent] - Rollade_Buero predicted to become DOWN
2020-09-18 08:16:11.285 [ome.event.ItemCommandEvent] - Item ‘Rollade_Buero’ received command STOP
2020-09-18 08:16:12.782 [ome.event.ItemCommandEvent] - Item ‘Rollade_Buero’ received command STOP
2020-09-18 08:16:14.146 [ome.event.ItemCommandEvent] - Item ‘Rollade_Buero’ received command STOP
2020-09-18 08:16:14.633 [ome.event.ItemCommandEvent] - Item ‘Rollade_Buero’ received command STOP
2020-09-18 08:16:15.190 [ome.event.ItemCommandEvent] - Item ‘Rollade_Buero’ received command DOWN
2020-09-18 08:16:15.207 [nt.ItemStatePredictedEvent] - Rollade_Buero predicted to become DOWN
2020-09-18 08:16:16.798 [ome.event.ItemCommandEvent] - Item ‘Rollade_Buero’ received command UP
2020-09-18 08:16:16.806 [nt.ItemStatePredictedEvent] - Rollade_Buero predicted to become UP
2020-09-18 08:16:16.818 [vent.ItemStateChangedEvent] - Rollade_Buero changed from 100 to 0
2020-09-18 08:16:23.990 [ome.event.ItemCommandEvent] - Item ‘Rollade_Buero’ received command UP
2020-09-18 08:16:24.009 [nt.ItemStatePredictedEvent] - Rollade_Buero predicted to become UP

You seem to be right, thanks for pointing me in the correct direction. I will take a look if I can find a solution.

If someone else has an idea or a hint, I’m willing to take it :slight_smile:

found the related discussion and rule examples

1 Like

You do realize that is two different Items. Is there supposed to be some kind of hidden connection between them?

yes, I know, I triggered the wrong item in this post, in the second post I triggered the correct one.

1 Like

It’s so frustrating …
I achieved the first goal, the blind is reacting to the Home App!
But so many things still don’t work … I was used to C++, not this :smiley:

Can someone give me a hand? I have the following problems:

  1. I need a variable as an argument for createTimer, but I can’t figure out the correct format!
  2. I need a variable or something to remember the current percentage, but I don’t know how to do that elegantly. An option to set the initial value would be great!
  3. I’m sure there are a lot of options to do it better, like val instead of var, and so on …

Any help is quickly appreciated!! Thanks!

//Globale Laufzeiten der einzelnen Jalousien und Raffstores

//Jalousie Büro

var Number tu_b = 2000 // total time to go from fully closed to fully open in ms
var Number td_b = 3000 // total time to from fully open to fully closed in ms
var Number init_b = 10 // initial percentage


rule "R_EG_Buero_Jalousie"
when
    Item HK_EG_Buero_Jalousie received command // send a command to tell it what percent you want the shutter opened to
then
    var Number new_p = HK_EG_Buero_Jalousie.state as Number
    logInfo("home.rules", "new_p is: " + new_p )
    var percent = Math::abs((init_b - new_p).intValue) // calculate the difference
    var direction = if(init_b < new_p) DOWN else UP
    var time = if(direction == UP) (tu_b * percent) / 100 else (td_b * percent) / 100
    logInfo("home.rules", "percent is: " + percent )
    logInfo("home.rules", "direction is: " + direction )
    logInfo("home.rules", "time is: " + time )
//    var String blup = time.state.toString
//    var DateTime timee = parse(time)
//    logInfo("home.rules", "timee is: " + timee )
    EG_Buero_Jalousie.sendCommand(direction)
    createTimer(now.plusMillis(1000), [ |
        EG_Buero_Jalousie.sendCommand(STOP)
        HK_EG_Buero_Jalousie.postUpdate(EG_Buero_Jalousie.state)
    ])
end

im not a big rule expert (struggling myself as well) but i have a solution for 2).
you have the current percentage directly in your item HK_EG_Buero_Jalousie.
alternatively you can create a new item (without thing connected to it) and store current percentage there.

1 Like

Thanks for your help! Someone pointed me in the right direction, and made my life a lot easier. I can actually just pass on the percentage! :smiley:

1 Like

Hey eugen,
I have a question. I now have a different problem with the Homekit binding. In the Home App I moved the items in different rooms, some stayed in the rooms, but most items only stayed there for a couple of seconds and then moved back to the room where they were in.
I already read similar posts, but they seem to were fixed with binding snapshot 2.5.6. I am already using 2.5.8, but still have this problem. Do you know what might cause this problem?
Thanks for your help!

hm. only couple of seconds?

openHAB cannot control the rooms. we can only send accessories. the room assignment is stored in home app only.

if home app sees major change in accessories it reset the room assignment to default.
e.g. if home app gets an empty accessories list from openhab or accessories with different names it would reset it.
try following

  1. increase log level by executing in karaf console following
    log:set TRACE io.github.hapjava log:set TRACE org.openhab.io.homekit

reproduce the issue with the rooms and check the openhab logs. pay attention to log message like
“add accessory”
“remove accessory”
“/accessories”

Ok, I reproduced it. I was actually able to move items to different rooms and they stayed there, except for 4 remaining items, that all keep coming back to the previous room.

This is the snippet of one item that had anything to do with “accessory”:

2020-09-19 20:18:24.832 [TRACE] [server.impl.http.impl.LoggingHandler] - READ PooledUnsafeDirectByteBuf(ridx: 0, widx: 196, cap: 288) [/192.168.2.143:52954]:
B200A778F0CFEF93D7D76A97B6135C148A707976469B4A3B1B221D3ECCBCD2032D2F18F03E02ED3B704217A73E91CC345274BA3B2D7D157E546359F83B69C517B7ECA11E02432234D683AE10E8AECBB5C24B0F15606987E7A510A34E511509144D4446F6F813800D7237012A66D00548D650B7D04A03F5571307FF56D4D54BDA55E98CF441258A3B1BC3DBB7BA1177EB1D939A20D9C6830C9E2A0A62B6B164986AE63D83187D539C16954D1668502941AE1F5182BE8982DA181017F3CE802CA5D7329F7D
2020-09-19 20:18:24.833 [TRACE] [ons.LengthPrefixedByteArrayProcessor] - Received message of length 196. Existing buffer is 0
2020-09-19 20:18:24.834 [TRACE] [ons.LengthPrefixedByteArrayProcessor] - Attempting to read message of length 196
2020-09-19 20:18:24.835 [TRACE] [ons.LengthPrefixedByteArrayProcessor] - Read complete message
2020-09-19 20:18:24.836 [TRACE] [ons.LengthPrefixedByteArrayProcessor] - Returning 1 results
2020-09-19 20:18:24.838 [TRACE] [kit.internal.HomekitAccessoryUpdater] - Received subscription request for HK_EG_Weg_Licht (Type=SwitchItem, State=ON, Label=HK EG Weg Licht, Category=Light, Tags=[Lighting]) / OnState
2020-09-19 20:18:24.840 [TRACE] [kit.internal.HomekitAccessoryUpdater] - Adding subscription for HK_EG_Weg_Licht (Type=SwitchItem, State=ON, Label=HK EG Weg Licht, Category=Light, Tags=[Lighting]) / OnState
2020-09-19 20:18:24.841 [TRACE] [impl.connections.SubscriptionManager] - Added subscription to class io.github.hapjava.characteristics.impl.common.OnCharacteristic for 1960520
2020-09-19 20:18:24.843 [TRACE] [er.impl.http.HomekitClientConnection] - 204 /characteristics
2020-09-19 20:18:24.845 [TRACE] [server.impl.http.impl.LoggingHandler] - WRITE PooledUnsafeDirectByteBuf(ridx: 0, widx: 105, cap: 256) [/192.168.2.143:52954]:
5700B2121F5792FB47AFA15BFE4C08FB3BEAE44FCCC1DBA34AAFFD416B9A1A43C49274BB724E9B64B641EB1EE8340B26054FA07C64925335B57ACA56E422C8EE8D2A5EED2CA5F554619A91DFA99C50E911205B69BA3A702BA2837701455E14E43D54651F7881110C15

Does that make any sense?

previous room = default room ?

hm. the log looks ok. i was expecting to see something like “Removed accessory …” which would mean, openHAB removed accessory and hence home app would delete the link between accessory and the room.

one more thing to pay attention to: if you have apple tv and ipad then disconnect them from homekit for now. they are acting as a bridge, so that home app could get different information from them and from openhab

1 Like

Thanks again for your help. I disconnected Apple TV for a couple of hours and after I reconnected it the other day, the items did not move back to its default room. So, right now I’m happy as it is :slight_smile:

1 Like

happy to hear that it helped.
it is still a magic for me how homekit bridge on apple tv works.