File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ version: "1.0.1"
44slug : " orb_homeassistant"
55init : false
66host_network : true
7- image : " orbforge/orb"
7+ image : " orbforge/orb-ha "
88environment :
99 ORB_DATA_DIR : /data
1010arch :
1414boot : auto
1515services :
1616 - mqtt:need
17+ options :
18+ mqtt_push : false
19+ mqtt_frequency : 5
20+ schema :
21+ mqtt_push : bool
22+ mqtt_frequency : int(1,120)
Original file line number Diff line number Diff line change @@ -6,7 +6,16 @@ echo "Starting MQTT publishing script..."
66date
77
88# Start MQTT publishing in the background
9- /app/mqtt.sh &
9+ CONFIG_PATH=/data/options.json
10+ MQTT_PUSH=$( jq -r ' .mqtt_push // false' $CONFIG_PATH )
11+
12+ if [ " $MQTT_PUSH " == " true" ]; then
13+ echo " MQTT Push is enabled"
14+ /app/mqtt.sh &
15+ else
16+ echo " MQTT Push is disabled"
17+ fi
18+
1019
1120# Now start the original entrypoint or command
1221exec /app/orb sensor
Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ MQTT_PORT=$(echo "$MQTT_INFO" | jq -r '.data.port')
1010MQTT_USER=$( echo " $MQTT_INFO " | jq -r ' .data.username' )
1111MQTT_PASS=$( echo " $MQTT_INFO " | jq -r ' .data.password' )
1212
13+ CONFIG_PATH=/data/options.json
14+ MQTT_PAUSE=$( jq -r ' .mqtt_frequency // 5' $CONFIG_PATH )
15+
1316echo " MQTT Host: $MQTT_HOST "
1417echo " MQTT Port: $MQTT_PORT "
1518echo " MQTT User: $MQTT_USER "
@@ -82,5 +85,5 @@ while true; do
8285 mosquitto_pub -h " $MQTT_HOST " -p " $MQTT_PORT " -u " $MQTT_USER " -P " $MQTT_PASS " \
8386 -t " $STATE_TOPIC " -m " $ORB_OUTPUT " -r
8487
85- sleep 15
88+ sleep " $MQTT_PAUSE "
8689done
Original file line number Diff line number Diff line change 1+ ---
2+ configuration :
3+ mqtt_push :
4+ name : Push Scores to MQTT
5+ description : >-
6+ If set to `true`, the Orb will push scores to the MQTT broker.
7+ mqtt_frequency :
8+ name : MQTT Frequency
9+ description : >-
10+ The frequency in seconds at which the Orb will push scores to the MQTT
11+ broker.
You can’t perform that action at this time.
0 commit comments