Giter VIP home page Giter VIP logo

ha-configuration's People

Contributors

cadsters avatar capstan1 avatar casparthebridge avatar cheadrian avatar thefes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ha-configuration's Issues

Google Home Resume 2022.12

Update to 2022.12
Currently done:

Improvements

  • removed players_screen, now using device_class
  • added Voice and Event script to package (including template sensor)

Bug fixes:

  • fix for automation triggering when groups is being resumed. Need to look at that again, might be better to add the members to the groups instead of fixing it in the automation

Unable to resume spotify with your scripts.

Hello,
I found your script for resuming spotify on the homeassistant forums. I think I have everything set up correctly, though I'm getting an error from the google resume helper script and I can't figure out what I've done wrong.
00 - Google Home Resume - Helper Script: If at step 1: Resume needed?: Resume playing: Spotify?: Error executing script. Unexpected error for call_service at pos 2: 'NoneType' object is not subscriptable
I have no idea what this means or how to fix it. I have your script in scripts.yaml, and I have the automation that goes along with it in automations.yaml. My automations are in an automations folder and as far as I understand they should be pretty simple.
If you need I can paste my automation to you here. Either that, or it's something I removed from the script, but all I took out was the groups and the players_screen as I have neither of them. I left primary_spotcast and set it to my name. Any help you can give would be greatly appreciated.

Multiple Spotcast accounts and media_player.group

Good day Fes,

Sorry for bugging you again. This is not urgent, but I have 2 questions:

  1. When playing 1 spotcast account per speaker at a time it works 100% and resumes with the spotcast account that was playing. When Playing music from 2 spotcast accounts on 2 media players, when notification plays and the music resumes it only resumes on the default spotcast account on the last speaker the script ran. I tried running a script per speaker pointing to different default spotcast account, didn't work. How can I setup my automation to resume both speakers with the 2 spotcast accounts that was playing?

  2. When spotcast to media_player.group (my own group created in google home app) and the notification plays, the music resumes only on one speaker. I think i'm setting up the script wrong.

Thank you in advance.

Device tracker group for guests

Add to guest person
Create person group for family members (back to old situation)
Change automations using state of zone now to use the groups above

Error rendering data template: Result is not a Dictionary

Good day,

I would like to use your script and would love to get it to work:

I have changed media players to my entities. When trying to run the script
I'm getting error: Error rendering data template: Result is not a Dictionary

Here are the full error:

Logger: homeassistant.components.websocket_api.http.connection
Source: helpers/service.py:238
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 10:28:05 AM (4 occurrences)
Last logged: 10:29:30 AM

[140159867333552] Error rendering data template: Result is not a Dictionary
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1495, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 273, in service_handler
await script_entity.async_turn_on(
File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 377, in async_turn_on
await coro
File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 403, in _async_run
return await self.script.async_run(script_vars, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1260, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 363, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 381, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 557, in _async_call_service_step
params = service.async_prepare_call_from_config(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 238, in async_prepare_call_from_config
raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Error rendering data template: Result is not a Dictionary

Can you please point out to what I am doing wrong?

Thank you

' Incorrect type. Expected "object". ' on fresh installation.

On a fresh installation of the google_cast package, I see three errors in the google_home_resume.yaml code.
At line 720: data: "{{ data }}"
Line 976: {{ service_data if player.spotcast == 'primary_account' else dict(service_data, **account_data) }}
Line 1317: data: "{{ data }}"

All three locations give "Incorrect type. Expected "object". in the Visual Studio Code Server add-on IDE.

Better handling of spotcast service call

Always use spotcas service call without account when:

  • There is only one Spotify integration (removing the need to provide primary_spotcast)
  • No Spotify media_player matches the primary_spotcast provided. This avoids an incorrect service call when the service call uses an account which is not configured. Should be clearly explained in the docs though, because it will cause that the wrong account is resumed when the primary_spotcast variable is incorrect.
  • Add check for incorrect or missing primary_spotcast in script, put that in a variable and use that for the points above. Post a warning in the log in case it is not correct

Template warning/error

Hey TheFes,

I am using your script for a while now and it still doing a very good job.
One thing that I see in my logs is the following:

Logger: homeassistant.helpers.template
Source: helpers/template.py:1850
First occurred: June 15, 2022, 23:22:00 (1 occurrences)
Last logged: June 15, 2022, 23:22:00

Template variable warning: 'players_screen' is undefined when rendering '{{ [] if not players_screen else target_not_playing | select('in', players_screen) | list }}'

I dont think that I need to worry about, but will it gives any problems for in the future if you know?
I don’t have the line players_screen, because I don’t need it. Or can I just add the line without any argument, so that the error doesn’t show anymore?

greetings,

Besiktas97

Test

This is a test issue

Google Nest Hub VS Google Home Mini !

Hi,
my compliments for your great work!
I've tray a simple test implementation. This one:

google_home_voice_test:
alias: "Google Home Voice Test"
icon: mdi:car
sequence:
- variables:
message: "Ciao Ciao, ti sto rispondendo da Home Assistant solo qui"
- alias: "TTS for speaker voice command"
service: script.google_home_voice
data:
use_resume: true
target_variable: true
action:
- alias: "Send TTS message"
# service: tts.cloud_say
service: tts.cloud_say
data:
message: "{{ message }}"
volume: 35

I've made a routine in Google Home App that call this script and reproduce a specific relaxing sound (in according to the title in variable of your script)

I,ve tested from "Google Nest Hub":

  • ok google play music
  • ok google launch my script

And: the music stop, tts message spoke, the music resume!

I've testes from "Google Home Mini" the same voice command:

  • the music stop, i hear a "blip" but no TTS message and no music resume.

If I ask to launch my script without music in playback, the TTS message is reading.

Can you help me, please?
Thanks!

Single accounts not supported

First off, HUGE thank you for taking the time to make this. It's been a pita having to restart music everytime so I find myself sitting in silence. I'm sure I'll enjoy using this even more than your kids.

First question, is there anyway this could be a python script? You must have had the patience of a saint writing the yaml, but I can't really follow it. If you know a way to make it a script I'd happily contribute! (very keen to support the BBC, which is no longer via tunein)

Second question:

2022-04-08 23:26:36 ERROR (MainThread) [homeassistant.components.script.google_home_resume_perform_resume] 00 🔊 Google Home Resume - Perform resume: Resume needed?: choice 1: Resume playing: Spotify?: Primary spotcast account?: default: Error executing script. Unexpected error for call_service at pos 1: 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 372, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 575, in _async_call_service_step
    await service_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1630, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1673, in _execute_service
    await self._hass.async_add_executor_job(
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/spotcast/__init__.py", line 170, in start_casting
    client = spotcast_controller.get_spotify_client(account)
  File "/config/custom_components/spotcast/spotcast_controller.py", line 179, in get_spotify_client
    return spotipy.Spotify(auth=self.get_token_instance(account).access_token)
  File "/config/custom_components/spotcast/spotcast_controller.py", line 170, in get_token_instance
    dc = self.accounts.get(account).get(CONF_SP_DC)
AttributeError: 'NoneType' object has no attribute 'get'

I've been struggling to debug what's going on. Here's the variables I can find:

spotify_data:
  - entity_id: media_player.spotify_xxxxx_xxxxx
    source: Landing speaker
player_data:
  - data_source: resume_script
    entity_id: media_player.landing_speaker
    state: playing
    app_name: Spotify
    volume_level: 0.44998854398727417
    media_position: 19.155000047683714
    members: []
    type: no screen
    spotcast: xxxx_xxxxx
players_to_resume:
  - media_player.landing_speaker

I've masked my account, but it seems sensible. I don't really know where to go from here? My spotcast works via the lovelace attachment and I've removed default_user from the variables.

Any thoughts? And thanks again!

Resume after image is sent to displays

Hey! I was able to get this working after just a few minutes of setup. Its great! Is there a way to have Resume work when I send an image to my google displays though?

I have a script that, when the doorbell is pressed, a picture of the visitor is taken and cast to the google displays throughout the house. After 30s the image is removed. What would be the proper way to configure this so your resume script works? I have tried a few different ways, but my guess is that I need to update something in the automation you provide. Can you point me in the right direction? If it helps, here is my doorbell script.

Thanks so much! 💚

doorbell_send_snapshot_to_displays:
  alias: Doorbell send snapshot to displays
  sequence:
  - service: camera.snapshot
    data:
      filename: /config/www/images/doorbellsnap.jpeg
    target:
      device_id: 4f727cb6d16f05386b5ab17047d76a08
  - service: media_player.play_media
    data:
      media_content_id: /local/images/doorbellsnap.jpeg
      media_content_type: image/jpeg
      announce: true
    target:
      entity_id:
      - media_player.office_display
      - media_player.kitchen_display
      - media_player.bedroom
  - delay:
      hours: 0
      minutes: 0
      seconds: 20
      milliseconds: 0
  - service: media_player.turn_off
    data: {}
    target:
      entity_id:
      - media_player.kitchen_display
      - media_player.office_display
      - media_player.bedroom
  mode: single

Google Home Resume script not working with Music Assistant!?

Hi there,
I managed to resume media which I started via Spotcast (triggered through the "custom:spotify-card") but media is not resumed when playing media with the newly integrated Music Assitant.
Do you think your script can be changed in order to work with this integration?

Furthermore I noticed that on my Google minis the volume level is changed before the originally played media is completely stopped, e.g. when altering the volume level for tts messages the originally played media gets pretty loud for a short time before tts is played.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.