projects
/
mqtt-homehub
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
575774b
)
example for sonoff
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 28 Jul 2019 11:51:54 +0000
(13:51 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 28 Jul 2019 11:51:54 +0000
(13:51 +0200)
sonoff.sh
[new file with mode: 0755]
patch
|
blob
diff --git a/sonoff.sh
b/sonoff.sh
new file mode 100755
(executable)
index 0000000..
c73d4f6
--- /dev/null
+++ b/
sonoff.sh
@@ -0,0
+1,5
@@
+#!/bin/sh -xe
+test -z "$1" && echo "usage: $0 light|ledstate on|off" && exit 1
+device=`basename $0 | cut -d. -f1`
+mosquitto_pub -h rpi2 -t "cmnd/$device/$1" -m "$2"
+