aboutsummaryrefslogtreecommitdiff
path: root/utils/mqttled/files
diff options
context:
space:
mode:
authorTom Grime <tom.grime@gmail.com>2022-06-02 10:22:11 +0100
committerRosen Penev <rosenp@gmail.com>2022-06-09 12:31:24 -0700
commitf8b97f7962a8f4b271751c511750d5aef28a1236 (patch)
treee35a338c32b9d76244dfc0610cad5516ba288f2c /utils/mqttled/files
parentdb8205e5458e27152b02c57609f2224586843271 (diff)
mqttled: add new package
Signed-off-by: Tom Grime <tom.grime@gmail.com>
Diffstat (limited to 'utils/mqttled/files')
-rw-r--r--utils/mqttled/files/mqttled.config34
-rw-r--r--utils/mqttled/files/mqttled.init16
2 files changed, 50 insertions, 0 deletions
diff --git a/utils/mqttled/files/mqttled.config b/utils/mqttled/files/mqttled.config
new file mode 100644
index 000000000..e3c793a86
--- /dev/null
+++ b/utils/mqttled/files/mqttled.config
@@ -0,0 +1,34 @@
+config mqtt 'mqtt'
+ #MQTT Broker Address
+ option host '192.168.1.1'
+ option port '1883'
+ #May work without this, should bind to all interfaces. Needs to be an interface matching in /etc/config/network
+ option interface 'lan'
+ option username ''
+ option password ''
+ #Not tested
+ option tls '0'
+ option cert ''
+ option discovery 'homeassistant'
+ #Set your topic here: e.g. OpenWRTleds/CustomDevice/led1
+ option basetopic 'OpenWRTleds'
+ option subtopic 'CustomDevice'
+ #Reported in the 'device' page in Home Assistant
+ option model 'OpenWRT Device'
+
+config leds 'leds'
+ #Setting this to 1 will ignore any includes
+ option includeall '1'
+ #excluded LEDs will allways be supressed
+ list exclude 'mt76-phy0'
+ list exclude 'rt2800soc-phy1::assoc'
+ list exclude 'rt2800soc-phy1::quality'
+ list exclude 'rt2800soc-phy1::radio'
+ #list include 'blue:internet'
+
+config trigger 'triggers'
+ #Only triggers listed here will be presented to HA as 'effects'
+ list triggers 'none'
+ list triggers 'default-on'
+ list triggers 'heartbeat'
+ list triggers 'timer'
diff --git a/utils/mqttled/files/mqttled.init b/utils/mqttled/files/mqttled.init
new file mode 100644
index 000000000..3b785bb31
--- /dev/null
+++ b/utils/mqttled/files/mqttled.init
@@ -0,0 +1,16 @@
+#!/bin/sh /etc/rc.common
+
+START=99
+STOP=99
+
+USE_PROCD=1
+
+PROG=/usr/bin/mqttled
+
+start_service() {
+ procd_open_instance
+ procd_set_param command "$PROG"
+ procd_set_param stdout 1
+ procd_set_param stderr 1
+ procd_close_instance
+}