Last active
December 3, 2016 15:20
-
-
Save jscrane/ad2ce5e03083e73fb8eeaf46a7d9424c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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