Google Maps Color B&W - maps

Can I use this code in the an iframe for a wordpress page post to make my map black and white? I would like a map just like this: http://wegrowcherries.com/about/
[ {
"featureType": "water",
"stylers": [ {
"color": "#ffffff" }
] },
{
"featureType": "landscape",
"elementType": "geometry",
"stylers": [ {
"color": "#000000" }
] },
{
"featureType": "administrative",
"elementType": "labels.text.fill",
"stylers": [ {
"color": "#ffffff" }
] },
{
"featureType": "administrative",
"elementType": "labels.text.stroke",
"stylers": [ {
"visibility": "simplified" }
] },
{
"featureType": "road",
"elementType": "geometry",
"stylers": [ {
"visibility": "off" }
] },
{
"featureType": "poi",
"elementType": "geometry.fill",
"stylers": [ {
"color": "#000000" }, {
"visibility": "simplified" }
]},
{
"featureType": "administrative.province",
"stylers": [ {
"visibility": "off" }
]},
{
"featureType": "road",
"elementType": "geometry.stroke",
"stylers": [ {
"color": "#ffffff" }, {
"weight": 2 }, {
"visibility": "off" }
]},
{
"featureType": "administrative.locality",
"stylers": [ { "visibility": "off" }
]},
{
"featureType": "road",
"elementType": "labels",
"stylers": [ {
"visibility": "off" }
] },
{
"featureType": "poi",
"stylers": [ {
"visibility": "off" }
] },
{
"featureType": "transit",
"stylers": [ {
"visibility": "off" }
]},
{
"featureType": "administrative.neighborhood",
"stylers": [ {
"visibility": "off" }
] }]
iframe code in wordpress blog. Can I paste the above in here with a style="" tag?
<iframe style="border: 0; width: 100%" src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d4046390.158269976!2d114.49410816221383!3d-7.941674640018978!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x2dd141d3e8100fa1%3A0x24910fb14b24e690!2sBali%2C+Indonesia!5e0!3m2!1sen!2sus!4v1390525274478" height="250" width="900" frameborder="0"></iframe>

The correct (and legal ) way to do this is using the use their Styled Maps Api
It looks like the code above is using that API. As detailed in the Styled Maps API page, you have to create a StyledMapType (like your code above) and pass it to the constructor in your javascript.
Creating a StyledMapType
You can create a new map type to which to apply styles, by creating a
StyledMapType and passing the feature and styler information to the
constructor. This approach does not affect the style of the default
map types.

Related

Google Assistant does not recognize traits name_synonym in italian

I have an issue with the google assistant and my smart home action.
I have implemented the sync intent and this is what I get:
{
"requestId": "15365687660984021903",
"payload": {
"agentUserId": <user_id>,
"devices": [{
"willReportState": true,
"traits": ["action.devices.traits.OnOff", "action.devices.traits.Toggles", "action.devices.traits.FanSpeed", "action.devices.traits.SensorState", "action.devices.traits.HumiditySetting", "action.devices.traits.TemperatureControl", "action.devices.traits.Modes"],
"deviceInfo": {
"model": <model>,
"swVersion": "1.0.0",
"hwVersion": "1.0.0",
"manufacturer": <manufacturer>
},
"name": {
"defaultNames": [],
"name": "Smart Hood",
"nicknames": ["Cop"]
},
"attributes": {
"queryOnlyModes": false,
"availableToggles": [{
"name_values": [{
"name_synonym": ["Light", "Lights"],
"lang": "en"
}, {
"lang": "it",
"name_synonym": ["Luci", "Luce"]
}],
"name": "light"
}, {
"name": "motor",
"name_values": [{
"name_synonym": ["Motor", "Fan"],
"lang": "en"
}, {
"name_synonym": ["Motore", "Ventola"],
"lang": "it"
}]
}],
"commandOnlyModes": true,
"commandOnlyToggles": true,
"temperatureUnitForUX": "C",
"queryOnlyOnOff": false,
"humiditySetpointRange": {
"maxPercent": 100,
"minPercent": 0
},
"queryOnlyTemperatureControl": true,
"queryOnlyHumiditySetting": true,
"commandOnlyOnOff": true,
"commandOnlyFanSpeed": true,
"temperatureRange": {
"minThresholdCelsius": -100,
"maxThresholdCelsius": 100
},
"sensorStatesSupported": [{
"descriptiveCapabilities": {
"availableStates": ["good", "fair", "poor", "unknown"]
},
"name": "AirQuality"
}, {
"descriptiveCapabilities": {
"availableStates": ["clean", "dirty", "needs replacement", "unknown"]
},
"name": "FilterCleanliness"
}, {
"descriptiveCapabilities": {
"availableStates": ["good", "replace soon", "replace now", "unknown"]
},
"name": "FilterLifeTime",
"numericCapabilities": {
"rawValueUnit": "PERCENTAGE"
}
}],
"availableModes": [{
"name": "operatingStatus",
"name_values": [{
"name_synonym": ["Hood mode", "Motor Mode", "Fan Mode"],
"lang": "en"
}, {
"name_synonym": ["Funzione", "Modalità"],
"lang": "it"
}],
"settings": [{
"setting_values": [{
"lang": "en",
"setting_synonym": ["Normal"]
}, {
"lang": "it",
"setting_synonym": ["Normale"]
}],
"setting_name": "normal"
}, {
"setting_name": "auto",
"setting_values": [{
"lang": "en",
"setting_synonym": ["Auto"]
}, {
"lang": "it",
"setting_synonym": ["Auto", "Automatica"]
}]
}, {
"setting_values": [{
"lang": "en",
"setting_synonym": ["Intensive", "Boost"]
}, {
"setting_synonym": ["Intensiva", "Boost"],
"lang": "it"
}],
"setting_name": "intensive"
}, {
"setting_name": "24h",
"setting_values": [{
"setting_synonym": ["24 hours", "h24", "24h"],
"lang": "en"
}, {
"setting_synonym": ["24 ore", "h24", "24h"],
"lang": "it"
}]
}],
"ordered": false
}],
"commandOnlyTemperatureControl": false,
"queryOnlyToggles": false,
"commandOnlyHumiditySetting": false,
"availableFanSpeeds": {
"ordered": false,
"speeds": [{
"speed_values": [{
"speed_synonym": ["Low", "Slow"],
"lang": "en"
}, {
"speed_synonym": ["Bassa", "Lenta"],
"lang": "it"
}],
"speed_name": "low"
}, {
"speed_values": [{
"lang": "en",
"speed_synonym": ["Medium"]
}, {
"lang": "it",
"speed_synonym": ["Medio"]
}],
"speed_name": "medium"
}, {
"speed_values": [{
"lang": "en",
"speed_synonym": ["High", "Fast"]
}, {
"lang": "it",
"speed_synonym": ["Alta", "Veloce"]
}],
"speed_name": "high"
}]
}
},
"type": "action.devices.types.HOOD",
"id": <device_id>
}]
}
}
Until yesterday it worked perfectly.
The problem is that today the google assistant does not recognize the italian synonym but only the ones in english.
But in the response it uses the italian synonym!
The issue started to happen after I choose the language in the Actions console.
what could the problem be?
Thanks for helping.
There are always updates being rolled out from Google on voice recognition features. Sometimes, new traits are modified/added/removed in the most recent update. The language assistant responds you with depends on the language selected in the device, but how the request is parsed depends on a number of factors. Make sure the italian is selected from the settings in the Actions on Google Console, as well as the device you issue the commands from.
If the issue still persists, please open a bug on our Public Issue Tracker.

Problem With Adding Custom Styling to ReactJS Google Map

I am trying to add custom styling to my google map on React JS, but I keep running into the same problem.
When I implement the styling(I have tried it in several ways) and launch my app the map disappears and instead I only have a white screen(however, the map shows when I run the default styling).
Here is my code:
import React, { Component } from 'react';
import { Map, GoogleApiWrapper, InfoWindow, Marker } from 'google-maps-react';
const key = 'key'
export class MapContainer extends Component {
state = {
showingInfoWindow: false,
activeMarker: {},
selectedPlace: {},
markers: [
//Array of markers
],
};
onMarkerClick = (props, marker, e) =>
this.setState({
selectedPlace: props,
activeMarker: marker,
showingInfoWindow: true
});
onClose = props => {
if (this.state.showingInfoWindow) {
this.setState({
showingInfoWindow: false,
activeMarker: null
});
}
};
render() {
return (
<Map
google={this.props.google}
zoom={14}
style={this.props.mapStyles}
initialCenter={{ lat: 49.166590, lng: -123.133569 }}
>
{this.state.markers.map((marker, index) => (
<Marker
key={index}
onClick={this.onMarkerClick}
name={marker.name}
position={marker.position}
/>
))}
<InfoWindow
marker={this.state.activeMarker}
visible={this.state.showingInfoWindow}
onClose={this.onClose}
>
<div>
<h4>{this.state.selectedPlace.name}</h4>
</div>
</InfoWindow>
</Map>
);
}
}
MapContainer.defaultProps = {
mapStyles: [
{
elementType: 'geometry',
stylers: [
{
color: '#242f3e'
}
]
},
{
elementType: 'labels.text.fill',
stylers: [
{
color: '#746855'
}
]
},
{
elementType: 'labels.text.stroke',
stylers: [
{
color: '#242f3e'
}
]
},
{
featureType: 'administrative.land_parcel',
elementType: 'labels',
stylers: [
{
visibility: 'off'
}
]
},
{
featureType: 'administrative.locality',
elementType: 'labels.text.fill',
stylers: [
{
color: '#d59563'
}
]
},
{
featureType: 'poi',
elementType: 'labels.text',
stylers: [
{
visibility: 'off'
}
]
},
{
featureType: 'poi',
elementType: 'labels.text.fill',
stylers: [
{
color: '#d59563'
}
]
},
{
featureType: 'poi.business',
stylers: [
{
visibility: 'off'
}
]
},
{
featureType: 'poi.park',
elementType: 'geometry',
stylers: [
{
color: '#263c3f'
}
]
},
{
featureType: 'poi.park',
elementType: 'labels.text',
stylers: [
{
visibility: 'off'
}
]
},
{
featureType: 'poi.park',
elementType: 'labels.text.fill',
stylers: [
{
color: '#6b9a76'
}
]
},
{
featureType: 'road',
elementType: 'geometry',
stylers: [
{
color: '#38414e'
}
]
},
{
featureType: 'road',
elementType: 'geometry.stroke',
stylers: [
{
color: '#212a37'
}
]
},
{
featureType: 'road',
elementType: 'labels.text.fill',
stylers: [
{
color: '#9ca5b3'
}
]
},
{
featureType: 'road.highway',
elementType: 'geometry',
stylers: [
{
color: '#746855'
}
]
},
{
featureType: 'road.highway',
elementType: 'geometry.stroke',
stylers: [
{
color: '#1f2835'
}
]
},
{
featureType: 'road.highway',
elementType: 'labels.text.fill',
stylers: [
{
color: '#f3d19c'
}
]
},
{
featureType: 'road.local',
elementType: 'labels',
stylers: [
{
visibility: 'off'
}
]
},
{
featureType: 'transit',
elementType: 'geometry',
stylers: [
{
color: '#2f3948'
}
]
},
{
featureType: 'transit.station',
elementType: 'labels.text.fill',
stylers: [
{
color: '#d59563'
}
]
},
{
featureType: 'water',
elementType: 'geometry',
stylers: [
{
color: '#17263c'
}
]
},
{
featureType: 'water',
elementType: 'labels.text.fill',
stylers: [
{
color: '#515c6d'
}
]
},
{
featureType: 'water',
elementType: 'labels.text.stroke',
stylers: [
{
color: '#17263c'
}
]
}
]
}
export default GoogleApiWrapper({
apiKey: key
})(MapContainer);
Been struggling with this for a couple hours, turned Google inside out for tutorials and followed many several times but to no avail. Any help would be greatly appreciated :)
I successfully implemented custom mapstyle using the syntax from the google-maps-react library documentation.
Here is my sample code. Make sure to change the value of the API key in the GoogleApiWrapper for the code to run. You can also use the Google Maps Styling Wizard to easily create styles for your map.
import React, { Component } from "react";
import { Map, Marker, GoogleApiWrapper } from "google-maps-react";
const mapStyle = [
{
elementType: "geometry",
stylers: [
{
color: "#1d2c4d"
}
]
},
{
elementType: "labels.text.fill",
stylers: [
{
color: "#8ec3b9"
}
]
},
{
elementType: "labels.text.stroke",
stylers: [
{
color: "#1a3646"
}
]
},
{
featureType: "administrative.country",
elementType: "geometry.stroke",
stylers: [
{
color: "#4b6878"
}
]
},
{
featureType: "administrative.land_parcel",
elementType: "labels.text.fill",
stylers: [
{
color: "#64779e"
}
]
},
{
featureType: "administrative.province",
elementType: "geometry.stroke",
stylers: [
{
color: "#4b6878"
}
]
},
{
featureType: "landscape.man_made",
elementType: "geometry.stroke",
stylers: [
{
color: "#334e87"
}
]
},
{
featureType: "landscape.natural",
elementType: "geometry",
stylers: [
{
color: "#023e58"
}
]
},
{
featureType: "poi",
elementType: "geometry",
stylers: [
{
color: "#283d6a"
}
]
},
{
featureType: "poi",
elementType: "labels.text.fill",
stylers: [
{
color: "#6f9ba5"
}
]
},
{
featureType: "poi",
elementType: "labels.text.stroke",
stylers: [
{
color: "#1d2c4d"
}
]
},
{
featureType: "poi.park",
elementType: "geometry.fill",
stylers: [
{
color: "#023e58"
}
]
},
{
featureType: "poi.park",
elementType: "labels.text.fill",
stylers: [
{
color: "#3C7680"
}
]
},
{
featureType: "road",
elementType: "geometry",
stylers: [
{
color: "#304a7d"
}
]
},
{
featureType: "road",
elementType: "labels.text.fill",
stylers: [
{
color: "#98a5be"
}
]
},
{
featureType: "road",
elementType: "labels.text.stroke",
stylers: [
{
color: "#1d2c4d"
}
]
},
{
featureType: "road.highway",
elementType: "geometry",
stylers: [
{
color: "#2c6675"
}
]
},
{
featureType: "road.highway",
elementType: "geometry.stroke",
stylers: [
{
color: "#255763"
}
]
},
{
featureType: "road.highway",
elementType: "labels.text.fill",
stylers: [
{
color: "#b0d5ce"
}
]
},
{
featureType: "road.highway",
elementType: "labels.text.stroke",
stylers: [
{
color: "#023e58"
}
]
},
{
featureType: "transit",
elementType: "labels.text.fill",
stylers: [
{
color: "#98a5be"
}
]
},
{
featureType: "transit",
elementType: "labels.text.stroke",
stylers: [
{
color: "#1d2c4d"
}
]
},
{
featureType: "transit.line",
elementType: "geometry.fill",
stylers: [
{
color: "#283d6a"
}
]
},
{
featureType: "transit.station",
elementType: "geometry",
stylers: [
{
color: "#3a4762"
}
]
},
{
featureType: "water",
elementType: "geometry",
stylers: [
{
color: "#0e1626"
}
]
},
{
featureType: "water",
elementType: "labels.text.fill",
stylers: [
{
color: "#4e6d70"
}
]
}
];
export class MapContainer extends Component {
_mapLoaded(mapProps, map) {
map.setOptions({
styles: mapStyle
});
}
render() {
const coords = { lat: -21.805149, lng: -49.0921657 };
return (
<Map
style={this.mapStyle}
google={this.props.google}
zoom={7}
initialCenter={coords}
onReady={(mapProps, map) => this._mapLoaded(mapProps, map)}
>
<Marker position={coords} />
</Map>
);
}
}
export default GoogleApiWrapper({
apiKey: "YOUR_API_KEY"
})(MapContainer);
Hope this helps!
You can use default props for this. The custom Style json data should be a default props. Here is a working solution :
import React, { Component } from "react";
import { Map, GoogleApiWrapper } from "google-maps-react";
export class MapContainer extends Component {
render() {
return (
<Map
google={this.props.google}
zoom={14}
styles={this.props.mapStyles}
initialCenter={{
lat: 51.1657,
lng: 10.4515,
}}
/>
);
}
}
//this is how you make the style a defaultprops for the component.
//best way is to add the design json data in a separte line
// go here for different Map style and customization : http://snazzymaps.com/
MapContainer.defaultProps = {
mapStyles: [
{
"featureType": "all",
"elementType": "labels",
"stylers": [
{
"visibility": "on"
}
]
},
{
"featureType": "all",
"elementType": "labels.text",
"stylers": [
{
"visibility": "on"
}
]
},
{
"featureType": "all",
"elementType": "labels.text.fill",
"stylers": [
{
"saturation": 36
},
{
"color": "#111111"
},
{
"lightness": 60
}
]
},
{
"featureType": "all",
"elementType": "labels.text.stroke",
"stylers": [
{
"visibility": "on"
},
{
"color": "#000000"
},
{
"lightness": 16
}
]
},
{
"featureType": "all",
"elementType": "labels.icon",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "administrative",
"elementType": "geometry.fill",
"stylers": [
{
"color": "#000000"
}
]
},
{
"featureType": "administrative",
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 17
},
{
"weight": 1.2
}
]
},
{
"featureType": "administrative",
"elementType": "labels",
"stylers": [
{
"visibility": "on"
}
]
},
{
"featureType": "administrative",
"elementType": "labels.text",
"stylers": [
{
"visibility": "on"
}
]
},
{
"featureType": "administrative.country",
"elementType": "all",
"stylers": [
{
"visibility": "simplified"
}
]
},
{
"featureType": "administrative.country",
"elementType": "geometry",
"stylers": [
{
"visibility": "simplified"
}
]
},
{
"featureType": "administrative.country",
"elementType": "labels.text",
"stylers": [
{
"visibility": "simplified"
}
]
},
{
"featureType": "administrative.province",
"elementType": "all",
"stylers": [
{
"visibility": "on"
}
]
},
{
"featureType": "administrative.locality",
"elementType": "all",
"stylers": [
{
"visibility": "simplified"
},
{
"saturation": "-100"
},
{
"lightness": "30"
}
]
},
{
"featureType": "administrative.neighborhood",
"elementType": "all",
"stylers": [
{
"visibility": "on"
}
]
},
{
"featureType": "administrative.land_parcel",
"elementType": "all",
"stylers": [
{
"visibility": "on"
}
]
},
{
"featureType": "landscape",
"elementType": "all",
"stylers": [
{
"visibility": "simplified"
},
{
"gamma": "0.00"
},
{
"lightness": "74"
}
]
},
{
"featureType": "landscape",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 20
}
]
},
{
"featureType": "landscape",
"elementType": "labels",
"stylers": [
{
"visibility": "on"
}
]
},
{
"featureType": "landscape",
"elementType": "labels.text",
"stylers": [
{
"visibility": "on"
}
]
},
{
"featureType": "landscape.man_made",
"elementType": "all",
"stylers": [
{
"lightness": "3"
}
]
},
{
"featureType": "poi",
"elementType": "all",
"stylers": [
{
"visibility": "on"
}
]
},
{
"featureType": "poi",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 40
}
]
},
{
"featureType": "poi",
"elementType": "labels",
"stylers": [
{
"visibility": "on"
}
]
},
{
"featureType": "poi",
"elementType": "labels.text",
"stylers": [
{
"visibility": "on"
}
]
},
{
"featureType": "road",
"elementType": "geometry",
"stylers": [
{
"visibility": "simplified"
},
{
"color": "#424242"
},
{
"lightness": "-61"
}
]
},
{
"featureType": "road",
"elementType": "labels",
"stylers": [
{
"visibility": "on"
}
]
},
{
"featureType": "road",
"elementType": "labels.text",
"stylers": [
{
"visibility": "on"
}
]
},
{
"featureType": "road.highway",
"elementType": "geometry.fill",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 17
}
]
},
{
"featureType": "road.highway",
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 29
},
{
"weight": 0.2
}
]
},
{
"featureType": "road.arterial",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 18
}
]
},
{
"featureType": "road.local",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 16
}
]
},
{
"featureType": "transit",
"elementType": "geometry",
"stylers": [
{
"color": "#2a2727"
},
{
"lightness": "-61"
},
{
"saturation": "-100"
}
]
},
{
"featureType": "transit",
"elementType": "labels",
"stylers": [
{
"visibility": "on"
}
]
},
{
"featureType": "water",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 17
}
]
},
{
"featureType": "water",
"elementType": "labels",
"stylers": [
{
"visibility": "on"
}
]
},
{
"featureType": "water",
"elementType": "labels.text",
"stylers": [
{
"visibility": "on"
}
]
}
]
};
export default GoogleApiWrapper({
apiKey: "your API key goes here",
})(MapContainer);

get dynamic data from the slot ? not added resolutionsPerAuthority's dynamic element in the list

I am trying to get dynamic data from the slot
As per documentation and my basic test I am sending directive from launch request as like :
{'version': '1.0', 'response': {'outputSpeech': {'type': 'SSML', 'ssml': '<speak> Hi, welcome to developement dynamic slot. <break time="800ms"/>Please tell me the product name you would be interested in</speak>'}, 'card': {'type': 'Simple', 'title': 'Choose a Medicine.', 'content': 'Pick a Medicine.'}, 'reprompt': {'outputSpeech': {'type': 'SSML', 'ssml': '<speak><break time="5s"/>I am HERE to help You, Please tell me the product and country names you would be interested in.</speak>'}}, 'shouldEndSession': False}, 'directives': [{'type': 'Dialog.UpdateDynamicEntities', 'updateBehavior': 'REPLACE', 'types': [{'name': 'products', 'values': [{'id': 'grnTea', 'name': {'value': 'green tea', 'synonyms': ['matcha']}}, {'id': 'oolTea', 'name': {'value': 'oolong', 'synonyms': ['chinese tea', 'black dragon tea']}}]}]}]}
and when I'm trying to get data which is not statically store in a slot but added in directive slot value.
returns following output :
{ "version": "1.0", "session": { "new": false, "sessionId": "amzn1.echo-api.session.671181ed-1e50-4e4c-b70e-4d854fe7cb78", "application": { "applicationId": "amzn1.ask.skill.c35cd12c-6845-473e-be58-9b1139ee0adb" }, "user": { "userId": "amzn1.ask.account.sadasdsa", "permissions": { "consentToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjEifQ..XyWgyUIjDzzlZ12CR0lbZid6GxwZZYBgarlV-9difbkFjOTxrcvS9lJYWo-Db3wo-fIdXb_jZkCAJBtYPggqnJhLyyC-EDa0_u9aARKthF1_nkbLh5zDOHDb8MyyOYro4BJlqm4XBNd1qyeQUV2M4fdca1YSEnbEun_6kWOKeFRS-14zcwMj5E-MHcBbeDX799A_kay82kS8VGeMhSUsXPTZFrwOKHcFweJTqXFNOkBxME8kAFfS1JB5MNbA3TujVIsIgTBSNQaJeHRksConKt0u06ATrjffzFkcmbxDT5HoJH4NqDgS0y_GdtaeXQM3LJ-MN0-_DMX2QVEaL6kUUw" } } }, "context": { "System": { "application": { "applicationId": "amzn1.ask.skill.c35cd12c-6845-473e-be58-9b1139ee0adb" }, "user": { "userId": "amzn1.ask.account.aasdasdasdasdas", "permissions": { "consentToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjEifQ.asdjaskdhas.XyWgyUIjDzzlZ12CR0lbZid6GxwZZYBgarlV-9difbkFjOTxrcvS9lJYWo-Db3wo-fIdXb_jZkCAJBtYPggqnJhLyyC-EDa0_u9aARKthF1_nkbLh5zDOHDb8MyyOYro4BJlqm4XBNd1qyeQUV2M4fdca1YSEnbEun_6kWOKeFRS-14zcwMj5E-MHcBbeDX799A_kay82kS8VGeMhSUsXPTZFrwOKHcFweJTqXFNOkBxME8kAFfS1JB5MNbA3TujVIsIgTBSNQaJeHRksConKt0u06ATrjffzFkcmbxDT5HoJH4NqDgS0y_GdtaeXQM3LJ-MN0-_DMX2QVEaL6kUUw" } }, "device": { "deviceId": "amzn1.ask.device.ajshdjkhasjkhdkjsahkasdhjasd", "supportedInterfaces": {} }, "apiEndpoint": "https://api.eu.amazonalexa.com", "apiAccessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjEifQ.asdhjashjdhajsd.RQhzWmnhN9K_dCbsFXBPPoLVzuwe5BWjAruwJNF1pVr11PiygVgQ64W3CNng2sK1thT2tl6r3GuRtG-1133Aw1KPWtMuHElu7CTrFfgAqW8blpK37PJIvPMOUGBw1rbrgCTMdy8Ua7qSFV_Y_wlOJaV3-apDGBqhQKE_-dE-ntWYZuIySlY3l8hBs_66eELS-LiL5DEDJk1hfvC2C6ZFB7A7P8mx4Hb71km-lYaElJS0-FDP0C-LdSp6dCbzV23W4JehtTGL4kJ1JEQgWyuNAAkt_HmPcEYlPp8T5RFceDuVuz-ZZBFyiVKuAN8VmxyFsmnC3SXi4yb3RKm1SCcorg" }, "Viewport": { "experiences": [ { "arcMinuteWidth": 246, "arcMinuteHeight": 144, "canRotate": false, "canResize": false } ], "shape": "RECTANGLE", "pixelWidth": 1024, "pixelHeight": 600, "dpi": 160, "currentPixelWidth": 1024, "currentPixelHeight": 600, "touch": [ "SINGLE" ], "video": { "codecs": [ "H_264_42", "H_264_41" ] } }, "Viewports": [ { "type": "APL", "id": "main", "shape": "RECTANGLE", "dpi": 160, "presentationType": "STANDARD", "canRotate": false, "configuration": { "current": { "video": { "codecs": [ "H_264_42", "H_264_41" ] }, "size": { "type": "DISCRETE", "pixelWidth": 1024, "pixelHeight": 600 } } } } ] }, "request": { "type": "IntentRequest", "requestId": "amzn1.echo-api.request.0f3b51f1-880b-483f-8410-3210e81e5b59", "timestamp": "2020-01-01T11:48:09Z", "locale": "en-IN", "intent": { "name": "productcheck", "confirmationStatus": "NONE", "slots": { "products": { "name": "products", "value": "green tea", "resolutions": { "resolutionsPerAuthority": [ { "authority": "amzn1.er-authority.echo-sdk.amzn1.ask.skill.c35cd12c-6845-473e-be58-9b1139ee0adb.products", "status": { "code": "ER_SUCCESS_NO_MATCH" } } ] }, "confirmationStatus": "NONE", "source": "USER" } } } } }
It's not added resolutions resolutionsPerAuthority's second(dynamic) element in the list.
anybody can help me out from this problem?
I tested your added directive exactly as pasted and the dynamic entity resolved as expected:
"slots": {
"products": {
"name": "products",
"value": "matcha",
"resolutions": {
"resolutionsPerAuthority": [
{
"authority": "amzn1.er-authority.echo-sdk.amzn1.ask.skill.****.products",
"status": {
"code": "ER_SUCCESS_NO_MATCH"
}
},
{
"authority": "amzn1.er-authority.echo-sdk.dynamic.amzn1.ask.skill.****.products",
"status": {
"code": "ER_SUCCESS_MATCH"
},
"values": [
{
"value": {
"name": "green tea",
"id": "grnTea"
}
}
]
}
]
},
"confirmationStatus": "NONE",
"source": "USER"
}
}
Could you share your skill's interaction model to investigate further?

Some Modes on action.devices.traits.Modes does not seem to be working

I'm playing around with action.devices.traits.Modes trait, and it seems that I cannot get some Mode to work, though I'm 100% sure that I've used mode names exactly as in the documentation.
SYNC Response:
Response {
"status": 200,
"headers": {
"content-type": "application/json;charset=utf-8"
},
"body": {
"requestId": "15896565509066911859",
"payload": {
"agentUserId": "",
"devices": [
{
"id": "Washer",
"type": "action.devices.types.WASHER",
"traits": [
"action.devices.traits.Modes",
"action.devices.traits.OnOff"
],
"name": {
"defaultNames": [
"Washer"
],
"name": "Washer",
"nicknames": [
"Washer"
]
},
"willReportState": false,
"customData": {
"lookupOnExecute": true
},
"attributes": {
"availableModes": [
{
"name": "temperature",
"name_values": [
{
"name_synonym": [
"temperature"
],
"lang": "en"
}
],
"settings": [
{
"setting_name": "Tap Cold",
"setting_values": [
{
"setting_synonym": [
"tap cold"
],
"lang": "en"
}
]
},
{
"setting_name": "Cold Warm",
"setting_values": [
{
"setting_synonym": [
"cold warm"
],
"lang": "en"
}
]
},
{
"setting_name": "Hot",
"setting_values": [
{
"setting_synonym": [
"hot"
],
"lang": "en"
}
]
},
{
"setting_name": "Extra Hot",
"setting_values": [
{
"setting_synonym": [
"extra hot"
],
"lang": "en"
}
]
}
],
"ordered": false
},
{
"name": "Cycle",
"name_values": [
{
"name_synonym": [
"cycle"
],
"lang": "en"
}
],
"settings": [
{
"setting_name": "Low",
"setting_values": [
{
"setting_synonym": [
"low"
],
"lang": "en"
}
]
},
{
"setting_name": "Medium",
"setting_values": [
{
"setting_synonym": [
"medium"
],
"lang": "en"
}
]
},
{
"setting_name": "High",
"setting_values": [
{
"setting_synonym": [
"high"
],
"lang": "en"
}
]
}
],
"ordered": false
}
]
}
}
]
}
}
}
QUERY response:
Response {
"status": 200,
"headers": {
"content-type": "application/json;charset=utf-8"
},
"body": {
"requestId": "17335788264128789760",
"payload": {
"devices": {
"Washer": {
"online": true,
"currentModeSettings": {
"Cycle": "High",
"temperature": "Tap Cold"
},
"on": true
}
}
}
}
}
Why does Cycle query fail? I see Cycle mode in the documentation. Does it support only some settings? Does the case matter? High is also available, so what am I doing wrong?
And Interaction with Google Home:
While the Google Assistant is highly capable of detecting variations in speech while receiving voice commands, it is still a good practice to make the grammar more understandable and as mentioned in the comments. This is related to an issue in the usage of grammar while triggering the right intent, since a change in the way the question was asked solved the purpose.
For the answer to the question "how can I combine Two toggles (Bluetooth and Power Saving) into one trigger – e.g. "Turn on Power Saving and Bluetooth on Home Cinema?" asked in the comments – at the moment Smart Home doesn't allow two commands in a single prompt. For example, you cannot say "Hey Google, turn on my light and change the color". In order to do that you have to execute each command separately.

Support for ColorSetting trait on non-Light device types

Our hood supports a backlight which supports full RGB color change. The backlight on/off switch was implemented with a trigger, and we implemented the ColorSetting trait to change the color.
When trying to use Google Assistant to change the color however, we get the reply 'It looks like the device hasn't been set up yet'.
We tried changing the device type to 'Light', and the commands to change colors work flawlessly. Is the ColorSetting trait restricted to Light type only, and is there a workaround for this?
Thanks for your help
Edit: SYNC response for hood:
{
"requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
"payload": {
"agentUserId": "userID",
"devices": [
{
"id": "HAID",
"type": "action.devices.types.HOOD",
"traits": [
"action.devices.traits.OnOff",
"action.devices.traits.StartStop",
"action.devices.traits.Modes",
"action.devices.traits.FanSpeed",
"action.devices.traits.Toggles",
"action.devices.traits.ColorSetting"
],
"deviceInfo": {
"manufacturer": "MANUFACTURER",
"model": "MODEL",
"hwVersion": "",
"swVersion": ""
},
"name": {
"name": "Dunstabzugshaube",
"nicknames": [
"Dunstabzugshaube"
],
"defaultNames": [
"Dunstabzugshaube"
]
},
"willReportState": true,
"attributes": {
"pausable": false,
"availableModes": [
{
"name": "program",
"name_values": [
{
"name_synonym": [
"program"
],
"lang": "en"
}
],
"settings": [
{
"setting_name": "Auto",
"setting_values": [
{
"lang": "en",
"setting_synonym": [
"auto",
"automatic"
]
}
]
},
{
"setting_name": "circulation",
"setting_values": [
{
"lang": "en",
"setting_synonym": [
"circulation",
"ventilation",
"airflow",
"air flow"
]
}
]
}
],
"ordered": false
}
],
"availableFanSpeeds": {
"speeds": [
{
"speed_name": "S1",
"speed_values": [
{
"lang": "en",
"speed_synonym": [
"fan stage 1",
"Fan Stage 1",
"lowest",
"one"
]
},
{
"lang": "de",
"speed_synonym": [
"lüfter stufe 1",
"Lüfter Stufe 1",
"minimum",
"eins",
"Stufe 1"
]
}
]
},
{
"speed_name": "S2",
"speed_values": [
{
"lang": "en",
"speed_synonym": [
"fan stage 2",
"Fan Stage 2",
"low",
"two"
]
},
{
"lang": "de",
"speed_synonym": [
"lüfter stufe 2",
"Lüfter Stufe 2",
"niedrig",
"zwei",
"Stufe 2"
]
}
]
},
{
"speed_name": "S3",
"speed_values": [
{
"lang": "en",
"speed_synonym": [
"fan stage 3",
"Fan Stage 3",
"medium",
"three"
]
},
{
"lang": "de",
"speed_synonym": [
"lüfter stufe 3",
"Lüfter Stufe 3",
"mittel",
"drei",
"Stufe 3"
]
}
]
}
],
"ordered": true
},
"reversible": false,
"colorModel": "rgb",
"commandOnlyColorSetting": true,
"availableToggles": [
{
"name": "Light",
"name_values": [
{
"name_synonym": [
"light"
],
"lang": "en"
}
]
},
{
"name": "backlight",
"name_values": [
{
"name_synonym": [
"backlight",
"mood light"
],
"lang": "en"
},
{
"name_synonym": [
"Hintergrundbeleuchtung",
"Stimmungslicht"
],
"lang": "de"
}
]
}
]
}
}
]
}
}
Best,
Frank
Your sync response provided above looks correct. Your concern about the command working flawlessly when you set the device type as LIGHT is because LIGHT does have a recommended trait as ColorSetting. To clarify your concern further, some device types do have better support for certain types of relevant grammar/language, which might explain why ColorSetting works better when the device type is set to light.
Google constantly works on the NLU (Natural Language Understanding) algorithms, so this grammar issue would be resolved by now and the ColorSetting trait should now be widely accessible to more devices.
More information about the HOOD and LIGHT device types and their associated traits along with sync, execute and query responses can be found here:
https://developers.google.com/assistant/smarthome/guides/hood
https://developers.google.com/assistant/smarthome/guides/light

Resources