Trigger Exec Binding switch with HUE Emulation [SOLVED]


(Alex) #1

I have the following exec binding which works quite well to switch on/off my NAS via the BasicUI:

Thing:
Thing exec:command:device-nas-control [ command="/home/openhab/bin/device-nas %2$s", interval=0, autorun=true ]
Thing exec:command:device-nas-status [ command="/home/openhab/bin/device-nas status", interval=60, timeout=5 ]

Item:
String network_device_nas_switch "NAS" <network> (group_location_livingroom) [ "Switchable" ] { channel="exec:command:device-nas-control:input", channel="exec:command:device-nas-status:output", autoupdate="false" }

Sitemap:
Switch item=network_device_nas_switch mappings=[ "ON"="ON", "OFF"="OFF" ]

I would now like to trigger this with my Amazon Echo, using the Hue Emulation service. Unfortunately my Echo does not see the device, the discovery just fails. I can see Amazon trying to discover devices in the logs but it just cannot detect my NAS switchable. The /api/discovery.xml lists the service with all "(null)" values.

Any idea how I could get this to work?

EDIT:
I was able to get it to work by using some rules as described in this post: https://community.openhab.org/t/exec-2-0-updated-new-functionalities-to-address-your-concerns/20146/9?u=temar


Simple On/Off Switch with Exec-Command
Openhab 2 exec binding 2.0 configuration
433 Mhz Transmitter / rcswitch-pi