-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrating ytube_music_player #38
Comments
It seemed to have been a indentation error. I formatted it in vscode and then the error gone away. I however seemed to have been trying to do a search instead of choosing one of the playlists IDs. It seemed to be working after I removed the "search_music" spec. I read from the logs that it tried to call that one instead. It started the playlist at least. Is there a way to specify so that it doesn't mix them up? New spec:
|
I will change an error message and not even call API in next release if failed to load yaml functions.
Please correct me if I'm wrong. As far as I know, you can try to tell gpt to do so by modifying prompt or description or name of functions. |
That's smart, I'll test that! I'm also thinking if it's possible to make "if"-type statements for a spec. If ytube_music_player already has a chosen media player or is playing media already to have it either skip choosing a media player or switch media player. Perhaps that can be put in the specs description too. |
Oh, I haven't thought about it. Can't you achieve it by putting either choose or skip media player in prompt? |
I'm still experimenting around at the moment with trying out the prompt. My ultimate goal is for the AI to be fully able to control ytube_music_player so gonna have to write a spec for every function I think. Progress is a bit slow right now due to my setup and school. So far I got this:
I'm wondering if there's other properties for the different settings? Does the parameters have different types other than object or a different property type other than string for example? Edit: Also here's the current error I'm trying to fix, not sure if my way to do it is possible; |
Perhaps like the search_music spec I could do something in the template section? Since the ytube_music_player device shows which device is currently playing, it could perhaps base of off that? So if the device is selected on the ytube_media_player property |
In - spec:
name: music_choose_player
description: This function will choose the player to play back media to. Can also be used to switch current playback device.
parameters:
type: object
properties:
playback_device:
type: string
description: The speaker to play music on. Use entity ID of a speaker.
required:
- playback_device
function:
type: composite
sequence:
- type: script
sequence:
- service: media_player.select_source
data:
source: "{{playback_device}}"
entity_id: media_player.youtube_music
It seems that you want a feature like if-then in script function. The "script" type function is designed to be same as script integration in Home Assistant, but it currently has a bug when using if-then statement. I'm working on it, and it will probably be fixed in the next release. However, you can achieve Currently not working (will be fixed in the next release)Functions - spec:
...
function:
type: script
sequence:
- if:
- condition: state
entity_id: ...
state: "..."
then:
- service: media_player.select_source
data: ... WorkaroundFunctions - spec:
...
function:
type: script
sequence:
- service: script.youtube_music_select_source script.youtube_music_select_source alias: youtube_music_select_source
sequence:
- if:
- condition: state
entity_id: ...
state: "..."
then:
- service: media_player.select_source
data: ...
mode: single
|
The script function now supports if-then statement in |
I'm trying to add some specs for full ytube_music_player integration.
Currently I'm trying to have it play from a list of playlist. I've added this in my prompt:
And then this is what I'm trying for the spec:
However I'm getting
I'm planning to add a function to each ytube_music_player function to have full control of it. Including picking a media player. Is there a way in the spec config to choose an already exposed media player?
The text was updated successfully, but these errors were encountered: