Google Assistant : Send variables ? is it possible?

Hi is there a way to use google assistant so that data can be passed??

i want to create a service to add “items” on a shopping list for example

Can i say to google "add xxx to the shopping list
Then retrieve that “xxx” value and drop it in a service

(this is possible with IFTTT, but dont want to use it)

thnx !

With something like Dialogflow you could probably do that.

maybe indeed
But with Dialogflow, you first need to enter the app by saying like “talk to …” and then enter the command
I want it easier :slight_smile:

You can also use IFTTT.com for the variable type flows. I realize it’s not local / preferred, but they do make it possible. [IFTTT - Home Assistant]

I also realize it’s now a paid service if you have more than 1 (2?, 3?) applets. To get around this, and FWIW, I’ve created an Execute $ Google Assistant → Home Assistant applet that passes the $ variable to HA - I can then parse that result and execute different scripts.

IFTTT portion:
image

And then an automation in HA to parse:

- id: '1555877822388'
  alias: Webhook from IFTTT w/Execute Text
  trigger:
  - event_data:
      action: execute
    event_type: ifttt_webhook_received
    platform: event
  condition:
    condition: template
    value_template: '{{ trigger.event.data.service == ''script.ifttt_execute'' }}'
  action:
  - service: input_text.set_value
    data:
      entity_id: input_text.ifttt_execute
      value: '{{ trigger.event.data.ifttt_text }}'
  - service_template: '{% set text = trigger.event.data.ifttt_text.lower() %} {% if
      ''pool'' in text and ''fill'' in text %} {% set what = ''pool_filler'' %} {%
      elif ''pool'' in text and ''put'' in text %} {% set what = ''pool_filler'' %}
      {% elif ''gate'' in text and ''open'' in text %} {% set what = ''front_gate_open''
      %} {% elif ''gate'' in text and ''close'' in text %} {% set what = ''front_gate_close''
      %} {% elif ''set'' in text and ''alarm'' in text %} {% set what = ''set_home_alarm_click_ui''
      %} {% elif ''outside lights'' in text and ''off'' in text %} {% set what = ''outside_lights_off''
      %} {% elif ''pool light'' in text and ''on'' in text %} {% set what = ''pool_light_turn_on''
      %} {% elif ''pool light'' in text and ''off'' in text %} {% set what = ''pool_light_turn_off''
      %} {% else %} {% set what = ''do_nothing'' %} {% endif %} script.{{what}}'

I have some setup for pool filler, front gate, etc. Hope this helps and gives a different perspective on how this is possible.

1 Like

thx, i know IFTTT supports it, but they promised to have DUTCH language support years ago for GA, and i had a look today, and still no support for new languages

there must a way for HA
seems there is an universal media player , if you expose that media_player to GA, seems you can say like, change media player source to xxx …

that looks like the same service, so my guess , its must be possibe

Certainly it can be done with Dialogflow and using an intent script. While a little more complicated than IFTT, it is way more flexible. You can send multiple variables, do checking, fallbacks, etc… The following is a project I put together a few years back to control logitech mediaserver via google voice commands using HA as the middle man.

1 Like

Great, thnx for sharing!!

Hey, I resurrect this thread since, at the end of this month, it won’t be possible to pass variables to Google Assistant integration via IFTTT due to some changes on the Google side.

Is Dialogflow still the best option to achieve this? It seems to be a paid service, are there any free alternatives? I need to migrate my automations before the switch off :slight_smile:

2 Likes