avraham / hass_radarr_sonarr_search_by_voice

Add movies to radarr by voice
GNU General Public License v3.0
46 stars 8 forks source link

Can't add content from Google Home #20

Closed SimonSR closed 2 years ago

SimonSR commented 3 years ago

Hi, I am having trouble getting this to work. I can add content using the testing method "python3 ./hass_radarr_search_by_voice.py "Artemis Fowl" "0". The movie does show up in Radarr, but I am unable to use voice commands to add content. I have followed the rest of the setup, and as far as I can see, everything is setup correctly, but for the life of me, I can't figure out why voice commands don't work. Google responds correctly, so I am pretty sure IFTTT is setup correctly. Running HA in docker, Radarr/Sonarr V3

my configuration.yaml file: [HomeAssistant] server_url = http://192.168.*.*:8123 api_key = token = **** scripts_path = /PATH_TO_YOUR_CONFIG/scripts speaker_entity = media_player.stue tts_service = google_translate

[Radarr] server_url = http://192.168.*.*:7878 api_key = **** root_directory = /home/debian-transmission/Downloads/10TB/Film profile_id = 4

[Sonarr] server_url = http://192.168.*.*:8989 api_key = ** root_directory = /home/debian-transmission/Downloads/10TB/TV-Serier profile_id = 4

[Services] omdb_api_key = * tmdmid_api_key_v3 = ***

ifttt

avraham commented 3 years ago

Hi, The problem might be in the automation that is listening for the "ifttt_webhook_received" event. Here's how you can debug that part.

Note: Automations created in YAML must have an id assigned in order for debugging traces to be stored.

In Home Assistant UI go to Configuration > Automations and click on to edit your automation that is listening for the "ifttt_webhook_received" event. In the example is called "ITFTTMovies". There you can see the Traces left by the last time the automation was run.

In case the automation has never run then the problem is how the automation is defined, particularly the event it's listening for.

Assuming it runs when you run the IFTTT applet by voice then you can inspect it receives the correct data (movie title) and calls the shell script correctly.

I'm attaching some screenshots of my setup. I've changed the automation name and some variable names since I wrote the sample files, I also placed my scripts in different paths but the functionality is the same.

Screen Shot 2021-08-10 at 11 10 42 AM Screen Shot 2021-08-10 at 11 02 12 AM

You can click on each step of the automation

Screen Shot 2021-08-10 at 11 01 57 AM

In the last screenshot you can se a common error where the shell script is missing execution permissions.

SimonSR commented 3 years ago

Thanks for getting back to me. It seems the automation is running as it's supposed to, as I can see the value is being sent correctly. stepdetails and no errors in the trace trace_timeline I do, however get an error in the home-assistant.log: 2021-08-11 07:30:35 ERROR (MainThread) [homeassistant.components.shell_command] Error running command: /bin/bash /homeassistant/scripts/download.sh "{{movie}}" 0, return code: 127 NoneType: None

avraham commented 3 years ago

Ok, so everything else works, but it's not running the python script. After searching for the error code I believe the issue is that HA is running inside a docker container and running python scripts is limited in some ways.

I can only test this on my setup which is using Home Assistant Core, not a docker version nor Hassio. The part of using Docker in the "Setup Instructions" was contributed by someone else, so unfortunately I can't guarantee it works nor test it.

Like I said, I looked for that error and a common solution suggested in the Home Assistant forums is that instead of having a shell command running the python script within the environment of your HA docker container, you can run a ssh command to login into your host machine and run the python script there. Does that make sense?. The python script would be in a path of your host machine of course, and the host machine should be able to run python scripts.

I don't know if this is something you would like to try. There might be a simpler solution, but this is what I found. This seems to be a very well documented guide SSH’ing from a command line sensor or shell command

If you end up doing this or finding a solution It would be nice to know.

SimonSR commented 3 years ago

Thanks again. I ended up installing Home Assistant Core instead. Did have the same error at first though, but I modified shellcommand.yaml to this:

download_movie: /home/homeassistant/.homeassistant/scripts/./download.sh "{{movie}}" 0 search_movie: /home/homeassistant/.homeassistant/scripts/./download.sh "{{movie}}" 1 download_option: /home/homeassistant/.homeassistant/scripts/./download.sh "{{option}}" 2 download_tvshow: /home/homeassistant/.homeassistant/scripts/./download_tvshow.sh "{{tvshow}}" 0 future

And now it works! Thank you so much for taking the time (and for coding it in the first place)

Do you have a donation link perhaps?

avraham commented 3 years ago

I'm glad it worked. Sure, I have this donation link "Buy Me A Coffee"

Thank you :)

bots444 commented 2 years ago

I love this project. I also almost got it working. I don't see any errors in the trace, but when i speak the command my google home says "I found the movie Artemis Fowl but was unable to add it" Any ideas?

avraham commented 2 years ago

Hi @bots444 , This seems to be a recurring issue, but I haven't be able to reproduce it. What type of Home Assistant installation are you using? Core, Docker container, etc. Here are listed the 4 types of installations

bots444 commented 2 years ago

I'm using home assistant core. I might be on to something here. I got it to add the movie into radarr, it is just not downloading it now. Baby steps. Great project by the way. I love this!

On Thu, Oct 21, 2021 at 3:02 PM Abraham Valenzuela @.***> wrote:

Hi @bots444 https://github.com/bots444 , This seems to be a recurring issue, but I haven't be able to reproduce it. What type of Home Assistant installation are you using? Core, Docker container, etc. Here are listed the 4 types of installations https://www.home-assistant.io/installation/

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/avraham/hass_radarr_sonarr_search_by_voice/issues/20#issuecomment-948916020, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM3AZ5OI5F3ASHIS6L2FE3DUIBPVDANCNFSM5B3VC73Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

bots444 commented 2 years ago

The test movie im trying to add is "Addams Family Values". My google home speaker just responded the following "I added the movie addams family values to your list with "none". I feel like there is just one more variable i have to change somewhere.

On Thu, Oct 21, 2021 at 3:17 PM Matthew Botsford @.***> wrote:

I'm using home assistant core. I might be on to something here. I got it to add the movie into radarr, it is just not downloading it now. Baby steps. Great project by the way. I love this!

On Thu, Oct 21, 2021 at 3:02 PM Abraham Valenzuela < @.***> wrote:

Hi @bots444 https://github.com/bots444 , This seems to be a recurring issue, but I haven't be able to reproduce it. What type of Home Assistant installation are you using? Core, Docker container, etc. Here are listed the 4 types of installations https://www.home-assistant.io/installation/

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/avraham/hass_radarr_sonarr_search_by_voice/issues/20#issuecomment-948916020, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM3AZ5OI5F3ASHIS6L2FE3DUIBPVDANCNFSM5B3VC73Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

bots444 commented 2 years ago

I GOT IT!!!

On Thu, Oct 21, 2021 at 3:29 PM Matthew Botsford @.***> wrote:

The test movie im trying to add is "Addams Family Values". My google home speaker just responded the following "I added the movie addams family values to your list with "none". I feel like there is just one more variable i have to change somewhere.

On Thu, Oct 21, 2021 at 3:17 PM Matthew Botsford @.***> wrote:

I'm using home assistant core. I might be on to something here. I got it to add the movie into radarr, it is just not downloading it now. Baby steps. Great project by the way. I love this!

On Thu, Oct 21, 2021 at 3:02 PM Abraham Valenzuela < @.***> wrote:

Hi @bots444 https://github.com/bots444 , This seems to be a recurring issue, but I haven't be able to reproduce it. What type of Home Assistant installation are you using? Core, Docker container, etc. Here are listed the 4 types of installations https://www.home-assistant.io/installation/

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/avraham/hass_radarr_sonarr_search_by_voice/issues/20#issuecomment-948916020, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM3AZ5OI5F3ASHIS6L2FE3DUIBPVDANCNFSM5B3VC73Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

avraham commented 2 years ago

Great @bots444 . How did you solve your initial problem "I found the movie but was unable to add it"?. Sharing it might be helpful for others :)

bots444 commented 2 years ago

I'll post what I did on the github

On Thu, Oct 21, 2021, 8:59 PM Abraham Valenzuela @.***> wrote:

Great @bots444 https://github.com/bots444 . How did you solve your initial problem "I found the movie but was unable to add it"?. Sharing it might be helpful for others :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/avraham/hass_radarr_sonarr_search_by_voice/issues/20#issuecomment-949137741, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM3AZ5MOW2IAM7O3JI4SUL3UICZPRANCNFSM5B3VC73Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.