Add sending device to logs

Hello,

in my environment multiple ways exist to control devices and items. For example, it’s possible to power the coffee machine using a dedicated button, via browser or openhab app on iPhones. Same for other items like blinds and so on.

Is it possible to extend the global log openhab.log or events.log and add the sending device? I would like to know which device was used for example turn on the kitchen light.
My main focus is to get this information for the iPhones.

Thanks.

KR
Clemens

This is indeed a very valid question I’ve been asking myself also without figuring any obvious way to do it. I’d like to know wether a given device has been turned off manually or through an action in a rule and found no great answer.

1 Like

On a lower item level, assign all triggering instances an own item, and then group them. Your rule should then only listen to the group status. The logs will then tell you which item changed the status of the group. You need to be careful to define the group correctly, but usually should be “OR”.

It’s not easy and pretty much impossible if the device doesn’t immediately report that it changed state when you manually flip the switch. You will find that only the minority of devices actually do so.

If this device is one that immediately reports its status see Design Pattern: Manual Trigger Detection.

Thomas’ approach is a special case of the Proxy Items approach only it uses a Group instead of a proxy Item.

KR curious what is the reason for knowing such info? For example: I was looking for something like this once also as I thought I was having some type of “ghost” switching. Knowing what if the many triggers caused the event could have proved whether I had bad hardware or bad software.

What is your reason, I ask because maybe that will help figure out a way to achieve what you want.

Well, the reason is primarily for troubleshooting. I would like to know the device on which a button was pressed. It would be nice to have to include also buttons (z-wave button in my case), but in general my main goal is to see the hostname/ip/… of the iphone or browser a button was pressed on.

You’ve maybe seen it - it sometimes happen that a button/switch in openhab app for ios was pressed mistakenly or unconsciously, while opening the app.

1 Like

That information is simply not available and won’t becomeb available in the near future. Perhaps once the
authentication and authorization changes make it (looking like 2.4) something like this could be started.