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 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 ]

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" }

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?

I was able to get it to work by using some rules as described in this post:

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