Release Candidate and Support: Amazon Echo Control Binding

I set it on the device itself or use the App and go to the device settings. It prevents all sounds during your defined periods except of course alarms and timers.

I have not seen if there is way to do that using the binding but it would be interesting if there was

I requested it here:

you more or less explained it already.

  • define a routine in your app
  • then call the routine from within OH with the below command call to the StartRoutine item
Echo_Living_Room_StartRoutine.sendCommand('YourRoutine')
1 Like

Hello,
i have this problem which prevents from setting the color of a light bulb connected to openhab via alexa; when trying to change the color using the colorpicker item defined as follows

Color IAZ_006_color “Colore” {channel=“amazonechocontrol:smartHomeDevice:AZN_000_account:AZN_006_porta:color” }

openhab.log shows this message:

[INFO ] [mazonechocontrol.internal.Connection] - Smart home device command failed.
[INFO ] [mazonechocontrol.internal.Connection] - Request:
[INFO ] [mazonechocontrol.internal.Connection] - {“controlRequests”:[{“entityId”:“b89ffc57-3fc1-4a48-85c2-20b43ecd578c”,“entityType”:“APPLIANCE”,“parameters”:{“action”:“setColor”,“color”:{“hue”:227,“saturation”:0.92,“brightness”:1.0}}}]}
[INFO ] [mazonechocontrol.internal.Connection] - Answer:
[INFO ] [mazonechocontrol.internal.Connection] - {“entity”:{“entityId”:“b89ffc57-3fc1-4a48-85c2-20b43ecd578c”,“entityType”:“APPLIANCE”},“code”:“FAILURE_TO_SEND”,“message”:“Validation failed with the following error(s): [InvalidParameters: [StringParameter(value=)] for action setColor]”,“data”:null}

and the color does not change. However if a try to set/change the colorName of the same item:

String IAZ_006_colorname “Nome Colore” {channel=“amazonechocontrol:smartHomeDevice:AZN_000_account:AZN_006_porta:colorName” }

no error messages appears in the log and the bulbs changes its color.

this is the sitemap:

Frame label=“Porta” {
Switch item=IAZ_006_stato
Slider item=IAZ_006_luninosita
Colorpicker item=IAZ_006_color
Selection item=IAZ_006_colorname mappings=[ ‘red’=‘Red’, ‘green’=‘Green’, ‘blue’=‘Blue’ ]
}

Am i doing something wrong with items/sitemap configuration or it is a known issue?
Please note that i can also turn on/off the bulb using the switch item so i do not think is a thing configuration problem.
I am running:

133 │ Active │ 80 │ 2.5.0 │ openHAB Core :: Bundles :: Core
286 │ Active │ 80 │ 2.5.11.202011051557 │ openHAB Add-ons :: Bundles :: Amazon Echo Control Binding

thanks in advance and thanks for your huge work on this binding

Looks like a bug. Can you please show request and response for the working command? If possible, also show what happens if you set the color from another device (like a remote control).

Thanks for your prompt reply.
I set the binding to debug log level and this is what happens when i try to change the color via the colorName item:

2020-11-23 12:19:20.832 [DEBUG] [mazonechocontrol.internal.Connection] - Make request to https://alexa.amazon.it/api/phoenix/state
2020-11-23 12:19:20.834 [DEBUG] [mazonechocontrol.internal.Connection] - PUT: {“controlRequests”:[{“entityId”:“b89ffc57-3fc1-4a48-85c2-20b43ecd578c”,“entityType”:“APPLIANCE”,“parameters”:{“action”:“setColor”,“colorName”:“blue”}}]}
2020-11-23 12:19:21.662 [DEBUG] [mazonechocontrol.internal.Connection] - Call to https://alexa.amazon.it/api/phoenix/state succeeded
2020-11-23 12:19:21.662 [DEBUG] [mazonechocontrol.internal.Connection] - Result of PUT https://alexa.amazon.it/api/phoenix/state:{“controlResponses”:[{“code”:“SUCCESS”,“message”:null,“data”:null,“entityId”:“b89ffc57-3fc1-4a48-85c2-20b43ecd578c”}],“errors”:[]}
2020-11-23 12:19:21.663 [DEBUG] [mazonechocontrol.internal.Connection] - {“controlResponses”:[{“code”:“SUCCESS”,“message”:null,“data”:null,“entityId”:“b89ffc57-3fc1-4a48-85c2-20b43ecd578c”}],“errors”:[]}
2020-11-23 12:19:21.663 [DEBUG] [ernal.handler.SmartHomeDeviceHandler] - Command blue sent to SKILL_eyJza2lsbElkIjoiYW16bjEuYXNrLnNraWxsLjI4N2FkMTRmLTdhMjYtNDEzOC05ZmJhLTkxODVmZmUxOWUwNSIsInN0YWdlIjoibGl2ZSJ9_M1GAxtaW9A0LXNwZWMtdjIVgoAFGA55ZWVsaW5rLWNvbG9AyMxUUGAkxMzM4OTA3MDYV0gkA
2020-11-23 12:19:26.308 [DEBUG] [trol.internal.handler.AccountHandler] - updateSmartHomeState started
2020-11-23 12:19:26.309 [DEBUG] [mazonechocontrol.internal.Connection] - Make request to https://alexa.amazon.it/api/phoenix/state
2020-11-23 12:19:26.310 [DEBUG] [mazonechocontrol.internal.Connection] - POST: {“stateRequests”:[{“entityId”:“SKILL_eyJza2lsbElkIjoiYW16bjEuYXNrLnNraWxsLjI4N2FkMTRmLTdhMjYtNDEzOC05ZmJhLTkxODVmZmUxOWUwNSIsInN0YWdlIjoibGl2ZSJ9_M1GAxtaW9A0LXNwZWMtdjIVgoAFGA55ZWVsaW5rLWNvbG9AyMxUUGAkxMzM4OTA3MDYV0gkA”,“entityType”:“APPLIANCE”}]}
2020-11-23 12:19:26.719 [DEBUG] [mazonechocontrol.internal.Connection] - Call to https://alexa.amazon.it/api/phoenix/state succeeded
2020-11-23 12:19:26.720 [DEBUG] [mazonechocontrol.internal.Connection] - Result of POST https://alexa.amazon.it/api/phoenix/state:{“deviceStates”:[{“entity”:{“entityId”:“SKILL_eyJza2lsbElkIjoiYW16bjEuYXNrLnNraWxsLjI4N2FkMTRmLTdhMjYtNDEzOC05ZmJhLTkxODVmZmUxOWUwNSIsInN0YWdlIjoibGl2ZSJ9_M1GAxtaW9A0LXNwZWMtdjIVgoAFGA55ZWVsaW5rLWNvbG9AyMxUUGAkxMzM4OTA3MDYV0gkA”,“entityType”:“CLOUD_DISCOVERED_DEVICE”},“capabilityStates”:["{“namespace”:“Alexa.BrightnessController”,“name”:“brightness”,“value”:100,“timeOfSample”:“2020-11-23T11:19:26.65Z”,“uncertaintyInMilliseconds”:6000,“deepQuery”:true,“timeOfStateChange”:""}","{“namespace”:“Alexa.ColorController”,“name”:“color”,“value”:{“hue”:240.0,“saturation”:1.0,“brightness”:1.0},“timeOfSample”:“2020-11-23T11:19:26.65Z”,“uncertaintyInMilliseconds”:6000,“deepQuery”:true,“timeOfStateChange”:""}","{“namespace”:“Alexa.PowerController”,“name”:“powerState”,“value”:“ON”,“timeOfSample”:“2020-11-23T11:19:26.649Z”,“uncertaintyInMilliseconds”:6000,“deepQuery”:true,“timeOfStateChange”:""}","{“namespace”:“Alexa.EndpointHealth”,“name”:“connectivity”,“value”:{“value”:“OK”},“timeOfSample”:“2020-11-23T11:19:22.697Z”,“uncertaintyInMilliseconds”:6000,“deepQuery”:false,“timeOfStateChange”:“2020-11-23T08:19:03.269Z”}","{“namespace”:“Alexa.ColorPropertiesController”,“name”:“colorProperties”,“timeOfSample”:“2020-11-23T11:19:26.65Z”,“timeOfStateChange”:"",“uncertaintyInMilliseconds”:6000,“value”:{“name”:“blue”,“localizationMap”:{“en”:“Blue”,“en-US”:“Blue”,“en-UK”:“Blue”,“de”:“Blau”,“jp”:“青”,“fr”:“Bleu”,“it”:“Blu”,“es-ES”:“Azul”,“es-MX”:“Azul”,“pt-BR”:“Azul”,“es-US”:“Azul”,“hi-IN”:“नीला”}},“deepQuery”:true}"],“error”:null}],“errors”:[]}

and this is what is logged when i change the color from alexa app on my mobile:

2020-11-23 12:19:18.941 [DEBUG] [mazonechocontrol.internal.Connection] - Make request to https://alexa.amazon.it/api/phoenix/state
2020-11-23 12:19:18.941 [DEBUG] [mazonechocontrol.internal.Connection] - POST: {“stateRequests”:[{“entityId”:“SKILL_eyJza2lsbElkIjoiYW16bjEuYXNrLnNraWxsLjI4N2FkMTRmLTdhMjYtNDEzOC05ZmJhLTkxODVmZmUxOWUwNSIsInN0YWdlIjoibGl2ZSJ9_M1GAxtaW9A0LXNwZWMtdjIVgoAFGA55ZWVsaW5rLWNvbG9AyMxUUGAkxMzM4OTA3MDYV0gkA”,“entityType”:“APPLIANCE”},{“entityId”:“SKILL_eyJza2lsbElkIjoiYW16bjEuYXNrLnNraWxsLjdhZmM2NzFjLWU5MDMtNDI4ZC05ZmZjLTFmZTRjYjJkYzQzNiIsInN0YWdlIjoibGl2ZSJ9_bf96648ad49b0bc48bfy0u”,“entityType”:“APPLIANCE”},{“entityId”:“SKILL_eyJza2lsbElkIjoiYW16bjEuYXNrLnNraWxsLjdhZmM2NzFjLWU5MDMtNDI4ZC05ZmZjLTFmZTRjYjJkYzQzNiIsInN0YWdlIjoibGl2ZSJ9_bf2960fb0a045876a70ffe”,“entityType”:“APPLIANCE”}]}
2020-11-23 12:19:19.730 [DEBUG] [mazonechocontrol.internal.Connection] - Call to https://alexa.amazon.it/api/phoenix/state succeeded
2020-11-23 12:19:19.731 [DEBUG] [mazonechocontrol.internal.Connection] - Result of POST https://alexa.amazon.it/api/phoenix/state:{“deviceStates”:[{“entity”:{“entityId”:“SKILL_eyJza2lsbElkIjoiYW16bjEuYXNrLnNraWxsLjI4N2FkMTRmLTdhMjYtNDEzOC05ZmJhLTkxODVmZmUxOWUwNSIsInN0YWdlIjoibGl2ZSJ9_M1GAxtaW9A0LXNwZWMtdjIVgoAFGA55ZWVsaW5rLWNvbG9AyMxUUGAkxMzM4OTA3MDYV0gkA”,“entityType”:“CLOUD_DISCOVERED_DEVICE”},“capabilityStates”:["{“namespace”:“Alexa.BrightnessController”,“name”:“brightness”,“value”:100,“timeOfSample”:“2020-11-23T11:19:19.636Z”,“uncertaintyInMilliseconds”:6000,“deepQuery”:true,“timeOfStateChange”:""}","{“namespace”:“Alexa.ColorController”,“name”:“color”,“value”:{“hue”:0.0,“saturation”:1.0,“brightness”:1.0},“timeOfSample”:“2020-11-23T11:19:19.636Z”,“uncertaintyInMilliseconds”:6000,“deepQuery”:true,“timeOfStateChange”:""}","{“namespace”:“Alexa.PowerController”,“name”:“powerState”,“value”:“ON”,“timeOfSample”:“2020-11-23T11:19:19.636Z”,“uncertaintyInMilliseconds”:6000,“deepQuery”:true,“timeOfStateChange”:""}","{“namespace”:“Alexa.EndpointHealth”,“name”:“connectivity”,“value”:{“value”:“OK”},“timeOfSample”:“2020-11-23T11:17:38.554Z”,“uncertaintyInMilliseconds”:6000,“deepQuery”:false,“timeOfStateChange”:“2020-11-23T08:19:03.269Z”}","{“namespace”:“Alexa.ColorPropertiesController”,“name”:“colorProperties”,“timeOfSample”:“2020-11-23T11:19:19.636Z”,“timeOfStateChange”:"",“uncertaintyInMilliseconds”:6000,“value”:{“name”:“red”,“localizationMap”:{“en”:“Red”,“en-US”:“Red”,“en-UK”:“Red”,“de”:“Rot”,“jp”:“赤”,“fr”:“Rouge”,“it”:“Rosso”,“es-ES”:“Rojo”,“es-MX”:“Rojo”,“pt-BR”:“Vermelho”,“es-US”:“Rojo”,“hi-IN”:“लाल”}},“deepQuery”:true}"],“error”:null},{“entity”:{“entityId”:“SKILL_eyJza2lsbElkIjoiYW16bjEuYXNrLnNraWxsLjdhZmM2NzFjLWU5MDMtNDI4ZC05ZmZjLTFmZTRjYjJkYzQzNiIsInN0YWdlIjoibGl2ZSJ9_bf96648ad49b0bc48bfy0u”,“entityType”:“CLOUD_DISCOVERED_DEVICE”},“capabilityStates”:["{“namespace”:“Alexa.ColorController”,“name”:“color”,“value”:{“saturation”:1.0,“brightness”:1.0,“hue”:272},“timeOfSample”:“2020-11-23T11:19:19Z”,“uncertaintyInMilliseconds”:0,“deepQuery”:true,“timeOfStateChange”:""}","{“namespace”:“Alexa.BrightnessController”,“name”:“brightness”,“value”:100,“timeOfSample”:“2020-11-23T11:19:19Z”,“uncertaintyInMilliseconds”:0,“deepQuery”:true,“timeOfStateChange”:""}","{“namespace”:“Alexa.PowerController”,“name”:“powerState”,“value”:“OFF”,“timeOfSample”:“2020-11-23T11:19:19Z”,“uncertaintyInMilliseconds”:0,“deepQuery”:true,“timeOfStateChange”:""}","{“namespace”:“Alexa.EndpointHealth”,“name”:“connectivity”,“value”:{“value”:“OK”},“timeOfSample”:“2020-11-23T11:19:19Z”,“uncertaintyInMilliseconds”:0,“deepQuery”:true,“timeOfStateChange”:""}","{“namespace”:“Alexa.ColorPropertiesController”,“name”:“colorProperties”,“timeOfSample”:“2020-11-23T11:19:19Z”,“timeOfStateChange”:"",“uncertaintyInMilliseconds”:0,“value”:{“name”:“indigo”,“localizationMap”:{“en”:“Indigo”,“en-US”:“Indigo”,“en-UK”:“Indigo”,“de”:“Indigo”,“jp”:null,“fr”:null,“it”:“Indaco”,“es-ES”:“Violeta oscuro”,“es-MX”:“Violeta oscuro”,“pt-BR”:null,“es-US”:“Violeta oscuro”,“hi-IN”:null}},“deepQuery”:true}"],“error”:null},{“entity”:{“entityId”:“SKILL_eyJza2lsbElkIjoiYW16bjEuYXNrLnNraWxsLjdhZmM2NzFjLWU5MDMtNDI4ZC05ZmZjLTFmZTRjYjJkYzQzNiIsInN0YWdlIjoibGl2ZSJ9_bf2960fb0a045876a70ffe”,“entityType”:“CLOUD_DISCOVERED_DEVICE”},“capabilityStates”:["{“namespace”:“Alexa.ColorController”,“name”:“color”,“value”:{“saturation”:1.0,“brightness”:1.0,“hue”:79},“timeOfSample”:“2020-11-23T11:19:19Z”,“uncertaintyInMilliseconds”:0,“deepQuery”:true,“timeOfStateChange”:""}","{“namespace”:“Alexa.BrightnessController”,“name”:“brightness”,“value”:100,“timeOfSample”:“2020-11-23T11:19:19Z”,“uncertaintyInMilliseconds”:0,“deepQuery”:true,“timeOfStateChange”:""}","{“namespace”:“Alexa.PowerController”,“name”:“powerState”,“value”:“OFF”,“timeOfSample”:“2020-11-23T11:19:19Z”,“uncertaintyInMilliseconds”:0,“deepQuery”:true,“timeOfStateChange”:""}","{“namespace”:“Alexa.EndpointHealth”,“name”:“connectivity”,“value”:{“value”:“OK”},“timeOfSample”:“2020-11-23T11:19:19Z”,“uncertaintyInMilliseconds”:0,“deepQuery”:true,“timeOfStateChange”:""}"],“error”:null}],“errors”:[]}

Fixed in https://github.com/openhab/openhab-addons/pull/9057/commits/82f88427bd761621e4baae2d82363b4d03a6cae4

Thank you so much Jan.
sorry for the stupid question: do i have to wait for the next snapshot to upgrade my installation with your fixes?

It’s now part of a bigger change that hopefully get’s merged soon (review pending). Unfortunately since you run 2.5.x I can’t easily provide a bundle for that. There is a test version for 3.0.0-SNAPSHOT, though.

After the pull request has been merged, we can backport this fix to 2.5.x.

Hello,
there is still the announcing bug in the binding. No text based anncounce can be placed since Version 2.5.8. on display based devices.

i have created a bug report on github, but nobody takes care…
the link to the bug is: https://github.com/openhab/openhab-addons/issues/8726 9

is somebody able to reproduce it or can take an eye on this?
Thank you.

Ralph

Is this still present in the 3.0.0 bundle I posted here?

On OH3M3 my alexas dont work…other problems…

i think, the problem is in the ChannelHandlerAnnouncement.java

See: https://ci.openhab.org/view/Integration%20Builds%20(2.5.x)/job/openHAB2.5.x-Addons/ws/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/ChannelHandlerAnnouncement.java

Because the problem only occurs when using the announcing keywords specified there.
i mean the ‘speak, sound, title, body, volume’ keywords. these are special - like explained in the binding docu…

I’m having trouble getting a Smart Home Device Group online. Do you know what I can do to troubleshoot this?

it seems, that the ‘body’ tag is ignored.
when i send the following command to the device, it says “hello” but it don’t display the body-text:

Echo_Kitchen_Announcement.sendCommand(’{“sound”: false, “speak”: “Hello”, “title”: “SmartHome”, “body”: “This ist the Text”}’)

with the 2.5.7-binding, it works fine…after 2.5.7…not!
in the OH-Debug-log i can see, that binding does not send any request to the alexa-api.
so, the error is in the binding - not in the backend.

Hello everybody,

After further analysis, I found out that the requests for an announcement sent to the Amazon backend differ. The text in the body tag under 2.5.11 is obviously suppressed and overwritten by the text in the speak tag. This was not the case under 2.5.7:

In both cases the request is:

Echo_Announcement.sendCommand('{"sound": true, "speak": "Hello", "title": "SmartHome", "body": "This is the Text"}')

The requests to the api then is:

Binding Version 2.5.7

POST: 
{
	"behaviorId":"PREVIEW",
	"sequenceJson":"{\"@type\":\"com.amazon.alexa.behaviors.model.Sequence\",
	\"startNode\":{\"@type\":\"com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode\",
	\"type\":\"AlexaAnnouncement\",
	\"operationPayload\":{\"deviceType\":\"AXXXXXXXXXXX\",
	\"deviceSerialNumber\":\"GXXXXXXXXXX\",
	\"locale\":\"\",
	\"customerId\":\"AXXXXXXXXXXX\",
	\"expireAfter\":\"PT5S\",
	\"content\":[{\"locale\":\"\",
	\"display\":{\"title\":\"SmartHome\",
	\"body\":\"This is the Text\"},
	\"speak\":{\"type\":\"text\",
	\"value\":\"Hello\"}}],
	\"target\":{\"customerId\":\"AXXXXXXXXXXX\",
	\"devices\":[{\"deviceSerialNumber\":\"GXXXXXXXXXX\",
	\"deviceTypeId\":\"AXXXXXXXXXXX\"}]}}}}",
	"status":"ENABLED"
}

Binding Version 2.5.11

POST:
{
	"behaviorId":"PREVIEW",
	"sequenceJson":"{\"@type\":\"com.amazon.alexa.behaviors.model.Sequence\",
	\"startNode\":{\"@type\":\"com.amazon.alexa.behaviors.model.SerialNode\",
	\"nodesToExecute\":[{\"@type\":\"com.amazon.alexa.behaviors.model.ParallelNode\",
	\"nodesToExecute\":[{\"@type\":\"com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode\",
	\"type\":\"AlexaAnnouncement\",
	\"operationPayload\":{\"deviceType\":\"AXXXXXXXXXXX\",
	\"deviceSerialNumber\":\"GXXXXXXXXXX\",
	\"locale\":\"\",
	\"customerId\":\"AXXXXXXXXXXX\",
	\"expireAfter\":\"PT5S\",
	\"content\":[{\"locale\":\"\",
	\"display\":{\"title\":\"SmartHome\",
	\"body\":\"Hello\"},
	\"speak\":{\"type\":\"text\",
	\"value\":\"Hello\"}}],
	\"target\":{\"customerId\":\"AXXXXXXXXXXX\",
	\"devices\":[{\"deviceSerialNumber\":\"GXXXXXXXXXX\",
	\"deviceTypeId\":\"AXXXXXXXXXXX\"}]}}}]}]}}",
	"status":"ENABLED"
}

You can see the difference in the line “body”…

I am not able to debug or change the original source code because i do not have an oh-development environment. can somebody please take a look at this?

If i have to do further testings or some other, please tell me.

Thanks Ralph

Hi there: `
Amazon device discovery cannot find any devices in version 2.5.8 and 2.5.10.

I just installed the 2.5.10 OH version hoping that device discovery by echo control binding works again. But still alexa is not able to find any new devices. In the log I see some WebSocket error messages.

How can I again link new OH devices to my amazon smart home list again? (hope this is the right forum)

Exisitng devices still work though…

Probably you are missing the correct metadata on the item. What did you configure?

Hi thanks for the question. I did it like I did for all the others:

Switch CloseDoorAlexaCmd “Haus_TuerKommando” {alexa=“PowerController.powerState”} -> is not found
//Switch CloseDoorAlexaCmd2 “Haus_TuerKommando2” [“Switchable”] -> will not be found either

Both don’t work anymore.

value: PowerController.powerState
config:
  category: LIGHT

That’s what I configure as alexa-metadata on OH3 and that works. I have no idea how to do that in OH2.

Im running OH 2.5.10 with latest snapshot of your Binding (this fixed the refresh status of the switches).
Is there any reason why the expire binding is not working anymore for timers longer than 1 or 2 minutes ?
I mean, can this expiring issue be raleted to the way Echo Control Bindings refresh items ?

In the event-log I cannot see anything strange.

The problem seems to be that Amazon cannot read my new exported variables at all. At the moment I presse the search button in the App I get a lot of errormessages in the log.