Awtrix通过Mqtt接入到HomeKit,然后通过自动化去实现各个时间段不同的亮度,还蛮好用的。然后加了一个App切换的功能,这个主要是因为每次想看时间它都在显示天气,有点强迫症就手动切换一下。
简单分享一下!
NR流如下:
[{“id”:“55bb7c20.d7cbb4”,“type”:“tab”,“label”:“Awtrix”,“disabled”:false,“info”:""},{“id”:“bbeaca80.2a7198”,“type”:“mqtt out”,“z”:“55bb7c20.d7cbb4”,“name”:"",“topic”:“awtrix/settings”,“qos”:“1”,“retain”:"",“broker”:“9c165f5f.29a2e”,“x”:1120,“y”:220,“wires”:[]},{“id”:“d3bf31f9.dba94”,“type”:“homekit-service”,“z”:“55bb7c20.d7cbb4”,“isParent”:true,“bridge”:“97412e70.298a3”,“parentService”:"",“name”:“Awtrix”,“serviceName”:“Lightbulb”,“topic”:"",“filter”:false,“manufacturer”:“Default Manufacturer”,“model”:“Default Model”,“serialNo”:“Default Serial Number”,“firmwareRev”:"",“hardwareRev”:"",“cameraConfigVideoProcessor”:"",“cameraConfigSource”:"",“cameraConfigStillImageSource”:"",“cameraConfigMaxStreams”:"",“cameraConfigMaxWidth”:"",“cameraConfigMaxHeight”:"",“cameraConfigMaxFPS”:"",“cameraConfigMaxBitrate”:"",“cameraConfigVideoCodec”:"",“cameraConfigAudioCodec”:"",“cameraConfigAudio”:false,“cameraConfigPacketSize”:"",“cameraConfigVerticalFlip”:false,“cameraConfigHorizontalFlip”:false,“cameraConfigMapVideo”:"",“cameraConfigMapAudio”:"",“cameraConfigVideoFilter”:"",“cameraConfigAdditionalCommandLine”:"",“cameraConfigDebug”:false,“cameraConfigInterfaceName”:"",“characteristicProperties”:"{“Brightness”:true}",“x”:290,“y”:220,“wires”:[[],[“772a15d3.e3cfbc”]]},{“id”:“772a15d3.e3cfbc”,“type”:“json”,“z”:“55bb7c20.d7cbb4”,“name”:"",“property”:“payload”,“action”:“str”,“pretty”:false,“x”:490,“y”:220,“wires”:[[“bbeaca80.2a7198”,“de1b58d8.71eea8”]]},{“id”:“de1b58d8.71eea8”,“type”:“switch”,“z”:“55bb7c20.d7cbb4”,“name”:"",“property”:“payload”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:"{“On”:true}",“vt”:“str”},{“t”:“eq”,“v”:"{“On”:false}",“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:2,“x”:710,“y”:300,“wires”:[[“4ecdbfec.60f1a”],[“cc05aabe.d73d38”]]},{“id”:“601e8d7f.46fb34”,“type”:“mqtt out”,“z”:“55bb7c20.d7cbb4”,“name”:"",“topic”:“awtrix/basics”,“qos”:“1”,“retain”:"",“broker”:“9c165f5f.29a2e”,“x”:1110,“y”:360,“wires”:[]},{“id”:“4ecdbfec.60f1a”,“type”:“change”,“z”:“55bb7c20.d7cbb4”,“name”:“开LED”,“rules”:[{“t”:“set”,“p”:“payload”,“pt”:“msg”,“to”:"{“power”: true}",“tot”:“str”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:890,“y”:260,“wires”:[[“601e8d7f.46fb34”]]},{“id”:“cc05aabe.d73d38”,“type”:“change”,“z”:“55bb7c20.d7cbb4”,“name”:“关LED”,“rules”:[{“t”:“set”,“p”:“payload”,“pt”:“msg”,“to”:"{“power”: false}",“tot”:“str”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:890,“y”:320,“wires”:[[“601e8d7f.46fb34”]]},{“id”:“542c300a.ccce4”,“type”:“SmartHome-Bot”,“z”:“55bb7c20.d7cbb4”,“name”:“调光灯”,“account”:“93e73956.279268”,“jsonConfig”:“853b2bd3.727338”,“deviceId”:“light1-5f2fba5c48d88d63b29a0793”,“auto”:false,“x”:290,“y”:400,“wires”:[[],[“f2c8f8cf.36ad88”,“b84ebe65.ab3a4”]]},{“id”:“f2c8f8cf.36ad88”,“type”:“json”,“z”:“55bb7c20.d7cbb4”,“name”:"",“property”:“payload”,“action”:“str”,“pretty”:false,“x”:490,“y”:400,“wires”:[[“bbeaca80.2a7198”,“50d8c6e5.730708”]]},{“id”:“8a6c4eb0.994c7”,“type”:“function”,“z”:“55bb7c20.d7cbb4”,“name”:“HomeKit状态反馈数据处理”,“func”:“var input = msg.payload;\nif (input < 101){\n if (input < 1) {\n msg.payload = {\n “On”: false\n }\n }\n else {\n msg.payload = {\n “Brightness”: input,\n “On”: true\n }\n }\n return msg;\n}”,“outputs”:1,“noerr”:0,“x”:840,“y”:520,“wires”:[[“d3bf31f9.dba94”]]},{“id”:“b84ebe65.ab3a4”,“type”:“function”,“z”:“55bb7c20.d7cbb4”,“name”:“HomeKit指令数据处理”,“func”:“var b = context.get(‘b’)||0;\nif(msg.payload.Brightness){\n b = msg.payload.Brightness;\n context.set(‘b’,b);\n msg.payload=b\n}\n\n// Uncomment lines 9 and 20 to prevent looping\n//if (msg.hap.context !== undefined) {\n if(msg.payload.Brightness === 0){\n msg.payload = 0\n }\n if(msg.payload.On === false){\n msg.payload = 0\n }\n if(msg.payload.On === true){\n msg.payload = b\n }\n return msg\n//}”,“outputs”:1,“noerr”:0,“x”:560,“y”:520,“wires”:[[“8a6c4eb0.994c7”]]},{“id”:“50d8c6e5.730708”,“type”:“switch”,“z”:“55bb7c20.d7cbb4”,“name”:"",“property”:“payload”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:"{“on”:true}",“vt”:“str”},{“t”:“eq”,“v”:"{“on”:false}",“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:2,“x”:710,“y”:440,“wires”:[[“6844758e.b6119c”],[“5c60eaca.9c2af4”]]},{“id”:“6844758e.b6119c”,“type”:“change”,“z”:“55bb7c20.d7cbb4”,“name”:“开LED”,“rules”:[{“t”:“set”,“p”:“payload”,“pt”:“msg”,“to”:"{“power”: true}",“tot”:“str”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:890,“y”:400,“wires”:[[“601e8d7f.46fb34”]]},{“id”:“5c60eaca.9c2af4”,“type”:“change”,“z”:“55bb7c20.d7cbb4”,“name”:“关LED”,“rules”:[{“t”:“set”,“p”:“payload”,“pt”:“msg”,“to”:"{“power”: false}",“tot”:“str”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:890,“y”:460,“wires”:[[“601e8d7f.46fb34”]]},{“id”:“a3a235ad.617da8”,“type”:“redmatic-homekit-pseudobutton”,“z”:“55bb7c20.d7cbb4”,“bridgeConfig”:“d5c498a6.619498”,“name”:"",“topic”:"",“payload”:"",“payloadType”:“str”,“x”:310,“y”:680,“wires”:[[“167c03ed.409e5c”]]},{“id”:“167c03ed.409e5c”,“type”:“change”,“z”:“55bb7c20.d7cbb4”,“name”:"",“rules”:[{“t”:“set”,“p”:“payload”,“pt”:“msg”,“to”:"{“app”: “next”}",“tot”:“str”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:530,“y”:680,“wires”:[[“601e8d7f.46fb34”]]},{“id”:“9c165f5f.29a2e”,“type”:“mqtt-broker”,“z”:"",“name”:“mqtt36”,“broker”:“192.168.2.36”,“port”:“1883”,“clientid”:"",“usetls”:false,“compatmode”:false,“keepalive”:“60”,“cleansession”:true,“birthTopic”:"",“birthQos”:“0”,“birthPayload”:"",“closeTopic”:"",“closeQos”:“0”,“closePayload”:"",“willTopic”:"",“willQos”:“0”,“willPayload”:""},{“id”:“97412e70.298a3”,“type”:“homekit-bridge”,“z”:"",“bridgeName”:“HomeKit-KNX”,“pinCode”:“111-11-111”,“port”:"",“allowInsecureRequest”:false,“manufacturer”:“Default Manufacturer”,“model”:“Default Model”,“serialNo”:“Default Serial Number”,“customMdnsConfig”:false,“mdnsMulticast”:true,“mdnsInterface”:"",“mdnsPort”:"",“mdnsIp”:"",“mdnsTtl”:"",“mdnsLoopback”:true,“mdnsReuseAddr”:true,“allowMessagePassthrough”:true},{“id”:“93e73956.279268”,“type”:“SmartHome-Bot-Account”,“z”:"",“name”:“默认配置”},{“id”:“853b2bd3.727338”,“type”:“SmartHome-Bot-Config”,“z”:"",“name”:“调光灯”,“jsonConfig”:"{\n “2”: {\n “1”: “on”,\n “3”: “Brightness”,\n “4”: “color”\n },\n “3”: {\n “1”: “battery-level”,\n “3”: “voltage”\n }\n}"},{“id”:“d5c498a6.619498”,“type”:“redmatic-homekit-bridge”,“z”:"",“name”:“hk”,“username”:“CC:22:3D:51:F2:21”,“pincode”:“722-97-058”,“port”:“51826”}]
如果直接复制无效请下载附件。
Awtrix.txt (6.4 KB)