On openHABian and latest snapshot now, but I had the same issue on stable with openHAB2 installed on a Windows-computer as well.
I have tried getting the expire-binding to work in many different ways and it never fires.
Setup 1:
Switch bound to switch_dimmer (Fibaro dimmer 2 channel) with expire="1m,sendCommand(OFF)"
Tested with expire from 2s to 30m and with "command=OFF", "OFF" et cetera too.
The switch turns on, but expires (the switch never changes to OFF)
Setup 2:
Switch 1 bound to switch_dimmer (Fibaro dimmer 2 channel).
Switch 2 a la "Switch My_Expire_Switch "MySwitch" [expire="2m,sendCommand(OFF)"}
When Switch 1 receives ON it successfully turns on Switch 2 with a “My_Expire_Switch.sendCommand(ON)”.
The expire-switch then never turns off.
I think this should be easy and should work, but obviously there is something I’m missing. The items do not get repeatedly updated (and hence postpone the expiration).
The things are added through GUI (habmin or paperUI).
Items are defined in items.items or similar.
Rules are defined in rules.rules or similar.
rule My_Light_Switch received ON"
when
Item My_Light_Switch received command ON
then
logInfo("rules.rules","Lights received ON")
end
rule My_Light_Switch received OFF"
when
Item My_Light_Switch received command OFF
then
logInfo("rules.rules","Lights received OFF")
end
Here “Lights received ON” will show in the log, but “Lights received OFF” will never show. And the item is not switched off either.
I also think the EXPIRE binding is a great idea (esp. as opposed to standard timers) HOWEVER, I will state that I have a few EXPIRE virtual items which used to work (mostly startup delays to allow my zwave net to repopulate from a “cold start”) but they have been consistently NOT working since the OH 2.2 release.
for the record, I have two virtual items (for switches and dimmers respectively, defined as:
Switch SW_Startup_Switch
Switch SW_Startup_Dimmer
These are supposedly triggered by the following EXPIRE items:
I have changed the expire timeout from the nominal 5m/6m in the item names to 15m and 16m in the expire parameters because on a real “cold start” it can take a while for the (principally-zwave network) to initialize all the nodes.
The operative rules are:
rule "set SW_Startup_Flag OFF when startup timer expires"
when
Item STARTUP_TIMER_5m_OFF changed to OFF
then
...
...
There are subsequent rules which trigger on the change of the SW_Startup_Switch viz.,
rule "u_01 SW_Startup_Switch changed to OFF"
when
Item SW_Startup_Switch changed to OFF
then
//initialize a bunch of variables....
......
The symptom is that the STARTUP_TIMER items are NOT expiring…they USED TO prior to 2.2 release but now are not.
Adding the binding (again) makes the expire work again. Thanks again!
If I send an update through GUI or console to the item directly (for example to the aforementioned light-switch), the switch will turn off again after the expiration period.
I don’t get the items to react to me physically pushing the switch button though, but that’s not related to the expire binding. If I physically turn the light on, no events are recorded. Any help is much appreciated!
Have you verified that it is indeed the Item and not the Rule by looking in events.log and verifying that the Switch is not getting commanded to OFF and for some reason the Rule isn’t firing?
How do to command the Timer Items to ON? Perhaps that Rule is not running or running much later than you expect?
The fact that they are a startup timer there is a whole host of things that can be causing problems that are not related to Expire. It’s a pretty simple binding. I would expect it to either work all the time or work none of the time so when I see this I’m thinking the problem more likely lies outside the binding.
The fact that it used to work and now doesn’t with the upgrade also points to this being a timing problem and the fact that it worked before was a fluke of the timing. Gotta love multi-threaded debugging.
The reason for my physical things not updating through channels was that the association to the controller was not added during inclusion. Not sure how this happened as inclusion always has added the association group before and after.
So to conclude this thread from my side:
Symptom 1: Expire does not send command after the specified delay
Symptom 2: Physical buttons do not update items.
Solution to #1: Adding the Expire-binding.
Solution to #2: Adding association group in habmin (adding the zstick to Lifeline - Controller updates)
All.
I have a simimlar issue here with openHAB 2.2 on a Rasp PI 3 Model B
I just have to items switches here.
One is programing to switch off after 3 minutes and works reliable.
The other one is another switch that is programed to stay on for three hours but this is not switching off after its time.
I can’t send you the items definitions right now but they were copy and paste and replace the item name and the m from minutes to h for hours.
If no other has my simptoms I will add items definitions so probably anyone will see the mistake I can’t see.
Thanks.
I just want to add that since recently I experience exactly the same problem with one of my 4 “expire-configured” switches. All worked fine few months ago.
Three of them are working as designed and switch off after 5, 10 and 15 Minutes respectively. The forth one which is set to 30 Minutes works… only sometimes - I didn’t get the pattern yet, although I suppose that switching it ON - let’s say electronically - works fine, but doing so manually (the wall switch) doesn’t.
What I don’t get is the fact that I can see manual ON in the log, and yet it won’t expire.
Solution to #2: Adding association group in habmin
@Landstad All four of them lacked the association to controller (yet three of them worked fine). I just added the association for all of them. I’ll see what happens…