{"id":1572,"date":"2021-07-31T12:50:06","date_gmt":"2021-07-31T04:50:06","guid":{"rendered":"https:\/\/www.wurend.com\/?p=1572"},"modified":"2021-07-31T12:54:09","modified_gmt":"2021-07-31T04:54:09","slug":"ubuntu-%e5%ae%89%e8%a3%85home-assistant","status":"publish","type":"post","link":"https:\/\/www.wurend.com\/?p=1572","title":{"rendered":"Ubuntu \u5b89\u88c5home assistant"},"content":{"rendered":"\n<p>1\u3001\u9996\u5148\u5efa\u8bae\u4f7f\u7528ubuntu 20.0\u53ca\u4ee5\u4e0a\u7248\u672c<\/p>\n\n\n\n<p>\u539f\u56e0\uff1a\u56e0\u4e3a\u5176\u81ea\u5e26\u7684python\u7248\u672c\u4e3a3.8\uff0c\u514d\u53bb\u540e\u7eed\u9ebb\u70e6\u7684\u5347\u7ea7\u7b49\u5404\u79cd\u6b65\u9aa4<\/p>\n\n\n\n<p>2\u3001\u521b\u5efaroot \u7528\u6237<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo passwd\r\nsudo apt update<\/code><\/pre>\n\n\n\n<p>3\u3001\u5b89\u88c5ssh<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install openssh-server<\/code><\/pre>\n\n\n\n<p>4\u3001\u5b89\u88c5pip<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install python3-pip\r\npip3 --version\r\nsudo pip3 install pip --upgrade\r\n\/etc\/pip.conf#\u66f4\u6362pip\u6e90\r\n\r\n&#91;global]\r\nindex-url=https:\/\/mirrors.aliyun.com\/pypi\/simple\/\r\nextra-index-url=https:\/\/www.piwheels.org\/simple<\/code><\/pre>\n\n\n\n<p>5\u3001\u5b89\u88c5\u4f9d\u8d56<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install libevent-dev libjpeg-dev build-essential libssl-dev libffi-dev python3-dev libavahi-compat-libdnssd-dev libatlas-base-dev autoconf python3-venv<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5\u4f9d\u8d56\u73af\u5883\u540e\uff0c\u8981\u786e\u5b9apython\u6ca1\u6709\u95ee\u9898\u540e\uff0c\u5148\u5b89\u88c5\u4e2a\u5176\u4ed6\u670d\u52a1\u8bd5\u8bd5\u6c34<\/p>\n\n\n\n<p>6\u3001\u5b89\u88c5sumba\u548cjupyter<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Samba\u547d\u4ee4\r\n\u5b89\u88c5\uff1asudo apt-get install samba samba-common\r\n\u589e\u52a0\u7528\u6237pi\u5e76\u8bbe\u7f6e\u5bc6\u7801\uff1asudo smbpasswd -a pi\r\n\u91cd\u542fsamba\u670d\u52a1\uff1asudo systemctl restart smbd\r\nSamba\u914d\u7f6e\u6587\u4ef6\u4f4d\u7f6e\r\n\/etc\/samba\/smb.conf <\/code><\/pre>\n\n\n\n<p>\u5982\u679c\u6253\u5f00\u5171\u4eab\u662f\u7a7a\u7684\uff08\u672a\u663e\u793a\u5171\u4eab\u76ee\u5f55\uff09<br>\u5728Windows\u7684DOS\u7a97\u53e3\u4e2d\uff0c\u8fd0\u884c\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>net use z: \\\\raspiberry_ip\\pi password \/USER:pi<\/code><\/pre>\n\n\n\n<p>\u4fee\u6539\u5176\u4e2d<code>password<\/code>\u4e3a\u4f60\u7684password\uff0c\u5982\u679c\u8981\u4fdd\u6301z\u76d8\u957f\u4e45\u6620\u5c04\uff0c\u5728\u547d\u4ee4\u4e2d\u589e\u52a0\uff1a<code>\/PERSISTENT:YES<\/code><br><em>\u6ce8\uff1a\u5f88\u591awindows\u7f3a\u7701\u4f7f\u7528\u533f\u540d\u8bbf\u95ee\u5171\u4eab\uff0c\u800c\u6211\u4eec\u7684\u5171\u4eab\u662f\u4ee5<code>pi<\/code>\u7528\u6237\u5171\u4eab\u7684\uff0c\u6240\u4ee5\u5c31\u770b\u4e0d\u5230\u3002<\/em><br><em>\u4f7f\u7528\u8fd9\u4e2a\u547d\u4ee4\uff0c\u6307\u5b9a\u4f7f\u7528<code>pi<\/code>\u7528\u6237\u8bbf\u95ee\uff0c\u5c06\u5171\u4eab\u7684\u76ee\u5f55\u6620\u5c04\u4e3awindows\u4e0b\u7684z\u76d8<\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Jupyter Notebook\u547d\u4ee4\r\n\u5b89\u88c5\uff1asudo pip3 install jupyter\r\n\u751f\u6210\u914d\u7f6e\u6587\u4ef6\uff1ajupyter notebook --generate-config\r\n\u8bbe\u7f6e\u8bbf\u95ee\u5bc6\u7801\uff1ajupyter notebook password<\/code><\/pre>\n\n\n\n<p>\u4fee\u6539Jupyter Notebook\u7684\u914d\u7f6e\uff08\u6587\u4ef6\u4f4d\u7f6e\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~\/.jupyter\/jupyter_notebook_config.py\uff09\r\n\u5728\u6587\u4ef6\u4e2d\u627e\u5230\u4e0b\u9762\u76844\u4e2a\u914d\u7f6e\u9879\uff0c\u53bb\u9664\u524d\u9762\u7684\u6ce8\u91ca\u7b26\u53f7\uff08#\uff09\uff0c\u5e76\u4fee\u6539\u7b49\u53f7\u540e\u7684\u503c\u4e3a\u4e0b\u9762\u7684\u503c\u3002\r\nc.NotebookApp.ip = '0.0.0.0'\r\nc.NotebookApp.open_browser = False\r\nc.NotebookApp.port = 8888\r\nc.NotebookApp.notebook_dir = '\/home\/pi\/' <\/code><\/pre>\n\n\n\n<p>7\u3001\u5b89\u88c5homeassistant<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo pip3 install homeassistant\r\nsudo pip3 install homeassistant --upgrade<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5HomeAssistant<\/p>\n\n\n\n<p>\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo pip3 install homeassistant<\/code><\/pre>\n\n\n\n<p>\u6267\u884c\u5185\u5bb9\uff1a\u4e0b\u8f7d\u5e76\u5b89\u88c5\u4e0a\u8868\u4e2d\u7b2c\u4e00\u884c\u5185\u5bb9<\/p>\n\n\n\n<p>\u542f\u52a8HomeAssistant<\/p>\n\n\n\n<p>\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hass<\/code><\/pre>\n\n\n\n<p>\u6267\u884c\u5185\u5bb9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u5982\u679c\u6ca1\u6709\u914d\u7f6e\u6587\u4ef6\uff0c\u751f\u6210\u914d\u7f6e\u76ee\u5f55\u4e0e\u7f3a\u7701\u914d\u7f6e\u6587\u4ef6<\/li><li>\u52a0\u8f7d\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u7ec4\u4ef6\uff08\u4ee5\u53ca\u5176\u4f9d\u8d56\u7684\u7ec4\u4ef6\uff09\uff0c\u5b89\u88c5\u5bf9\u5e94\u4f9d\u8d56\u7684python\u5e93<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u68c0\u67e5<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>\u8fdb\u7a0b\uff1aps -ef|grep hass\r\n\r\n\u7f51\u7edc\uff1anetstat -an|grep 8123\r\n\r\n\u914d\u7f6e\u76ee\u5f55\u4e0e\u914d\u7f6e\u6587\u4ef6\uff1a\/home\/pi\/.homeassistant\/\r\n\r\n\u9519\u8bef\u65e5\u5fd7\u6587\u4ef6\uff1a\/home\/pi\/.homeassistant\/home-assistant.log\r\n\r\n\u6d4f\u89c8\u5668\u8bbf\u95ee\uff1ahttp:\/\/xx.xx.xx.xx:8123\/<\/code><\/pre>\n\n\n\n<p>\u5347\u7ea7HomeAssistant<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u547d\u4ee4\uff1asudo pip3 install homeassistant --upgrade\r<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator is-cnvs-separator-id-1627706822509\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u6587\u7ae0\u53c2\u8003<\/h3>\n\n\n\n<div class=\"wp-block-buttons aligncenter is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link has-white-color has-pale-cyan-blue-background-color has-text-color has-background\" href=\"https:\/\/zhuanlan.zhihu.com\/p\/360281296\" target=\"_blank\" rel=\"noreferrer noopener\">\u77e5\u4e4e\u94fe\u63a5<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u9996\u5148\u5efa\u8bae\u4f7f\u7528ubuntu 20.0\u53ca\u4ee5\u4e0a\u7248\u672c \u539f\u56e0\uff1a\u56e0\u4e3a\u5176\u81ea\u5e26\u7684python\u7248\u672c\u4e3a3.8\uff0c\u514d\u53bb\u540e\u7eed\u9ebb\u70e6\u7684\u5347 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1569,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[103,3,105,104],"class_list":["post-1572","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-4","tag-home-assistant","tag-linux","tag-ubuntu","tag-104"],"_links":{"self":[{"href":"https:\/\/www.wurend.com\/index.php?rest_route=\/wp\/v2\/posts\/1572","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wurend.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wurend.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wurend.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wurend.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1572"}],"version-history":[{"count":0,"href":"https:\/\/www.wurend.com\/index.php?rest_route=\/wp\/v2\/posts\/1572\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wurend.com\/index.php?rest_route=\/wp\/v2\/media\/1569"}],"wp:attachment":[{"href":"https:\/\/www.wurend.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wurend.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wurend.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}