Tag Archives: homeassistant

HOME AUTOMATION: HOME ASSISTANT: PS4-WAKER

Another little handy trick which I use more than I thought I would with #homeassistant is the ability to turn my #PS4 on with the touch of the button.

 

I can also say to #Alexa:

Alexa, turn my Playstation on

And as if by magic, she will turn my PS4 on for me without me even lifting a finger. I will post more on how to use Alexa with Home Assistant commands in another post.

The app you want to install is called “PS4-Waker

This tool is really simple to install and by following the instructions on the link above can be done within minutes. You then need to follow the instructions to get it connect to your PS4, you also need to use the PlayStation app on your Android/iOS device as part of the process.

Then to get a switch into HomeAssistant – Just add the following:

# PS4 Switcher
switch ps4_power:
platform: command_line
switches:
ps4_power:
command_on: ‘sudo ps4-waker’
command_off: ‘sudo ps4-waker standby’
friendly_name: PS4 Power

HOME AUTOMATION: HOME ASSISTANT: SMB SHARES

Up until recently I was modifying my files via the command line using sudo nano configuration.yaml but a friend said to me why don’t you setup SMB shares on my raspberry pi so I could easily access and edit them. This also comes in handy for checking the home-assistant.log to find out why home assistant hasn’t booted up correctly.

First if you haven’t already you need to install samba

sudo apt-get install samba samba-common-bin

Now you will need to edit your config file to setup the shares

sudo nano /etc/samba/smb.conf

Now here is a snippet from my smb.conf file you can find the shares within the smb.conf file by searching for:

Share Definitions

[code language=”plain”][/code]

[code language=”plain”][/code]

[Pi]
path = /
comment = No comment
browsable = yes
read only = no
valid users =
writable = yes
guest ok = yes
public = yes
create mask = 0777
directory mask = 0777
force user = root
force create mode = 0777
force directory mode = 0777
hosts allow =

So the above now shows within my folders as:

Home Automation: Home Assistant: !secrets

I’ve been using HomeAssistant for a while and as my configuration.yaml file gets larger and larger it’s getting more and more passwords and api keys in. I wanted to neaten this up and also helps when you want to send the configuration.yaml file to other people to ask for help etc.

By using !secret options you can hide all of your passwords and api keys in a different file and can still be read by home assistant.

In the root of your home assistant directory create a file called secrets.yaml

add lines such as:

http_password: YOURPASSWORD

now within your configuration.yaml file where the password for the above is, simply type: !secret http_password

This will then read the secrets.yaml file and load the password from this file. This can also be done for api codes as well and keeps some extra security on your configuration.yaml file