OpenHab2 - avmfritz binding & expire binding conflict (ON every 15 seconds)

Hi there,

I just wanted to have one of my AVM DECT outlets expire it’s ON status after a given time by using the expire binding.
However, this didn’t work and when checking the logs of the expire binding I found, that the AVM binding seems to resend ON every 15 seconds.

This makes the expire binding re-start expire interval every 15 seconds. So expire (which should send command=OFF after 15 minutes in my case) will never happen.

12:37:00.580 [TRACE] [inding.expire.internal.ExpireBinding] - Received update 'ON' for item ug_hzng_outlet1
12:37:00.580 [TRACE] [inding.expire.internal.ExpireBinding] - Received command 'ON' for item ug_hzng_outlet1
12:37:00.582 [DEBUG] [inding.expire.internal.ExpireBinding] - Item ug_hzng_outlet1 will expire (with 'OFF' command) in 30000 ms
12:37:00.583 [DEBUG] [inding.expire.internal.ExpireBinding] - Item ug_hzng_outlet1 will expire (with 'OFF' command) in 30000 ms
12:37:00.762 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...
12:37:01.764 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...
12:37:02.766 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...
12:37:03.767 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...
12:37:04.769 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...
12:37:05.770 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...
12:37:06.772 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...
12:37:07.228 [TRACE] [inding.expire.internal.ExpireBinding] - Received update 'ON' for item ug_hzng_outlet1
12:37:07.231 [DEBUG] [inding.expire.internal.ExpireBinding] - Item ug_hzng_outlet1 will expire (with 'OFF' command) in 30000 ms
12:37:07.777 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...
12:37:08.779 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...
12:37:09.781 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...
12:37:10.782 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...
12:37:11.784 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...
12:37:12.786 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...
12:37:13.788 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...
12:37:14.790 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...
12:37:15.791 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...
12:37:16.793 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...
12:37:17.795 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...
12:37:18.797 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...
12:37:19.799 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...
12:37:20.800 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...
12:37:21.334 [TRACE] [inding.expire.internal.ExpireBinding] - Received update 'ON' for item ug_hzng_outlet1
12:37:21.338 [DEBUG] [inding.expire.internal.ExpireBinding] - Item ug_hzng_outlet1 will expire (with 'OFF' command) in 30000 ms
12:37:21.803 [TRACE] [inding.expire.internal.ExpireBinding] - Executing...

Any ideas on how to overcome this?

Regards,

Uwe

Hi,

I have never used the expire binding, so I am not sure if you can solve it with the binding.

But you can solve it with a simple rule including a timer. Just trigger the rule on state changed and not on state updated.

I am now working around this with a virtual/proxy item but maybe there is another, more elegant way.

Uwe

Hey Uwe,

unlucky situation I. I am not sure how to solve this in an elegant way. If I should make an educated guess: I have two two possible ways in my mind. Both needs improvements in one of the used bindings.

  1. Change the update channel state logic in avmfritz binding. Since the binding needs to poll the state of each device in a user defined intervall, it sends the values for each linked channel in the same rhythm. Solution could be to check if the current channel state is really different before updating it.

  2. Add a configuration parameter to the expire binding, to define, if the expiry timer should be reset with each update, or only with each change. Question is: Does the expire binding keep track of old states? I don’t think so.

Let’s discuss. Regards.

Hi Uwe,

I’m not sure you really need a proxy item.

It should also work like this (not tested):

rule "ug_hzng_outlet1 timer"
        when
                Item ug_hzng_outlet1 changed
        then
                if (ug_hzng_outlet1.state == OFF) {
                        if (timer != null) {
                        timer.cancel
                        timer = null
                        }
                }

                if (ug_hzng_outlet1 == ON) {
                        timer = createTimer(now.plusMinutes(15)) [|
                                ug_hzng_outlet1.sendCommand(OFF)
                        ]
                }
end

Greetings
Sebastian

Thanks for your feedback and the sample code to achieve the result without expire binding.
The proxy item approach is now working for me. The readme of the expire binding mentions the limitation.
http://docs.openhab.org/addons/bindings/expire1/readme.html

However, if the avmfritz binding would not poll and report all information every 15 seconds but only changes, this would resolve the issue with DECT outlets and expire binding.

Cheers,

Uwe