I have been trying to set this up and am pretty close to doing so but I’m stuck (at probably the easiest part) and just cant wrap my head around it.
My question is about the 2 input_select files. First question is do they need to be completely separate? When I tried setting it up as described it errors out on me. Here is my setup:
When I set it up like above I get the following in my log.
Home-Assistant.log
17-03-07 14:02:04 ERROR (MainThread) [homeassistant.bootstrap] Invalid config for [input_select]: expected a dictionary for dictionary value @ data['input_select']. Got [OrderedDict([('input_select', OrderedDict([('choose_game', OrderedDict([('name', 'Play Game'), ('options', ['Choose Game']), ('initial', 'Choose Game')]))]))]), OrderedDict([('input_select', OrderedDict([('choose_id', OrderedDict([('name', 'Play ID'), ('options', ['empty']), ('initial', 'empty')]))]))])]. (See /home/homeassistant/.homeassistant/configuration.yaml, line 62). Please check the docs at https://home-assistant.io/components/input_select/
17-03-07 14:02:04 ERROR (MainThread) [homeassistant.components] Testing configuration at /home/homeassistant/.homeassistant
I went off the same structure I had set up with my automations i.e. !include. This is obviously not correct and need to know how to set up the two input_select.yaml files with my configuration.
@djkmod83 I think the easiest way is to create a folder inside the config folder. For example Inputselects.
So then you have the folder config/inputselects/
Then you place the choose_game.yaml and choose_id.yaml in that inputselects folder.
and in your configuration you change input_select: !include input_select.yaml
into: input_select: !include_dir_merge_named config/inputselects/
This will take any .yaml from the inputselects folder and consider it an input_select. So if you need more input_selects in the future you can just add another yaml file to it.
I am having an issue running the add-current-game script from within HA. Here is what I have in the scripts file:
alias: 'Add Current Game'
sequence:
- service: shell_command.add_current_game
I installed HA via the AiO script:
The file is executable
I have added user homeassistant to /etc/sudoers group as described above I am able to runsudo /scriptpathfrom the console and it works (as pi user)
I would like to be able to click the activate button from within HA to add the current game. Could anyone provide some insight? Share working scripts/automations?
Oke we need to achieve that the script will run from the console (as the hass user) Then it also will work when it is assigned to a button in HA.
For now, a reason why it isn’t working i can think of is that the ownership of the add_current_game file is pi and HA can’t execute it as it is running as the hass or home-assistant user. (i run the shell command like this add_current_game: "/home/pi/Documents/myownscripts/ps4/add-current-game" )
So in your case maybe changing ownership helps. Like this: sudo chown hass /home/pi/Documents/Scripts/add-current-game.sh
or (depending on the username where HA is running) sudo chown homeassistant /home/pi/Documents/Scripts/add-current-game.sh
I forgot to mention that I did try this before, both in the location above and moving it inside the homeassistant folder to /shell_scripts. I have switched to the homeassistant account by running sudo su -s /bin/bash homeassistant.
This is what i get when trying it with and without sudo and with and without the “.sh” at the end:
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for homeassistant:
Now, I am no expert when it comes to linux and dont want to go making changes to the homeassistant account unless i know im doing it right. I suppose this is why it is not working? I have no idea what the homeassistant password is. Is there a way i can change it without breaking anything?