projects
/
mqtt-homehub
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b5deb28
)
request status from all tasmota firmwares
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 28 Jul 2019 14:15:02 +0000
(16:15 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 28 Jul 2019 14:15:02 +0000
(16:15 +0200)
mqtt-tasmota.sh
[new file with mode: 0755]
patch
|
blob
diff --git a/mqtt-tasmota.sh
b/mqtt-tasmota.sh
new file mode 100755
(executable)
index 0000000..
598394f
--- /dev/null
+++ b/
mqtt-tasmota.sh
@@ -0,0
+1,13
@@
+#!/bin/sh -xe
+
+mqtt="-h rpi2"
+
+cmnd=$1
+test -z "$cmnd" && cmnd="status"
+
+trap "trap - TERM && kill -- -$$" INT TERM EXIT
+
+mosquitto_sub $mqtt -t "stat/#" -v | tee /dev/shm/mqtt.$cmnd &
+
+mosquitto_pub $mqtt -t "cmnd/sonoffs/$cmnd" -m 0
+sleep 1