[SOLVED] Changed event on contact item not triggered

I’m using OH 2 on a linux server.
For displaying the state of my garage door I have installed two homemeaticip window contacts. So once the door moves down the upper contact state changes to open and when completely shut the downer one changes to closed.


To display this in my habpanel I use a number item Scene_Garage[0=Closed, 1= Open]
As long the door get triggered by OH the display shows the correct state (open, closed)
As soon I trigger the door movement by the switch inside the garage or a radio control key, the diplaying scene is not correct.
I try to solve it by a rule for each contact with no success.
here is my config

Switch GarageOben “Garage offen” {channel=“homematic:HmIP- SCI:XXXXXXX:XXXXXXXX:1#STATE”}
Switch GarageUnten “Garage geschlossen” {channel=“homematic:HmIP-SCI:XXXXXXX:XXXXXXXX:1#STATE”}
Number Scene_Garage “Garage”

rule “Garage Door opend”
when Item GarageOben changed
then
logInfo(“Logger”,"GarageOffen: " + triggeringItem.state)
if(GarageUnten.state == CLOSED)
{
logInfo(“Garagentür”, “=> ist geöffnet”)
Scene_Garage.postUpdate(1)
}
end

rule “Garage Door closed”
when Item GarageUnten changed
then
logInfo(“Logger”,"GarageZu: " + triggeringItem.state)
if(GarageOben.state == CLOSED)
{
logInfo(“Garagentür”, “=> ist geschlossen”)
Scene_Garage.postUpdate(0)
}
end

The events are not triggered and the response body via rest api is null?? Seems that the binding is ot correct
Any ideas what I can do?
thanks

Don’t worry about rules until you get the correct things happening in events.log

Does the Homematic binding allow for you to link contact devices to OH Switch type Items? (as opposed to Contact type Items)

At the bottom of the binding doc, it describes how to set debug logging on so that you can see what happens as you open/close the door

ok, thanks
thrange thing there is no output of debug or trace level in karaff when I enable the DEBUG or TRACE loglevel. Just the normal info output

What happens if you change other devices linked via this binding?

same here, no debug output in console just the standard info level

You need to look into openhab.log, I don’t think this supposed to log to the console.

my first time to work with the logs, so I found this in the help

tail -f /var/log/openhab2/openhab.log -f /var/log/openhab2/events.log

shows no output of debug level in the logs for any homematic devices, so I switch the log for hue binding to debug level

log:set DEBUG org.openhab.binding.hue
same here, no output of the debug level, just the info level all the time

Yes, this is why I said to look into openhab.log - in the same folder. events.log is useful for looking at e.g. Item changes, openhab.log is useful for looking at software reports. If you get nothing, your logging is broken. But you seem to say there is something - “info”, whatever that may be.
May we see a sample of what you are looking at?

Could it be that the type of your Homematic-Items should be String? As mine
are String-Items:

String    HmIP_SWDO_I_E754_1STATE                   "Haustür Status[%s]"                                                                  <frontdoor>         (gHomeMatic,gHaustur)                           {channel="homematic:HmIP-SWDO-I:3014F711A0001F98A9AABCAF:00109A498AE754:1#STATE"}

If so, your Rule should look like:

rule “Garage Door opend”
when Item GarageOben changed
then
logInfo(“Logger”,"GarageOffen: " + triggeringItem.state)
if(GarageUnten.state == "CLOSED")
{
logInfo(“Garagentür”, “=> ist geöffnet”)
Scene_Garage.postUpdate(1)
}
end

Do you have the frontail logger installed ?

the type of item for contact needs to be a string type, the changed events are triggered now
I have not installed the frontail logger, i use log:tail in the karaff console, how can I do install the logger?

with tail -f /var/log/openhab2/openhab.log the log is displayed in the console.
here is the info of my homematic device after I have changed the type of item to string like fibu-freak adviced. Debug level for homematic binding is still activ, I expected some more details though ??

2019-09-04 15:09:21.982 [INFO ] [clipse.smarthome.model.script.Logger] - Garagentortaster: 1
2019-09-04 15:09:22.025 [INFO ] [se.smarthome.model.script.Garagentür] - => öffnen…
2019-09-04 15:09:24.065 [INFO ] [clipse.smarthome.model.script.Logger] - GarageZu: OPEN
2019-09-04 15:09:26.349 [INFO ] [clipse.smarthome.model.script.Logger] - GarageZu: CLOSED
2019-09-04 15:09:26.655 [INFO ] [clipse.smarthome.model.script.Logger] - GarageZu: OPEN
2019-09-04 15:09:43.492 [INFO ] [clipse.smarthome.model.script.Logger] - GarageOffen: CLOSED
2019-09-04 15:09:43.724 [INFO ] [clipse.smarthome.model.script.Logger] - GarageOffen: OPEN
2019-09-04 15:09:45.212 [INFO ] [clipse.smarthome.model.script.Logger] - GarageOffen: CLOSED

Sorry, don’t know. Maybe you can google it in the community, as in my case, it was installed when I set up the distro.

But you can also do it in this way:

tail -F /var/log/openhab2/openhab.log /var/log/openhab2/events.log

just from the shell-console


as a workaround. 'til you found a way to integrate “frontail”. Maybe @rossko57 knows a solution.
How have you installed "openHAB"and what is your hardware ?

The “more Info” about DEBUG you should see in the openhab.log :wink:

I don’t know anything about frontail. I’m on Windows and look directly at log files.

Anyway, it seems the rules are working correctly?

Just found this:

If you’re using the configuration tool “openhabian-config” and select " 20 Optional Components"

thanks @rossko57, @fibu-freak
the rules are working now.
I found this in the openHabian Help. But before I’ll give it a try, I need a backup.
Cheers

Does the Homematic documentation need more detail, so other people can avoid this problem i.e. what channel types are provided?

Would an enhancement request to the binding be sensible. to allow contact devices to link to OH Contact type Items?

I’m not very experienced. What I can say is that it was not very hard to install the Bridge and the Things for the Homematic-Binding (ccu3) via Autodiscovery.

I have to say that it doesn’t work (for me) to create the Bridge and the Things with Text-Files in my OH2.5-M2.
After creating Bridge/Thing(Autodiscovery) you are able to create all the items with Channels for your special Homematic-Device via VSCode into a . items file. And I can say that’s a lot more than one can see in PaperUI.

i.e. this is what PaperUI shows:

and if you then using VSCode to create all the items for this device by right-click on the thing and use “create items by channel”
grafik

and the result will look like:

Switch   HMIPSWDOI00109A498AE7540UPDATEPENDING            "Update pending"             {channel="homematic:HmIP-SWDO-I:3014F711A0001F98A9AABCAF:00109A498AE754:0#UPDATE_PENDING"}
Number   HMIPSWDOI00109A498AE7540ERRORCODE                "Error code"                 {channel="homematic:HmIP-SWDO-I:3014F711A0001F98A9AABCAF:00109A498AE754:0#ERROR_CODE"}
Number   HMIPSWDOI00109A498AE7540RSSI                     "Rssi"                       {channel="homematic:HmIP-SWDO-I:3014F711A0001F98A9AABCAF:00109A498AE754:0#RSSI"}
Switch   HMIPSWDOI00109A498AE7540DELETEDEVICE             "Delete device"              {channel="homematic:HmIP-SWDO-I:3014F711A0001F98A9AABCAF:00109A498AE754:0#DELETE_DEVICE"}
String   HMIPSWDOI00109A498AE7540BATTERYTYPE              "Battery type"               {channel="homematic:HmIP-SWDO-I:3014F711A0001F98A9AABCAF:00109A498AE754:0#BATTERY_TYPE"}
String   HMIPSWDOI00109A498AE7540FIRMWARE                 "Firmware"                   {channel="homematic:HmIP-SWDO-I:3014F711A0001F98A9AABCAF:00109A498AE754:0#FIRMWARE"}
Number   HMIPSWDOI00109A498AE7540SIGNALSTRENGTH           "Signalstärke"               {channel="homematic:HmIP-SWDO-I:3014F711A0001F98A9AABCAF:00109A498AE754:0#SIGNAL_STRENGTH"}
Switch   HMIPSWDOI00109A498AE7540DUTYCYCLE                "Duty cycle"                 {channel="homematic:HmIP-SWDO-I:3014F711A0001F98A9AABCAF:00109A498AE754:0#DUTY_CYCLE"}
Number   HMIPSWDOI00109A498AE7540OPERATINGVOLTAGE         "Operating voltage"          {channel="homematic:HmIP-SWDO-I:3014F711A0001F98A9AABCAF:00109A498AE754:0#OPERATING_VOLTAGE"}
String   HMIPSWDOI00109A498AE7540DELETEDEVICEMODE         "Delete device mode"         {channel="homematic:HmIP-SWDO-I:3014F711A0001F98A9AABCAF:00109A498AE754:0#DELETE_DEVICE_MODE"}
Switch   HMIPSWDOI00109A498AE7540CONFIGPENDING            "Config pending"             {channel="homematic:HmIP-SWDO-I:3014F711A0001F98A9AABCAF:00109A498AE754:0#CONFIG_PENDING"}
Switch   HMIPSWDOI00109A498AE7540SABOTAGE                 "Sabotage"                   {channel="homematic:HmIP-SWDO-I:3014F711A0001F98A9AABCAF:00109A498AE754:0#SABOTAGE"}
String   HMIPSWDOI00109A498AE7540OPERATINGVOLTAGESTATUS   "Operating voltage status"   {channel="homematic:HmIP-SWDO-I:3014F711A0001F98A9AABCAF:00109A498AE754:0#OPERATING_VOLTAGE_STATUS"}
Switch   HMIPSWDOI00109A498AE7540LOWBAT                   "Niedriger batteriestatus"   {channel="homematic:HmIP-SWDO-I:3014F711A0001F98A9AABCAF:00109A498AE754:0#LOW_BAT"}
Number   HMIPSWDOI00109A498AE7540RSSIDEVICE               "Rssi device"                {channel="homematic:HmIP-SWDO-I:3014F711A0001F98A9AABCAF:00109A498AE754:0#RSSI_DEVICE"}
Number   HMIPSWDOI00109A498AE7540RSSIPEER                 "Rssi peer"                  {channel="homematic:HmIP-SWDO-I:3014F711A0001F98A9AABCAF:00109A498AE754:0#RSSI_PEER"}
Switch   HMIPSWDOI00109A498AE7540INSTALLTEST              "Install test"               {channel="homematic:HmIP-SWDO-I:3014F711A0001F98A9AABCAF:00109A498AE754:0#INSTALL_TEST"}
Switch   HMIPSWDOI00109A498AE7540UNREACH                  "Unreach"                    {channel="homematic:HmIP-SWDO-I:3014F711A0001F98A9AABCAF:00109A498AE754:0#UNREACH"}
String   HMIPSWDOI00109A498AE7541STATE                    "State"                      {channel="homematic:HmIP-SWDO-I:3014F711A0001F98A9AABCAF:00109A498AE754:1#STATE"}

so all possible channels with their items a created automatically by the Editor(VSC) in parts of a second.

And then you can pimp it up

String    HmIP_SWDO_I_E754_1STATE                   "Haustür Status[%s]"                                                                  <frontdoor>         (gHomeMatic,gHaustur)                           {channel="homematic:HmIP-SWDO-I:3014F711A0001F98A9AABCAF:00109A498AE754:1#STATE"}

as you like it.

extending the supported things and items in the example part of the homematic binding documentation would be great.

right-click on the thing and use “create items by channel”

do not have this function in VSCode, do I need an addon?:thinking:

Here is a link to the github page for the Homematic binding where you can submit an issue with your suggestions since only someone like yourself who uses the binding would know the types of additions need made
https://github.com/openhab/openhab2-addons/tree/master/bundles/org.openhab.binding.homematic
you will need a git account
thanks

1 Like