Make the clientid configurable

This commit is contained in:
RSd
2021-06-03 14:47:59 +02:00
parent 5ba1072099
commit 037ce5f37b
4 changed files with 8 additions and 4 deletions
+2 -1
View File
@@ -8,13 +8,14 @@ pushMQTTData () {
MQTT_DEVICENAME=`cat /etc/inverter/mqtt.json | jq '.devicename' -r`
MQTT_USERNAME=`cat /etc/inverter/mqtt.json | jq '.username' -r`
MQTT_PASSWORD=`cat /etc/inverter/mqtt.json | jq '.password' -r`
MQTT_CLIENTID=`cat /etc/inverter/mqtt.json | jq '.clientid' -r`
mosquitto_pub \
-h $MQTT_SERVER \
-p $MQTT_PORT \
-u "$MQTT_USERNAME" \
-P "$MQTT_PASSWORD" \
-i "voltronic_8a39d0c8faf1" \
-i $MQTT_CLIENTID \
-t "$MQTT_TOPIC/sensor/"$MQTT_DEVICENAME"_$1" \
-m "$2"