Assistant Relay

Thanks for your suggestion. This is what I have in the config.yaml file (I have masked the last octet of the IP with ‘X’ here). Is there anything else that I should be doing to call this service? Again, this works fine on the web UI (sandbox) and not in HA.

Example configuration.yaml

rest_command:
assistant_broadcast:
url: http://192.168.1.X:3000/assistant
method: POST
content_type: ‘application/json’
payload: ‘{“command”:"{{ command }}", “user”:“Nick”, “broadcast”:true}’

assistant_converse:
url: http://192.168.1.X:3000/assistant
method: POST
content_type: ‘application/json’
payload: ‘{“command”:"{{ command }}", “user”:“Nick”, “converse”:true}’

assistant_relay:
url: http://192.168.1.X/assistant
method: POST
content_type: ‘application/json’
payload: ‘{“command”:"{{ command }}", “user”:“Nick”}’

Just for reference: you don’t need to do that. Internal IP addresses are not sensitive information.

Can you please format your code correctly for us. We can’t confirm that it is correctly indented otherwise.

This is all I have in my config:

rest_command:
  assistant_broadcast:
    url: http://192.168.0.14:3000/assistant
    method: POST
    content_type: 'application/json'
    payload: '{"command":"{{ command }}", "user":"Home Assistant", "broadcast":true}'
    
  assistant_converse:
    url: http://192.168.0.14:3000/assistant
    method: POST
    content_type: 'application/json'
    payload: '{"command":"{{ command }}", "user":"Home Assistant", "converse":true}'
  
  assistant_relay:
    url: http://192.168.0.14:3000/assistant
    method: POST
    content_type: 'application/json'
    payload: '{"command":"{{ command }}", "user":"Home Assistant"}'

Hopefully you can see my config in the attached pic. It doesn’t generate any errors. I did restart HASS but still the same result. Please can you tell me what’s wrong here. This has been bugging me for many days now!!

Thanks!

Can you please post your automation showing the service call? When you paste the code into the forum, highlight all the code and then click the button above that looks like </> to ensure it shows the correct formatting in your post.

Appreciate your help to debug this error - thanks heaps Dave :+1:
I have taken screenshots of a simple automation routine in HASS config to turn off lights with a time trigger. Since ‘actions->call service’ doesn’t show the service data field, I also yaml code, and I get this error message " Message malformed: extra keys not allowed @ data[‘action’][0][‘message’] ".

Spacing is critically important in YAML. Based on where you have put spacing it decides whether something is an object or a scalar. For that reason this is incorrect:

service: rest_command.assistant_broadcast
        data:
          command: turn off living room

By indenting data you’ve turned the service field into an object. Hence you’re getting an error that the row must have at least one of service, service_template. It can’t find your service because its looking for a text field and you’ve made it into an object. This is correct:

service: rest_command.assistant_broadcast
data:
  command: turn off living room

Also for future reference please read over How to ask a good question. You’re posting a lot of screenshots of configuration and automation and it would’ve been a lot easier to help if you had posted the YAML. Also when you do post YAML please surround it in backticks as suggested in the guide as it preserves formatting which is key to solving some of these issues.

Thank you very much for putting that in words and example code. It really helped me understand how this works. I didn’t know the difference like you explained it to me. I finally got it working now :blush:!!

Thanks for your help Dave! It got it working now - my mind was going crazy thinking I don’t have the right files installed in the config directory as I was getting service integration errors. I still however don’t get the service field option in automation but I copy-paste the code in the yaml editor and then it comes up. Phew! I wish knew coding :blush:! Have a good day.

Cheers,
Nick

is it possible only to send to one speaker ?

Not just yet. The beta has this coming from what I understand… if it gets the additional dev time required

I also ran into this same issue as @Nick-homeassistant but was also fixed by @CentralCommand’s YAML.

Finding it really odd i don’t have a service data field either. Imagine it has something to do with the recent UI editor update for automations, scripts etc.

I’m having a weird issue and I would really appreciate any help with this. My installation is working fine. I can issue a command from the sandbox or from HomeAssistant automation and both works. The problem is this: when I type “shuffle jazz classics on kitchen tv” on google assistant, it understands and does it. However, when I type the same thing in the sandbox, Google says it does not understand. Can anyone guess why is this happening?

is this behavior reproducable? What happens when directed to another device?

it is possible now

How? It hasn’t been updated? I’d like to see how you have manged to do it because it’s something I’ve wanted to do for a long time.

Sorry for the late reply,

if u have porrtainer go to add container
add this next to image docker.io: kluuvto/assistant-relay
and also add network ports 3000 3000
and deploy

once its deployed, use the google account whats connected to your google home
create credentials, i did choose desktop
after you created go to the account setup on assistant-relay
enter a username and upload the json file from that created oauth2.
then it will open a random window, follow and do everything it ask. and then it will fail to load a page, but in the browser u see your outhcode, copy it and paste it in auth from Assistant-relay and if done correct, u will hear a broadcast voice saying everything is connected and set-up

So is this a fork of the other Assistant Relay ?

yes that works to, but also the old one is still working.

I’m using the 4.04 version.

and i installed 2 days ago (Google Assistant Webserver) thats a integration for home assistant and works even better and faster.

Ok, I think you misunderstood my previous question then.

I have been using Assistant Relay for years. My question was about being able to broadcast to a specific device rather than all devices.

No i did not misonderstood, u asked if that was a fork of Assistant relay, i replied yes,
But right now i’m testing 2 versions, 1 Assistant relay v4.04, and a addon called (Google assistant Webserver) and i must say the second one works faster and smoother

And yes its possible, just disable the broadcast button and use this command (broadcast to YOUR ROOM, MESSAGE.

It works great, as most of my important messages ar using this way to broadcast an issue, the rest is native tts