From: Dobrica Pavlinusic Date: Sun, 28 Jul 2019 14:15:02 +0000 (+0200) Subject: request status from all tasmota firmwares X-Git-Url: http://git.rot13.org/?p=mqtt-homehub;a=commitdiff_plain;h=91427e5ebd318d6d1ce651ddda661a491fedd13e request status from all tasmota firmwares --- diff --git a/mqtt-tasmota.sh b/mqtt-tasmota.sh new file mode 100755 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