Panoramica delle azioni sui dispositivi
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Con l'SDK dell'Assistente Google, puoi incorporare l'Assistente Google nel tuo
progetto, facendolo funzionare in modo simile a Google Home. Tuttavia, il tuo progetto
potrebbe avere funzionalità hardware uniche che Google Home non ha: ad esempio, potrebbe avere un display LED unico con impostazioni di luminosità e
colore personalizzabili.
Le Azioni dispositivo sono un insieme di strumenti e API che ti consentono di estendere le funzionalità dell'assistente nei progetti che sviluppi, per sfruttare appieno il potenziale delle funzionalità hardware.
Azioni dispositivo integrate
Google ha creato un'ampia gamma di azioni comuni integrate per le attività quotidiane, tra cui luci, elettrodomestici e videocamere. Con queste azioni, puoi sfruttare la potenza dell'elaborazione del linguaggio naturale dell'Assistente Google per controllare il tuo progetto. Ad esempio, un progetto con una luce può essere acceso in
diversi modi:
- Ok Google, accendi la luce.
- Hey Google, accendi la luce.
- Ok Google, accendi la luce del soggiorno.
Puoi creare il tuo progetto che risponde ai comandi per
molte
caratteristiche della smart home
come:
- Ok Google, imposta la luminosità al 50%.
- Hey Google, imposta la temperatura a 37 gradi.
Azioni dispositivo personalizzate
Puoi anche creare azioni personalizzate per i tuoi dispositivi hardware unici. Per queste
azioni, definisci la grammatica e i comandi:
- Ok Google, fai lampeggiare la mia luce 5 volte.
- Hey Google, sposta a sinistra.
Scopri di più su come incorporare queste azioni utilizzando il servizio dell'Assistente Google.
Come funziona
Sul dispositivo è installato l'SDK dell'Assistente Google insieme alle credenziali per
accedere al servizio dell'Assistente Google. Il dispositivo invia la richiesta vocale
(Accendi) e chiede al servizio di accendere il LED integrato del dispositivo.
Il dispositivo invia anche i propri identificatori di modello e istanza del dispositivo in modo che il servizio
possa determinare il modo migliore per rispondere nel contesto della richiesta.
Il servizio utilizza il riconoscimento vocale automatico (ASR) per determinare le parole pronunciate dall'utente, l'elaborazione del linguaggio naturale (NLP) per analizzare e comprendere il significato della richiesta da queste parole e la corrispondenza dei dispositivi per fornire il contesto della richiesta. Questo contesto è importante perché definisce le azioni supportate dal dispositivo e le modalità di esecuzione.
Il servizio risponde quindi con un testo che viene letto all'utente (Certo.)
insieme al comando specifico del dispositivo. Il dispositivo sa come gestire questo
comando: accende il LED.

Inizia
Dai vita alle tue idee incorporando l'Assistente Google
nel tuo progetto e poi aggiungendo funzionalità uniche con Device
Actions. Puoi sviluppare il tuo progetto utilizzando il servizio Google Assistant.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-26 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-26 UTC."],[[["\u003cp\u003eThe Google Assistant SDK enables you to integrate the Google Assistant into your projects, similar to a Google Home, and leverage Device Actions to utilize unique hardware features.\u003c/p\u003e\n"],["\u003cp\u003eDevice Actions provide tools and APIs to extend the Assistant's capabilities, allowing your project to respond to voice commands for functionalities like lights, appliances, and cameras using built-in or custom actions.\u003c/p\u003e\n"],["\u003cp\u003eBuilt-in Device Actions cover common smart home features, while Custom Device Actions let you define unique voice commands and functionalities tailored to your specific hardware.\u003c/p\u003e\n"],["\u003cp\u003eThe Google Assistant service utilizes Automatic Speech Recognition, Natural Language Processing, and device context to understand user requests and trigger corresponding actions on your device.\u003c/p\u003e\n"],["\u003cp\u003eYou can get started by embedding the Google Assistant into your project and adding custom functionalities with Device Actions using the provided resources and guides.\u003c/p\u003e\n"]]],[],null,["# Device Actions Overview\n\nWith the Google Assistant SDK, you can embed the Google Assistant into your\nown project, making it function similarly to a Google Home. However, your project\nmay have unique hardware capabilities that Google Home does not have: for\nexample, it may have a unique LED display with customizable brightness and\ncolor settings.\n\nDevice Actions are a set of tools and APIs that allow you to extend what\nthe Assistant can do, in the projects you develop, to take full potential of\ntheir hardware capabilities.\n\nBuilt-in Device Actions\n-----------------------\n\nGoogle has created a wide range of common built-in device actions for everyday\nthings, including lights, appliances, and cameras. With these actions, you can\nharness the power of the Google Assistant's natural language processing to\ncontrol your project. For example, a project with a light can be turned on in\ndifferent ways:\n\n- *Ok Google, turn on the light.*\n- *Hey Google, turn my light on.*\n- *Ok Google, turn on my living room light.*\n\nYou can create your own project that responds to commands for\nmany\n[smart home traits](/assistant/sdk/reference/traits)\nlike:\n\n- *Ok Google, set the brightness to 50%.*\n- *Hey Google, set the temperature to 98 degrees.*\n\nCustom Device Actions\n---------------------\n\nYou can also create custom device actions for your own unique hardware. For these\nactions, you define the grammar and commands:\n\n- *Ok Google, blink my light 5 times.*\n- *Hey Google, move left.*\n\nLearn more about incorporating these actions using the [Google Assistant service](/assistant/sdk/guides/service/python/extend/custom-actions).\n\nHow it works\n------------\n\nThe device has the Google Assistant SDK installed on it along with credentials for\naccessing the Google Assistant Service. The device sends out the spoken request\n(*Turn on.*) and asks the service to turn on the device's onboard LED.\nThe device also sends its model and device instance identifiers so the service\ncan determine how to best respond in context to the request.\n\nThe service uses Automatic Speech Recognition (ASR) to determine what words were\nspoken by the user, Natural Language Processing (NLP) to analyze and understand\nthe meaning of the request from these words, and device matching to provide context\nfor the request. This context is important because it defines the actions the\ndevice supports and how these actions should be fulfilled.\n\nThe service then responds with text that is spoken back to the user (*Sure.*)\nalong with the device-specific command. The device knows how to handle this\ncommand: it turns on its LED!\n\nGet started\n-----------\n\nBring your ideas to life by embedding the Google Assistant\ninto your project and then adding unique functionality with Device\nActions. You can develop your project [using the Google Assistant service](/assistant/sdk/guides/service/python)."]]