Exec:command stopped working

A couple of months ago I wrote a script for presence detection and created a thing to run it:

Thing exec:command:ishome [command="/usr/local/bin/ishome.sh", interval=60, timeout=30]

I also created an item:

String IsHome {channel=“exec:command:ishome:output”}

For a good while this worked well as you can see from my logs:

events.log:2018-03-14 07:50:39.930 [vent.ItemStateChangedEvent] - IsHome changed from true to false
events.log:2018-03-14 19:11:53.735 [vent.ItemStateChangedEvent] - IsHome changed from false to true
events.log:2018-03-15 07:43:33.174 [vent.ItemStateChangedEvent] - IsHome changed from true to false
events.log:2018-03-15 19:04:15.382 [vent.ItemStateChangedEvent] - IsHome changed from false to true
events.log:2018-03-16 03:51:25.049 [vent.ItemStateChangedEvent] - IsHome changed from true to false
events.log:2018-03-16 19:00:24.720 [vent.ItemStateChangedEvent] - IsHome changed from false to true
events.log:2018-03-16 20:03:07.100 [vent.ItemStateChangedEvent] - IsHome changed from true to false
events.log:2018-03-16 21:11:28.722 [vent.ItemStateChangedEvent] - IsHome changed from false to true

Then things when awry:

vents.log:2018-03-16 22:10:10.415 [hingStatusInfoChangedEvent] - ‘exec:commandishome’ changed from UNINITIALIZED to INITIALIZING
events.log:2018-03-16 22:10:10.438 [hingStatusInfoChangedEvent] - ‘exec:commandishome’ changed from INITIALIZING to ONLINE
events.log:2018-03-16 22:10:15.361 [vent.ItemStateChangedEvent] - IsHome changed from NULL to true
events.log:2018-03-16 22:10:27.347 [hingStatusInfoChangedEvent] - ‘exec:commandishome’ changed from ONLINE to UNINITIALIZED
events.log:2018-03-16 22:10:27.366 [hingStatusInfoChangedEvent] - ‘exec:commandishome’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
events.log:2018-03-23 15:23:31.482 [.ItemChannelLinkAddedEvent] - Link ‘IsHome-exec:command:ishome:output’ has been added.

I did update my server on 3/13 and again on 3/23 with apt-get update and apt-get dist-upgrade.

Have I found a bug, or just had a brain cramp?


  • Platform information:
    • Hardware: CPUArchitecture/RAM/storage Raspberry Pi
    • OS: what OS is used and which version Openhabian
    • Java Runtime Environment: which java platform is used and what version
    • openHAB version:
  • Issue of the topic: please be detailed explaining your issue
  • Please post configurations (if applicable):
    • Items configuration related to the issue
    • Sitemap configuration related to the issue
    • Rules code related to the issue
    • Services configuration related to the issue
  • If logs where generated please post these here using code fences:

Have you tried removing the binding, restart OH and install teh binding again. Sometimes that refreshes things a bit.

At your suggestion I tried it. I copied the thing file to /var/tmp, restarted openhab, copied the thing file back to /etc/openhab2/things and triggered several changes over the course of an hour. The only thing I see in my events log is:

2018-04-22 09:12:30.925 [.ItemChannelLinkAddedEvent] - Link ‘IsHome-exec:command:ishome:output’ has been added.


You ony removed the thing. Did you uninstall the binding altogether?

Ahh, I’m still pretty new to Openhab so I’m not an expert by any stretch of the imagination so I was a little uncertain what you meant by a binding. I went into my configuration only to find that I didn’t have an exec binding. Clearly at one point I did because this had been working, then failed. I added the binding and now it seems to work.

So, the next question is why did I lose the binding?


I am not sure, in my own experience, It has happened before, I added a binding and another binding or two disappeared.

I found something similar with the astro2 bindings. I could never get them to work and the binding itself would vanish. On one frustrated day I installed the astro1 bindings and it’s been working fine since.

Thanks for the assist, I probably would never have thought about the binding on my own.