{"id":1005,"date":"2025-07-25T20:57:35","date_gmt":"2025-07-25T18:57:35","guid":{"rendered":"https:\/\/blog.bratfisch.net\/?p=1005"},"modified":"2025-08-14T23:11:15","modified_gmt":"2025-08-14T21:11:15","slug":"howto-login-via-ssh-into-home-assistants-esphome-container","status":"publish","type":"post","link":"https:\/\/blog.bratfisch.net\/index.php\/2025\/07\/25\/howto-login-via-ssh-into-home-assistants-esphome-container\/","title":{"rendered":"HOWTO: login via ssh into home assistant&#8217;s esphome container"},"content":{"rendered":"\n<p>I work a lot on esphome configs, I&#8217;m often doing this via ssh.<br>I got annoyed that I always have to ssh to home assistant, search for the container&#8217;s name, login to that, switch to \/config\/esphome.<\/p>\n\n\n\n<p>So here&#8217;s a script that does all of that, the home assistant host is called &#8220;ha&#8221; in my network:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\nHOMEASSISTANT=\"ha\"\nESPHOME_DOCKER_CONTAINER=$(ssh $HOMEASSISTANT 'docker container list|grep esphome'|awk '{print $10}' -)\nssh -t $HOMEASSISTANT \"docker exec -it $ESPHOME_DOCKER_CONTAINER bash -c 'cd \/config\/esphome &amp;&amp; exec bash'\"                                                                                                                                                                                                                                                                                                                                                                                                                                                                     <\/code><\/pre>\n\n\n\n<p>As esphome tends to hang up from time to time in my setup, I wrote a script to restart the esphome container too:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\nHOMEASSISTANT=\"ha\"\nESPHOME_DOCKER_CONTAINER=$(ssh $HOMEASSISTANT 'docker container list|grep esphome'|awk '{print $10}' -)\nssh -t $HOMEASSISTANT \"docker container restart $ESPHOME_DOCKER_CONTAINER\"<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I work a lot on esphome configs, I&#8217;m often doing this via ssh.I got annoyed that I always have to ssh to home assistant, search for the container&#8217;s name, login to that, switch to \/config\/esphome. So here&#8217;s a script that does all of that, the home assistant host is called &#8220;ha&#8221; in my network: As [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[5,13,8],"class_list":["post-1005","post","type-post","status-publish","format-standard","hentry","category-allgemein","tag-esphome","tag-home-assistant","tag-howto"],"_links":{"self":[{"href":"https:\/\/blog.bratfisch.net\/index.php\/wp-json\/wp\/v2\/posts\/1005","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bratfisch.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bratfisch.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bratfisch.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bratfisch.net\/index.php\/wp-json\/wp\/v2\/comments?post=1005"}],"version-history":[{"count":7,"href":"https:\/\/blog.bratfisch.net\/index.php\/wp-json\/wp\/v2\/posts\/1005\/revisions"}],"predecessor-version":[{"id":1031,"href":"https:\/\/blog.bratfisch.net\/index.php\/wp-json\/wp\/v2\/posts\/1005\/revisions\/1031"}],"wp:attachment":[{"href":"https:\/\/blog.bratfisch.net\/index.php\/wp-json\/wp\/v2\/media?parent=1005"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bratfisch.net\/index.php\/wp-json\/wp\/v2\/categories?post=1005"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bratfisch.net\/index.php\/wp-json\/wp\/v2\/tags?post=1005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}