Replies: 9 comments 8 replies
-
Have you tried using callService provided by useHass? If you have a custom script, the target must be the script name, ie script.script_name, then you can provide the service data serviceData object |
Beta Was this translation helpful? Give feedback.
-
No. That sounds perfect, thanks.
…On Tue, 10 Oct 2023 at 11:19, Shannon Hochkins ***@***.***> wrote:
Have you tried using callService provided by useHass? If you have a custom
script, the target must be the script name, ie script.script_name, then you
can provide the service data serviceData object
—
Reply to this email directly, view it on GitHub
<#74 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABDLLFASFK3X3ZLHTQTTKDX6UOMPAVCNFSM6AAAAAA52BE7B2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TEMZZGQ3DS>
.
You are receiving this because you authored the thread.Message ID:
<shannonhochkins/ha-component-kit/repo-discussions/74/comments/7239469@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
Hi @ifuller1 , I just tried this and it worked fine but i can't see how your script is setup, an example of what i've just setup
This simple script, takes a dynamic message, then in
And when i run the api.saySomething command it then replies on my hub with Additionally, if you're trying to debug web sockets, there's a much easier way using the developer tools, refresh the page, you'll see a websocket/api connection, if you click on that, then messages, you'll see all socket requests funneling through: |
Beta Was this translation helpful? Give feedback.
-
I'll try this exact setup thanks.
I was aware of the web socket debug although I probably should have gone
straight there!
Thanks
…On Tue, 10 Oct 2023, 22:23 Shannon Hochkins, ***@***.***> wrote:
Hi @ifuller1 <https://github.com/ifuller1> , I just tried this and it
worked fine but i can't see how your script is setup, an example of what
i've just setup
alias: Say Something
sequence:
- service: google_assistant_sdk.send_text_command
data:
media_player: media_player.office_hub
command: "{{ message }}"
mode: single
icon: mdi:account-voice
This simple script, takes a dynamic message, then in hakit
const script = useEntity('script.say_something');
script.api.saySomething({
message: 'What is 4 x 4'
});
And when i run the api.saySomething command it then replies on my hub with 4
x 4 is 16 so it's all working fine
Additionally, if you're trying to debug web sockets, there's a much easier
way using the developer tools, refresh the page, you'll see a websocket/api
connection, if you click on that, then messages, you'll see all socket
requests funneling through:
[image: Screenshot 2023-10-11 at 8 21 40 am]
<https://user-images.githubusercontent.com/5105002/274067491-e8cd9c61-b0ad-4f99-b3ca-8f3491bd4307.png>
—
Reply to this email directly, view it on GitHub
<#74 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABDLLAD2JOBSAGAOHPWGSDX6W4DTAVCNFSM6AAAAAA52BE7B2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TENBWGE2TC>
.
You are receiving this because you were mentioned.Message ID:
<shannonhochkins/ha-component-kit/repo-discussions/74/comments/7246151@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
So calling your script didn't work at all - it didn't get called with or
without the params. (see the screenshot - not sure if anything obvious in
the web socket messages).
Calling my script, using this syntax, is working - so I guess I'm good!
…On Wed, 11 Oct 2023 at 12:55, Shannon Hochkins ***@***.***> wrote:
I'm a little confused about your questions here you said it didn't work,
but then it did work?
I am not sure if you have the same google sdk addon installed, if you
don't that simply won't work
Regarding the names of the method, you're correct snake case has been
converted to camel case for the service names and domain names, if you have
typescript installed with the sync script you'll get full intellisense of
what's available including the arguments for services 😉
—
Reply to this email directly, view it on GitHub
<#74 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABDLLHTJNUSD4H757Z5UGDX62CKXANCNFSM6AAAAAA52BE7BY>
.
You are receiving this because you were mentioned.Message ID:
<shannonhochkins/ha-component-kit/repo-discussions/74/comments/7251845@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
I recently updated HA so not sure if it's related. I assume the response
messages mean nothing to you?
…On Wed, 11 Oct 2023, 20:19 Shannon Hochkins, ***@***.***> wrote:
That's odd, but I'm glad you got it working!
—
Reply to this email directly, view it on GitHub
<#74 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABDLLGON32BLMPG76TU7TLX63WLTANCNFSM6AAAAAA52BE7BY>
.
You are receiving this because you were mentioned.Message ID:
<shannonhochkins/ha-component-kit/repo-discussions/74/comments/7256211@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
It's just so strange as you can see it receives the messages but ha says 0
runs.
Anywho. Thanks!
…On Thu, 12 Oct 2023, 06:29 Shannon Hochkins, ***@***.***> wrote:
The response of on or off? It's simply just indicating that it was
triggered I believe, but probably best to check ha documentation, is it
causing you problems? You can simply ignore the response if it's all working
—
Reply to this email directly, view it on GitHub
<#74 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABDLLBWT45ZNEYNJJQAVU3X6553PANCNFSM6AAAAAA52BE7BY>
.
You are receiving this because you were mentioned.Message ID:
<shannonhochkins/ha-component-kit/repo-discussions/74/comments/7259565@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
Good shout. Thanks
…On Thu, 12 Oct 2023, 06:57 Shannon Hochkins, ***@***.***> wrote:
It's entirely possible that the runs information displayed is some higher
order function to save in the database, if you run the script from HA and
inspect the websockets, you could confirm that the same request is being
made as hakit and that'll confirm that its doing something else based on
the response to update that runs value
—
Reply to this email directly, view it on GitHub
<#74 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABDLLGKTNWCG22Y3EXO4WLX66BD3ANCNFSM6AAAAAA52BE7BY>
.
You are receiving this because you were mentioned.Message ID:
<shannonhochkins/ha-component-kit/repo-discussions/74/comments/7259731@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
Hey all. Any idea how to pass data to a script entity? When I provide anything via "turnOn" it doesn't get executed at all. Runs fine without any data.
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions