I have also completed the integration of Google Home in HA.
Then I have created an automation in Google Home that can successfully activate the pump with a voice command because Google home recognizes my HA buttons as actionable actions.
I would like now to create a button that could send sensor information through a voice message on Google assistant and that could be triggered by an incoming voice message recognized by my Google assistant.
I first tried with a button card on the GUI.
type: button
icon: mdi:gesture-tap-button
show_state: true
name: Test
hold_action:
action: none
tap_action:
action: call-service
service: tts.google_translate_say
service_data:
entity_id: media_player.chromecast_de_beatrice
message: >-
Le niveau de CO2 est {{ states('sensor.netatmo_maison_nancras_indoor_co2')
}} ppm ! La température extérieure est de {{
states('sensor.netatmo_maison_nancras_indoor_exterieur_temperature') }}
degré'Bonsoir: ceci est un nouvel essai..'
language: fr
target: {}
The button is working fine from HA GUI but is not recognized by home assistant as an action.
I have also tried also to declare a button inside the configuration file but didn’t find the correct syntax.
How can I declare in the configuration.yaml file, a button similar to my “MQTT” button but associated to the service “google_translate_say” and not to a MQTT topic ?
Hello,
thank you tomdudu38 for your reply and for the list of domains that can be exposed.
Actually, in the latest version of HA, “buttons” that are created in the back-end can be exposed to Google Assistant but I didn’t find a way to use it in a trigger.
I have now found a method which is not straightforward but it works.
Create in the back-end configuration file, a button that sends a MQTT message
Of course, you need a MQTT broker in your system.
In my configuration, I use a Raspberry PI 3 with Mosquitto and Home Assistant running in docker.
I am pretty sure however that an alternative method without the MQTT channel might exist, may be though a python script. I will explore this solution later on.