How integrate rest_command in Google Home

Hello,

I have a lot of switches defined like this :

switch:
  - platform: command_line
    switches:
        spots_hallway:
          command_on: curl "http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=5&CHA=0&EVT=3"
          command_off: curl "http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=5&CHA=1&EVT=3"
          friendly_name: "Lichten gang"

These works fine and are showing up in Google Home.

But I also have these rest_commands (f.e. my shutters) :

rest_command:
  rolluik_eettafel_op_kort:
    url: http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=2&CHA=10&EVT=3
  rolluik_eettafel_op_lang:
    url: http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=2&CHA=10&EVT=4
  rolluik_eettafel_neer_kort:
    url: http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=1&CHA=10&EVT=3

How can I make these visible in Google Home and how can I give them a friendly name (to use with Google Assistant) ?

I have this in my configuration.yaml :

google_assistant:
  project_id: home-assistant-xxxxx
  service_account: !include SERVICE_ACCOUNT.json
  report_state: true
  exposed_domains:
    - switch
    - light
    - camera
    - scene
    - sensor
    - script
    - **rest_command**
  entity_config:
    switch.tv_samsung_6_series_50:
      expose: false

I think.
If you make scripts that use the rest commands then it should be visible in GH after synchronising

Ah, OK…

Could you elaborate this with an example please (f.e. a script called ‘rolluik_eettafel_neer_lang’ that I want to call with a friendly name “Rolluik eettafel op”) ?

I get this when I create a script with rest as part of the call service.

Doesn’t your entities show up in the list?

Misunderstanding…the problem is not my script, this is working

alias: rolluik_eettafel_neer_lang
sequence:
  - service: script.switch_rolluik
    data:
      rolluik: eettafel
      beweging: neer
      druk: lang
mode: single

My question is what I have to put in the config.yaml file to make this visible in Google Home and how to give it the friendly name “Rolluik eettafel neer” (so I can call “Hey Google, rolluik eettafel neer”).

You have already exposed scripts, so nothing.

You need to sync the devices on GH.
Then you need to ask GH to "activate <script name>".

Or create a routine in GH that is "activate <script name>" with a easier command.

Great, it works!

It is a pity that this cannot be specified on the side of Home Assistant…

PS: I can’t mark your post with the Solution tag