Skip to content

Instantly share code, notes, and snippets.

@jscrane
Last active December 3, 2016 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jscrane/ad2ce5e03083e73fb8eeaf46a7d9424c to your computer and use it in GitHub Desktop.
Save jscrane/ad2ce5e03083e73fb8eeaf46a7d9424c to your computer and use it in GitHub Desktop.
#!/bin/bash
PATH=/usr/local/bin:$PATH
WEMO=wemo
HOST=iot
CLIENT=wemo_mqtt
STAT=stat/wemo/power
CMND=cmnd/wemo/power
. wemo_functions.sh
# https://github.com/shirou/mqttcli
mqttcli pub --host $HOST -t $STAT -m $(wemo_get $WEMO)
mosquitto_sub -h $HOST -i $CLIENT -t $CMND | while read c; do
echo $c
wemo_set $WEMO $c
mqttcli pub --host $HOST -t $STAT -m $c
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment