{"id":3984,"date":"2021-01-03T12:58:02","date_gmt":"2021-01-03T04:58:02","guid":{"rendered":"https:\/\/sumju.net\/?p=3984"},"modified":"2020-12-31T10:20:12","modified_gmt":"2020-12-31T02:20:12","slug":"home-assistant-%e4%b9%8bopenwrt%e8%ae%be%e5%a4%87%e8%bf%bd%e8%b8%aa%ef%bc%8c%e8%bf%9e%e6%8e%a5%e8%b7%af%e7%94%b1%e5%99%a8%e6%98%be%e7%a4%ba%e5%9c%a8%e5%ae%b6%e7%a6%bb%e5%ae%b6%e7%8a%b6%e6%80%81","status":"publish","type":"post","link":"https:\/\/sumju.net\/?p=3984","title":{"rendered":"Home Assistant \u4e4bOpenWrt\u8bbe\u5907\u8ffd\u8e2a\uff0c\u8fde\u63a5\u8def\u7531\u5668\u663e\u793a\u5728\u5bb6\u79bb\u5bb6\u72b6\u6001\u3002"},"content":{"rendered":"<p>1. SSH\u767b\u9646OpenWrt\u6267\u884c\u4e0b\u9762\u547d\u4ee4\u5b89\u88c5 luci-mod-rpc\u3002<\/p>\n<pre><code>opkg install luci-mod-rpc<\/code> \u6216\u8005 \u4f7f\u7528\u7f51\u9875\u754c\u9762\u5b89\u88c5 luci-mod-rpc <a href=\"https:\/\/sumju.net\/?attachment_id=3998\" rel=\"attachment wp-att-3998\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-3998\" src=\"https:\/\/i0.wp.com\/sumju.net\/wp-content\/uploads\/2020\/12\/luci-mod-rpc.png?resize=1024%2C647&#038;ssl=1\" alt=\"\" width=\"1024\" height=\"647\" srcset=\"https:\/\/i0.wp.com\/sumju.net\/wp-content\/uploads\/2020\/12\/luci-mod-rpc.png?resize=1024%2C647&amp;ssl=1 1024w, https:\/\/i0.wp.com\/sumju.net\/wp-content\/uploads\/2020\/12\/luci-mod-rpc.png?resize=300%2C190&amp;ssl=1 300w, https:\/\/i0.wp.com\/sumju.net\/wp-content\/uploads\/2020\/12\/luci-mod-rpc.png?resize=768%2C485&amp;ssl=1 768w, https:\/\/i0.wp.com\/sumju.net\/wp-content\/uploads\/2020\/12\/luci-mod-rpc.png?resize=475%2C300&amp;ssl=1 475w, https:\/\/i0.wp.com\/sumju.net\/wp-content\/uploads\/2020\/12\/luci-mod-rpc.png?w=1366&amp;ssl=1 1366w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/a><\/pre>\n<p>2. \u7b2c\u4e8c\u6b65\u9aa4\u4fee\u6539 \/etc\/os-release \u6587\u4ef6\u91cc\u7684\u7248\u672c\u53f7\u3002<\/p>\n<pre><code>root@OpenWrt:~# cat \/etc\/os-release \r\nNAME=\"OpenWrt\"\r\nVERSION=\"19.07-SNAPSHOT\"\r\nID=\"openwrt\"\r\nID_LIKE=\"lede openwrt\"\r\nPRETTY_NAME=\"OpenWrt 19.07-SNAPSHOT\"\r\nVERSION_ID=\"19.07-snapshot\"<\/code><code>              #\u8fd9\u91cc\u6362\u621018.06\r\nHOME_URL=\"https:\/\/openwrt.org\/\"\r\nBUG_URL=\"https:\/\/bugs.openwrt.org\/\"\r\nSUPPORT_URL=\"https:\/\/forum.openwrt.org\/\"\r\nBUILD_ID=\"r11399-3187c018ac\"\r\nOPENWRT_BOARD=\"x86\/64\"\r\nOPENWRT_ARCH=\"x86_64\"\r\nOPENWRT_TAINTS=\"no-all\"\r\nOPENWRT_DEVICE_MANUFACTURER=\"OpenWrt\"\r\nOPENWRT_DEVICE_MANUFACTURER_URL=\"https:\/\/openwrt.org\/\"\r\nOPENWRT_DEVICE_PRODUCT=\"Generic\"\r\nOPENWRT_DEVICE_REVISION=\"v0\"\r\nOPENWRT_RELEASE=\"OpenWrt 19.07-SNAPSHOT r11399-3187c018ac\"<\/code> <a href=\"https:\/\/sumju.net\/?attachment_id=4002\" rel=\"attachment wp-att-4002\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4002\" src=\"https:\/\/i0.wp.com\/sumju.net\/wp-content\/uploads\/2020\/12\/18.06.png?resize=817%2C578&#038;ssl=1\" alt=\"\" width=\"817\" height=\"578\" srcset=\"https:\/\/i0.wp.com\/sumju.net\/wp-content\/uploads\/2020\/12\/18.06.png?w=817&amp;ssl=1 817w, https:\/\/i0.wp.com\/sumju.net\/wp-content\/uploads\/2020\/12\/18.06.png?resize=300%2C212&amp;ssl=1 300w, https:\/\/i0.wp.com\/sumju.net\/wp-content\/uploads\/2020\/12\/18.06.png?resize=768%2C543&amp;ssl=1 768w, https:\/\/i0.wp.com\/sumju.net\/wp-content\/uploads\/2020\/12\/18.06.png?resize=424%2C300&amp;ssl=1 424w\" sizes=\"auto, (max-width: 817px) 100vw, 817px\" \/><\/a><\/pre>\n<p>3. Home Assistant\u589e\u52a0\u8bbe\u5907\u8ffd\u8e2a\u914d\u7f6e\uff0c\u4e4b\u540e\u91cd\u542fHome Assistant\u3002<\/p>\n<pre><code>device_tracker:\r\n  - platform: luci\r\n    host: 192.168.1.1\r\n    #ssl: true\r\n    #verify_ssl: true\r\n    username: root\r\n    password: !secret wrtpass\r\n    interval_seconds: 5\r\n    consider_home: 180\r\n    new_device_defaults:\r\n      track_new_devices: true<\/code><\/pre>\n<p>4. \u4fee\u6539known_devices.yaml\u6587\u4ef6\uff0c\u4e3a\u6bcf\u4e2a\u8bbe\u5907\u8bbe\u7f6e\uff0c\u662f\u5426\u9700\u8981\u8ffd\u8e2a\u3002<\/p>\n<p><a href=\"https:\/\/sumju.net\/?attachment_id=4008\" rel=\"attachment wp-att-4008\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4008\" src=\"https:\/\/i0.wp.com\/sumju.net\/wp-content\/uploads\/2020\/12\/trueorfalse.png?resize=696%2C836&#038;ssl=1\" alt=\"\" width=\"696\" height=\"836\" srcset=\"https:\/\/i0.wp.com\/sumju.net\/wp-content\/uploads\/2020\/12\/trueorfalse.png?w=696&amp;ssl=1 696w, https:\/\/i0.wp.com\/sumju.net\/wp-content\/uploads\/2020\/12\/trueorfalse.png?resize=250%2C300&amp;ssl=1 250w\" sizes=\"auto, (max-width: 696px) 100vw, 696px\" \/><\/a><\/p>\n<p>\u89c6\u9891\u6559\u7a0b\uff1a<br \/>\n<a href=\"https:\/\/youtu.be\/1EO0iMaXMKE\" target=\"_blank\" rel=\"attachment noopener wp-att-4028\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4028 size-large\" src=\"https:\/\/i0.wp.com\/sumju.net\/wp-content\/uploads\/2020\/12\/icloud-Max-Quality-1.jpg?resize=1024%2C576&#038;ssl=1\" alt=\"\" width=\"1024\" height=\"576\" srcset=\"https:\/\/i0.wp.com\/sumju.net\/wp-content\/uploads\/2020\/12\/icloud-Max-Quality-1.jpg?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/sumju.net\/wp-content\/uploads\/2020\/12\/icloud-Max-Quality-1.jpg?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/sumju.net\/wp-content\/uploads\/2020\/12\/icloud-Max-Quality-1.jpg?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/sumju.net\/wp-content\/uploads\/2020\/12\/icloud-Max-Quality-1.jpg?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/sumju.net\/wp-content\/uploads\/2020\/12\/icloud-Max-Quality-1.jpg?resize=533%2C300&amp;ssl=1 533w, https:\/\/i0.wp.com\/sumju.net\/wp-content\/uploads\/2020\/12\/icloud-Max-Quality-1.jpg?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. SSH\u767b\u9646OpenWrt\u6267\u884c\u4e0b\u9762\u547d\u4ee4\u5b89\u88c5 luci-mod-rpc\u3002 opkg install&hellip; <a href=\"https:\/\/sumju.net\/?p=3984\" class=\"more-link read-more\" rel=\"bookmark\">\u7ee7\u7eed\u9605\u8bfb <span class=\"screen-reader-text\">Home Assistant \u4e4bOpenWrt\u8bbe\u5907\u8ffd\u8e2a\uff0c\u8fde\u63a5\u8def\u7531\u5668\u663e\u793a\u5728\u5bb6\u79bb\u5bb6\u72b6\u6001\u3002<\/span><i class=\"fa fa-arrow-right\"><\/i><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[35],"tags":[],"class_list":{"0":"post-3984","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-home-assistant","7":"h-entry","9":"h-as-article"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/posts\/3984","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sumju.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3984"}],"version-history":[{"count":13,"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/posts\/3984\/revisions"}],"predecessor-version":[{"id":4030,"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/posts\/3984\/revisions\/4030"}],"wp:attachment":[{"href":"https:\/\/sumju.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sumju.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sumju.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}