Bonjour à tous,
Nouvelle saison, nouveau projet lol je voudrais essayer avec Home assistant dans la continuité de mon projet sur l’autonomie avec mon téléphone portable, de pouvoir déclencher la fonction « OK Google » en appuyant simplement sur une touche de mon Home assistant.
Là où je voudrais aller plus loin, c’est que je voudrais Lancer l’assistant Google en appuyant sur un bouton HA.
Voici mon code
type: custom:stack-in-card
title: Appels & SMS
cards:
- type: horizontal-stack
cards:
- type: entities
entities:
- entity: input_text.callnumber
icon: mdi:dialpad
- type: custom:button-card
icon: mdi:trash-can
tap_action:
action: call-service
service: input_text.set_value
data:
value: ''
target:
entity_id: input_text.callnumber
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
- type: horizontal-stack
cards:
- type: entities
entities:
- entity: input_text.smstext
icon: mdi:text
- type: custom:button-card
icon: mdi:trash-can
tap_action:
action: call-service
service: input_text.set_value
data:
value: ''
target:
entity_id: input_text.smstext
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
- type: horizontal-stack
cards:
- type: markdown
content: >-
Message de : {{state_attr('sensor.redmi_last_notification' ,
'android.title')}}
{{states('sensor.redmi_last_notification')}}
- type: horizontal-stack
cards:
- type: custom:button-card
name: '1'
tap_action:
action: call-service
service: script.1708615679662
service_data:
number: '1'
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
- type: custom:button-card
name: '2'
tap_action:
action: call-service
service: script.1708615679662
service_data:
number: '2'
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
- type: custom:button-card
name: '3'
tap_action:
action: call-service
service: script.1708615679662
service_data:
number: '3'
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
- type: custom:button-card
name: '4'
tap_action:
action: call-service
service: script.1708615679662
service_data:
number: '4'
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
- type: custom:button-card
name: '5'
tap_action:
action: call-service
service: script.1708615679662
service_data:
number: '5'
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
- type: custom:button-card
name: '6'
tap_action:
action: call-service
service: script.1708615679662
service_data:
number: '6'
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
- type: custom:button-card
icon: mdi:phone-cancel
color: red
tap_action:
action: call-service
service: script.1708615554191
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
- type: custom:button-card
icon: mdi:microphone
color: white
tap_action:
action: call-service
service: notify.mobile_app_redmi
data:
message: command_launch_app
data:
package_name: com.google.android.apps.accessibility.voiceaccess
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
- type: custom:button-card
icon: mdi:comment
color: white
tap_action:
action: call-service
service: notify.mobile_app_redmi
data:
message: command_launch_app
data:
package_name: com.google.android.apps.messaging
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
- type: custom:button-card
icon: mdi:google-assistant
color: white
tap_action:
action: call-service
service: notify.mobile_app_redmi
data:
message: command_launch_app
data:
package_name: com.google.android.apps.googleassistant
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
- type: horizontal-stack
cards:
- type: custom:button-card
name: '7'
tap_action:
action: call-service
service: script.1708615679662
service_data:
number: '7'
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
- type: custom:button-card
name: '8'
tap_action:
action: call-service
service: script.1708615679662
service_data:
number: '8'
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
- type: custom:button-card
name: '9'
tap_action:
action: call-service
service: script.1708615679662
service_data:
number: '9'
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
- type: custom:button-card
name: '*'
tap_action:
action: call-service
service: script.1708615679662
service_data:
number: '*'
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
- type: custom:button-card
name: '0'
tap_action:
action: call-service
service: script.1708615679662
service_data:
number: '0'
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
- type: custom:button-card
name: '#'
tap_action:
action: call-service
service: script.1708615679662
service_data:
number: '#'
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
- type: custom:button-card
icon: mdi:phone
color: green
tap_action:
action: call-service
service: script.1708615643818
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
- type: custom:button-card
icon: mdi:message
color: blue
tap_action:
action: call-service
service: script.1708615761003
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
- type: custom:button-card
icon: mdi:eye
color: white
tap_action:
action: call-service
service: notify.mobile_app_redmi
data:
message: command_screen_on
data:
priority: high
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
La zone concernée est celle-ci
- type: custom:button-card
icon: mdi:google-assistant
color: white
tap_action:
action: call-service
service: notify.mobile_app_redmi
data:
message: command_launch_app
data:
package_name: com.google.android.apps.googleassistant
styles:
card:
- width: 40px
- height: 40px
- color: '#44739e'
Pour plus de précisions, regardez cette vidéo.
Si je fais un appui maintenu sur le bouton d’accueil du téléphone cela me lance bien la fonction OK Google
par contre si je met com.google.android.apps.googleassistant comme direction du bouton Home Assistant je tombe sur l’ouverture de l’application Home assistant!
Auriez-vous une idée comment je pourrais lancer OK Google en appuyant sur un bouton HA ? Merci d’avance.