Willkommen im Google Home Developer Center, dem neuen Ort, an dem Sie lernen, wie Sie Smart-Home-Aktionen entwickeln.
Feedback geben
Schema für Farbtemperaturmerkmale von Smart-Home-Geräten
bookmark_border bookmark
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Diese Eigenschaft wurde eingestellt. Verwenden Sie stattdessen ColorSetting .
action.devices.traits.ColorTemperature
: Diese Eigenschaft gehört zu jedem Gerät, das eine Farbtemperatur einstellen kann.
Das gilt für „Wärme“-Glühbirnen, die einen Farbpunkt in Kelvin annehmen. Dies ist in der Regel eine andere Modalität von
ColorSpectrum und es können Weißpunkte über „Temperatur“ verfügbar sein, die von Spectrum nicht erreicht werden können. Je nach Anfrage und Art der Beleuchtung wählt Google je nach den verfügbaren Eigenschaften möglicherweise den zu verwendenden Modus aus. Mit der Funktion
Lampen im Wohnzimmer weiß machen werden beispielsweise Temperaturbefehle an einige Lampen und Befehle vom Typ „Spectrum“ an LED-Streifen gesendet.
Geräte-ATTRIBUTE
Attribut
Definition
temperatureMinK
Optional. Erforderlich, wenn temperatureMaxK
festgelegt ist. Die minimale Farbtemperatur, die vom Licht unterstützt wird, in Kelvin.
temperatureMaxK
Optional. Erforderlich, wenn temperatureMinK
festgelegt ist. Maximale vom Licht unterstützte Farbtemperatur in Kelvin.
Beispiel für SYNC-Anfrage und -Antwort
{ "requestId" : "ff36a3cc-ec34-11e6-b1a0-64510650abcf" , "inputs" : [{ "intent" : "action.devices.SYNC" }] }
'use strict' ; const { smarthome } = require ( 'actions-on-google' ); const functions = require ( 'firebase-functions' ); const app = smarthome (); app. onSync (( body , headers ) => { return { requestId: body . requestId , payload: { agentUserId: '1836.15267389' , devices: [{ id: '123' , type: 'action.devices.types.LIGHT' , traits: [ 'action.devices.traits.ColorTemperature' ], name: { defaultNames: [ 'AAA bulb A19 color hyperglow' ], name: 'lamp1' , nicknames: [ 'reading lamp' ] }, willReportState: true , attributes: { temperatureMinK: 2000 , temperatureMaxK: 6500 }, deviceInfo: { manufacturer: 'AAA' , model: 'hg11' , hwVersion: '1.2' , swVersion: '5.4' }, customData: { fooValue: 12 , barValue: false , bazValue: 'dancing alpaca' } }] } }; }); // ... exports. smarthome = functions . https . onRequest ( app );
{ "requestId" : "ff36a3cc-ec34-11e6-b1a0-64510650abcf" , "payload" : { "agentUserId" : "1836.15267389" , "devices" : [ { "id" : "123" , "type" : "action.devices.types.LIGHT" , "traits" : [ "action.devices.traits.ColorTemperature" ], "name" : { "defaultNames" : [ "AAA bulb A19 color hyperglow" ], "name" : "lamp1" , "nicknames" : [ "reading lamp" ] }, "willReportState" : true , "attributes" : { "temperatureMinK" : 2000 , "temperatureMaxK" : 6500 }, "deviceInfo" : { "manufacturer" : "AAA" , "model" : "hg11" , "hwVersion" : "1.2" , "swVersion" : "5.4" }, "customData" : { "fooValue" : 12 , "barValue" : false , "bazValue" : "dancing alpaca" } } ] } }
Gerät STATES
Status
Definition
color
Objekt. Aktuelle Farbeinstellung. Da sich ein bestimmtes Licht im Spektrum-ODER-Temperaturmodus befindet, enthält dieses Objekt die aktuellen Farbeinstellungen im relevanten Modus.
String name
. Wenn der Farbpunkt (Spektrum oder Temperatur) mit einem voreingestellten Namen in der Farbliste des Partners übereinstimmt, wird der Name zurückgegeben.
temperature
Ganzzahl. Farbtemperatur in Kelvin.
Beispiel für QUERY-Anfrage und -Antwort
Wie hoch ist meine aktuelle Farbtemperatur?
{ "requestId" : "ff36a3cc-ec34-11e6-b1a0-64510650abcf" , "inputs" : [{ "intent" : 'action.devices.QUERY' , "payload" : { "devices" : [{ "id" : "123" , "customData" : { "fooValue" : 74 , "barValue" : true , "bazValue" : "foo" } }] } }] }
'use strict' ; const { smarthome } = require ( 'actions-on-google' ); const functions = require ( 'firebase-functions' ); const app = smarthome (); app. onQuery (( body , headers ) => { return { requestId: body . requestId , payload: { devices: { 123 : { online: true , color: { name: 'warm white' , temperature: 25000 }, status: 'SUCCESS' } } } }; }); // ... exports. smarthome = functions . https . onRequest ( app );
{ "requestId" : "ff36a3cc-ec34-11e6-b1a0-64510650abcf" , "payload" : { "devices" : { "123" : { "online" : true , "color" : { "name" : "warm white" , "temperature" : 25000 }, "status" : "SUCCESS" } } } }
BEFEHLE auf dem Gerät
Befehl
Parameter/Definition
action.devices.commands.ColorAbsolute
color
-Objekt. Erforderlich. Enthält RGB oder Temperatur und optional einen Namen.
String name
. Farbname (auf Englisch), wie im Befehl des Nutzers angegeben. Nicht immer verfügbar (für relative Befehle).
temperature
Ganzzahl. Farbtemperatur in Kelvin.
Beispiel für Anfrage und Antwort AUSFÜHREN
Stell das Licht auf weiches Weiß.
{ "requestId" : "ff36a3cc-ec34-11e6-b1a0-64510650abcf" , "inputs" : [{ "intent" : "action.devices.EXECUTE" , "payload" : { "commands" : [{ "devices" : [{ "id" : "123" , "customData" : { "fooValue" : 74 , "barValue" : true , "bazValue" : "sheepdip" } }], "execution" : [{ "command" : "action.devices.commands.ColorAbsolute" , "params" : { "color" : { "name" : "soft white" , "temperature" : 2700 } } }] }] } }] }
'use strict' ; const { smarthome } = require ( 'actions-on-google' ); const functions = require ( 'firebase-functions' ); const app = smarthome (); app. onExecute (( body , headers ) => { return { requestId: body . requestId , payload: { commands: [{ ids: [ '123' ], status: 'SUCCESS' , states: { color: { name: 'soft white' , temperature: 2700 } } }] } }; }); // ... exports. smarthome = functions . https . onRequest ( app );
{ "requestId" : "ff36a3cc-ec34-11e6-b1a0-64510650abcf" , "payload" : { "commands" : [ { "ids" : [ "123" ], "status" : "SUCCESS" , "states" : { "color" : { "name" : "soft white" , "temperature" : 2700 } } } ] } }
Feedback geben
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers . Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2023-09-21 (UTC).
Haben Sie Feedback für uns?
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Fehlerhafte Informationen","incorrectInformation","thumb-down"],["Nicht genügend Informationen/Beispiele","notEnoughInformationSamples","thumb-down"],["Zu kompliziert","tooComplicated","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2023-09-21 (UTC)."],[],[]]