Homematic - no reaction on second change

Hello :slight_smile:

i´m using the homematic binding with openhab2. My rule works on the first change of my windows state. On the second change there are no reactions.

My rule:
import org.openhab.core.library.types.*

rule "Fenster Wohnzimmer"
when
Item WZ_Fenster_State changed
then
logInfo(“heizung-wohnzimmer”, “Status verändert”)
if(WZ_Fenster_State.state == OPEN) {
WZ_Heizung_Manu.sendCommand(5.0)
logInfo(“heizung-wohnzimmer”, "Fenster ist auf - Manu-Modus aktiviert " + WZ_Heizung_SetTemp.state)
} else {
WZ_Heizung_Auto.sendCommand(ON)
logInfo(“heizung-wohnzimmer”, “Fenster ist zu - Auto-Modus aktiviert”)
}
end

Is there a syntax error?

At the first sight i do not see any errors. Maybe the command for the Auto function is not right.

But why are you are using a rule? You can bind the window contact directly to the thermostat. So the functionality is still there if openHAB fails.

Thomas

I want to use openhab for this function :slight_smile:

My Log:

18:35:20.380 [INFO ] [marthome.event.ItemStateChangedEvent] - WZ_Fenster_State changed from CLOSED to OPEN
18:35:20.381 [INFO ] [ome.event.GroupItemStateChangedEvent] - gFenster changed from CLOSED to UNDEF through WZ_Fenster_State
18:35:20.384 [INFO ] [home.model.script.heizung-wohnzimmer] - Status ver?ndert
18:35:20.386 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘WZ_Heizung_Manu’ received command 5.0
18:35:20.389 [INFO ] [home.model.script.heizung-wohnzimmer] - Fenster ist auf - Manu-Modus aktiviert 21.00
18:35:22.636 [INFO ] [ome.event.GroupItemStateChangedEvent] - gFenster changed from UNDEF to CLOSED through WZ_Fenster_State
18:35:22.637 [INFO ] [marthome.event.ItemStateChangedEvent] - WZ_Fenster_State changed from OPEN to CLOSED
18:35:22.643 [INFO ] [home.model.script.heizung-wohnzimmer] - Status ver?ndert
18:35:22.648 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘WZ_Heizung_Auto’ received command ON
18:35:22.676 [INFO ] [home.model.script.heizung-wohnzimmer] - Fenster ist zu - Auto-Modus aktiviert
18:35:22.679 [INFO ] [marthome.event.ItemStateChangedEvent] - WZ_Heizung_Auto changed from OFF to ON
18:35:25.296 [INFO ] [marthome.event.ItemStateChangedEvent] - WZ_Heizung_Auto changed from ON to OFF

So the Auto mode switches to ON and after 3 seconds to OFF again. The Question is why? Doe the thermostat goes into Boost mode?

Somewhere in openHAb or Homegear forum there is a long diskussion about the controls

Thomas

I dont know =(

I set “forceUpdate=true” on openhab1. Maybe this is the problem ?

Had the same in OH 1, but have not migrated to OH 2 at the Moment. So that should be not the problem.

Did you restat OH completely, somethime that works for me.

Thomas

Yes - after a OH restart it works on first change - the second change will not work =(

First Change:
18:52:56.479 [INFO ] [ome.event.GroupItemStateChangedEvent] - gFenster changed from CLOSED to UNDEF through WZ_Fenster_State
18:52:56.480 [INFO ] [marthome.event.ItemStateChangedEvent] - WZ_Fenster_State changed from CLOSED to OPEN
18:52:57.138 [INFO ] [home.model.script.heizung-wohnzimmer] - Status ver?ndert
18:52:57.158 [INFO ] [home.model.script.heizung-wohnzimmer] - Fenster ist auf - Manu-Modus aktiviert 21.00
18:52:57.754 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘WZ_Heizung_Manu’ received command 5.0
18:52:57.756 [INFO ] [marthome.event.ItemStateChangedEvent] - WZ_Heizung_Manu changed from NULL to 5.0
18:52:57.758 [INFO ] [marthome.event.ItemStateChangedEvent] - WZ_Heizung_RSSI changed from -36 to -37
18:52:57.761 [INFO ] [marthome.event.ItemStateChangedEvent] - WZ_Heizung_Mode changed from AUTO-MODE to MANU-MODE
18:52:57.762 [INFO ] [ome.event.GroupItemStateChangedEvent] - gHeatMode changed from AUTO-MODE to UNDEF through WZ_Heizung_Mode
18:52:57.763 [INFO ] [marthome.event.ItemStateChangedEvent] - WZ_Heizung_SetTemp changed from 21.00 to 5.00
18:52:57.763 [INFO ] [ome.event.GroupItemStateChangedEvent] - gHeatSet changed from 18.33 to 13.00 through WZ_Heizung_SetTemp
18:52:58.962 [INFO ] [ome.event.GroupItemStateChangedEvent] - gFenster changed from UNDEF to CLOSED through WZ_Fenster_State
18:52:58.963 [INFO ] [marthome.event.ItemStateChangedEvent] - WZ_Fenster_State changed from OPEN to CLOSED
18:52:58.977 [INFO ] [home.model.script.heizung-wohnzimmer] - Status ver?ndert
18:52:58.983 [INFO ] [marthome.event.ItemStateChangedEvent] - WZ_Heizung_Auto changed from NULL to ON
18:52:58.985 [INFO ] [home.model.script.heizung-wohnzimmer] - Fenster ist zu - Auto-Modus aktiviert
18:52:59.559 [INFO ] [ome.event.GroupItemStateChangedEvent] - gHeatMode changed from UNDEF to AUTO-MODE through WZ_Heizung_Mode
18:52:59.560 [INFO ] [marthome.event.ItemStateChangedEvent] - WZ_Heizung_Mode changed from MANU-MODE to AUTO-MODE
18:52:59.563 [INFO ] [marthome.event.ItemStateChangedEvent] - WZ_Heizung_SetTemp changed from 5.00 to 21.00
18:52:59.564 [INFO ] [ome.event.GroupItemStateChangedEvent] - gHeatSet changed from 13.00 to 18.33 through WZ_Heizung_SetTemp
18:52:59.586 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘WZ_Heizung_Auto’ received command ON

Second Change:
18:53:00.468 [INFO ] [ome.event.GroupItemStateChangedEvent] - gFenster changed from CLOSED to UNDEF through WZ_Fenster_State
18:53:00.469 [INFO ] [marthome.event.ItemStateChangedEvent] - WZ_Fenster_State changed from CLOSED to OPEN
18:53:00.478 [INFO ] [home.model.script.heizung-wohnzimmer] - Status ver?ndert
18:53:00.484 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘WZ_Heizung_Manu’ received command 5.0
18:53:00.487 [INFO ] [home.model.script.heizung-wohnzimmer] - Fenster ist auf - Manu-Modus aktiviert 21.00
18:53:01.587 [INFO ] [marthome.event.ItemStateChangedEvent] - WZ_Heizung_Auto changed from ON to OFF
18:53:03.961 [INFO ] [ome.event.GroupItemStateChangedEvent] - gFenster changed from UNDEF to CLOSED through WZ_Fenster_State
18:53:03.963 [INFO ] [marthome.event.ItemStateChangedEvent] - WZ_Fenster_State changed from OPEN to CLOSED
18:53:03.971 [INFO ] [home.model.script.heizung-wohnzimmer] - Status ver?ndert
18:53:03.974 [INFO ] [marthome.event.ItemStateChangedEvent] - WZ_Heizung_Auto changed from OFF to ON
18:53:03.975 [INFO ] [home.model.script.heizung-wohnzimmer] - Fenster ist zu - Auto-Modus aktiviert
18:53:04.579 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘WZ_Heizung_Auto’ received command ON
18:53:06.581 [INFO ] [marthome.event.ItemStateChangedEvent] - WZ_Heizung_Auto changed from ON to OFF
18:53:10.655 [INFO ] [marthome.event.ItemStateChangedEvent] - BD_Heizung_ActTemp changed from 17.70 to 17.80
18:53:10.659 [INFO ] [ome.event.GroupItemStateChangedEvent] - gHeatAct changed from 19.33 to 19.37 through BD_Heizung_ActTemp

This option is also availabel in the OH 2 binding. You can set forceUpdate in thing editor (Paper UI) for each channel.
In .items files it is currently not possible, but this seems to be in work.

I get a “ERROR: 409 - Conflict” error when i want to enable force =(

19:34:43.145 [INFO ] [ome.io.rest.core.thing.ThingResource] - Received HTTP PUT request for update at ‘things/homematic:HG-HM-CC-RT-DN:ccu:XXX’ for an unmanaged thing ‘homematic:HG-HM-CC-RT-DN:ccu:XXXX’.

That’s because you manually defined the item in a text file. Remove that, add it again through PaperUI and you are able to set all available options …

I want to manage all in text files. Then i musst wait until this feature is implemented =(

Is there a another idea to fix my problem? =(

No, because of

You cannot use an item in a text file and try at the same time updating it with PaperUI.
You can have a mix of PaperUI defined items and manually defined items, but not on the SAME item.

Yeah, but i want to find an soulution for my main problem (see first post). :slight_smile:

maybe you can ask in the homegear forum why your thermostat goes after the switch to auto 3 seconds later back. I think that is the problem.

Thomas

Hello :slight_smile:
i’m done with the update of homegear and openhab (nightly). The error is still extend. I test my script without Automode… only WZ_Heizung_Manu. This is working =|

import org.openhab.core.library.types.*

rule "Fenster Wohnzimmer"
when
Item WZ_Fenster_State changed
then
logInfo(“heizung-wohnzimmer”, “Status verändert”)
if(WZ_Fenster_State.state == OPEN) {
WZ_Heizung_Manu.sendCommand(5.0)
logInfo(“heizung-wohnzimmer”, "Fenster ist auf - Manu-Modus aktiviert " + WZ_Heizung_SetTemp.state)
}
if (WZ_Fenster_State.state == CLOSED) {
WZ_Heizung_Manu.sendCommand(10.0)
logInfo(“heizung-wohnzimmer”, “Fenster ist zu - Auto-Modus aktiviert”)
}
end