forked from JsBergbau/MiTemperature2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
sendToMQTT
14 lines (11 loc) · 654 Bytes
/
sendToMQTT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
#This script is provided by Chiunownow https://github.com/Chiunownow
#Thank you very much for providing this script
#This script is
#use e.g with that script: MySensor.sh
#!/bin/bash
#DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
#$DIR/LYWSD03MMC.py -d <device> -b 1000 -r --debounce --skipidentical 50 --name MySensor --callback sendToMQTT
mosquitto_pub -h vm -t "MiTemperature2/$2/temp" -u mqtt -P mqtt -i "mibridge" -m "$3"
mosquitto_pub -h vm -t "MiTemperature2/$2/humidity" -u mqtt -P mqtt -i "mibridge" -m "$4"
mosquitto_pub -h vm -t "MiTemperature2/$2/batterylevel" -u mqtt -P mqtt -i "mibridge" -m "$5"