eliseomartelli


Home Assistant is starting to take a nice shape here in my college bedroom and I'm trying to add even more commodities to it.
The last one? Opening apps on my Mac Mini when I'm laying in bed at night.

Yesterday I was researching on how I could control my Mac remotely, but then I thought: "what if I use the tools that Apple baked in macOS?". SSH became the obvious choice.

That's the steps I took to make it possible:

  1. Enable SSH on your computer. On a Mac you do this with System Preferencess.app
System Preferences.app > Sharing > Remote Login
  1. On the machine that runs Home Assistant, generate a new key pair using the user that runs Home Assistant.
$ > ssh-keygen -t rsa
  1. Then, appended the generated public key to the Mac authorized_keys file.
$ > cat .ssh/id_rsa.pub | ssh <mac_user>@<mac_ip> 'cat >> .ssh/authorized_keys'
  1. Add something like that to your Home Assistant configuration file:
shell_command:
  open_website_fullscreen: ssh <mac_user>@<mac_ip> "open -a Google\ Chrome -n --args -app=<website_url>  --start-fullscreen"
  1. Restart Home Assistant

Now you'll see the shell scommand expsed as a service.
From now on you can add this service to your frontend, call it from your smart speaker or use it inside your automations.


You just read 217 words.

Reply

Suggested Articles

Here are some of my thoughts you might also like.


Newsletter

Stay in the loop and get news about what I have my eyes on!

This is the email I will use to send you some news!