Hello community,
reading through this community helped me a lot. Thanks to all btw.
For the following issue I did not find a solution over the last weeks.
An Item has autoupdate=false because it should receive the updates only via postUpdate from a rule. This works fine, but after around 15 to 40 seconds the Item state jumps back.
The details:
The item which is of interest to show the state
Switch Licht_EG_Flur_Decke "Flur Decke" (EG_Flur) {tinkerforge="uid=rFs, subid=out2", autoupdate="false"}
The item which is receiving the state:
Contact Sensor_Licht_EG_Flur_Decke {tinkerforge="uid=wj6, subid=ina4"}
The rule which posts the updates to the Switch item:
rule "Status Licht EG Flur Decke AN"
when
Item Sensor_Licht_EG_Flur_Decke changed from OPEN to CLOSED
then
postUpdate(Licht_EG_Flur_Decke, ON)
end
rule "Status Licht EG Flur Decke Aus"
when
Item Sensor_Licht_EG_Flur_Decke changed from CLOSED to OPEN
then
postUpdate(Licht_EG_Flur_Decke, OFF)
end
Not sure if this is of interest but there is another rule that is needed to make the switch working properly in our home:
rule "Automatisches Tasterloslassen"
when
Item Licht_EG_Flur_Decke received command ON
then
Licht_EG_Flur_Decke.sendCommand(OFF)
end
The background of this rule is that the house has installed relays for each light. These relays are switched on and off by push buttons that are installed in this house. And to create real push buttons in Openhab this rule was necessary. With this rule only, OH does not know if the light is on or off.
These hardware relays have two outputs. One is used for the light, the other one is used to detect the status of the light. That is what triggers the above mentioned Contact item.
I tested a lot, but it looks that I don’t fully understand what happens…
Some tests:
- The postUpdate rule was deactivated. Then the UI very quickly shows the light flashing on and then off. So the postUpdate rule is working properly. But it somehow is loosing the status.
- When the hardware pushbuttons are used OH correctly detects it and updates the Contact and the Switch Item, but the Switch Item falls back also when triggerd with the hardware buttons.
- I added to the sitemap the Contact item to see if OH really has the status from the relay. This also is showing the correct state.
Using OH 1.8 on a RED Brick from Tinkerforge
Thanks for reading!