I installed the exec binding for openhab2 but I cannot even get the simplest example to work.
I want to check if my Amazon Echo is online and as the Echo is not pingable and does not have any open ports I cannot use the network binding. Also I do have a DHCP server running on the same machine which is why I cannot use DHCP discovery. So I wrote a script which uses ARP to detect if the Amazon Echo is online. That script runs just fine with the same user account that is used to launch OpenHAB:
openhab@cubietruck:~$ /home/openhab/bin/device-online echo.home.lan
ON
I added a âThingâ entry to my .things file:
Thing exec:command:device-online-echo "Echo" [ command="/home/openhab/bin/device-online echo.home.lan", interval=60, timeout=5 ]
I added an âItemâ entry to my .items file:
String network_device_echo_online "Online" <network> (group_location_livingroom) { channel="exec:command:device-online-echo:output" }
I added a âSitemapâ entry to my .sitemap file:
Text item=network_device_echo_online label="Echo"
I would expect that the entry in my sitemap would now just display âONâ as this is the output of the script. Unfortunately it just displays âNULLâ instead. In the log file I donât see any exceptions but I just get some weird warnings every minute:
2017-02-07 20:46:07.005 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type REGEX
2017-02-07 20:46:07.016 [WARN ] [hab.binding.exec.handler.ExecHandler] - Couldnât transform response because transformationService of type âREGEXâ is unavailable
As these warnings are repeated every minute, I assume they are generated by the Exec binding. Can anybody tell me how to fix this? I tried various transformations I found on this forum but none of them worked.