Released: Openhab2 Amazon Echo Control Binding (controlling alexa from openhab2)

development
binding
alexa
Tags: #<Tag:0x00007fd30f1413d0> #<Tag:0x00007fd30f141268> #<Tag:0x00007fd30f141038>

(Markus S.) #528

Hi to all.
I don’t know if someone have the same problem.
I change the volume of Alexa in the night to a lower level. Before i check the volume level. Is it not the level I want -> change or not.
Since today the rule doesn’t work correctly. Because the state of volume channel is undef. After openhab changed the volume, the item goes back to undef.
Regards,
Markus


(Falk S.) #529

Hi @Balaganov,

first of all it is important that the script is running on a machine where the traffic goes through. I have a central server instance that acts as a router, firewall and host for other virtual servers. All Internet traffic needs to go through the instance where the script is located.

You should see traffic when you uncomment the

packet.show() 

line and change the following line like

sniff(prn=pack_received, iface="YOURINTERFACE", store=0, count=0)

This does not apply any filter and should show you a lot of packets. If this works, everything should be ok with your setup.


(Michael Geramb) #530

Dear Beta tests,

I’am happy to announce:

The “Amazon Echo Control” binding will be part of the official OpenHAB 2.3 distribution

Starting from the build tonight, the binding is include in the daily snapshot (unstable) build of OpenHAB 2.3. Please read this post and this post before you upgrade.

I want to say thank all of you for your beta testing. Thanks for you patience and endurance to bring the binding to this level!


(Alan Fenwick) #531

That is awesome - great work!!
Thanks


(Rick) #532

thanks for the effort you’ve put into this binding!


(Andrew Pawelski) #533

“if you open the page http(s)://youropenhab:port/amazonechocontrol (e.g. http://localhost:8080/amazonechocontrol 7) you can verify if the RC3 is correctly installed. it should look like that:”

I dont have this URL? page not found


(Andrew Pawelski) #534

For anyone interested in the alarm sounds - here is my list out of the REST interface (I assume everyone has the same list?

        "value": "ECHO:system_alerts_soothing_01",
        "label": "Adrift"
      },
      {
        "value": "ECHO:system_alerts_atonal_02",
        "label": "Clangy"
      },
      {
        "value": "ECHO:system_alerts_melodic_05",
        "label": "Clarity"
      },
      {
        "value": "ECHO:system_alerts_repetitive_04",
        "label": "Countertop"
      },
      {
        "value": "ECHO:system_alerts_melodic_03",
        "label": "Focus"
      },
      {
        "value": "ECHO:system_alerts_melodic_06",
        "label": "Glimmer"
      },
      {
        "value": "ECHO:system_alerts_repetitive_01",
        "label": "Nightstand"
      },
      {
        "value": "ECHO:system_alerts_melodic_07",
        "label": "Nimble"
      },
      {
        "value": "ECHO:system_alerts_soothing_05",
        "label": "Orcas"
      },
      {
        "value": "ECHO:system_alerts_atonal_03",
        "label": "Porchlight"
      },
      {
        "value": "ECHO:system_alerts_rhythmic_02",
        "label": "Pulsar"
      },
      {
        "value": "ECHO:system_alerts_musical_02",
        "label": "Rainier"
      },
      {
        "value": "ECHO:system_alerts_melodic_01",
        "label": "Simple Alarm"
      },
      {
        "value": "ECHO:system_alerts_melodic_02",
        "label": "Simple Timer"
      },
      {
        "value": "ECHO:system_alerts_alarming_03",
        "label": "Squared Waves"

(Mark) #535

I am using a rule to set a volume before an announcement. A few seconds after I send the new volume command I see th Alexa go from the volume I set to either undefined or 2% higher than the value I sent.

edit to add… Alexa volume voice command is integer steps 1 to 10. I suspect that the unstable volume may be happening when % values are used that fall between the equivalent integer eg 30 is OK but 35 jumps around


(Ben) #536

Hey @michi,
any idea what causes this error :

2018-05-29 19:33:33.869 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.amazonechocontrol.handler.EchoHandler@b60de0': POST url 'https://alexa.amazon.de/api/np/command?deviceSerialNumber=GABCDEFGHIJ&deviceType=A3S5BH2HU6XXX' failed: Not Found

org.openhab.binding.amazonechocontrol.internal.HttpException: POST url 'https://alexa.amazon.de/api/np/command?deviceSerialNumber=GABCDEFGHIJ&deviceType=A3S5BH2HU6VXXX' failed: Not Found

	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:404) [216:org.openhab.binding.amazonechocontrol:2.3.0]

	at org.openhab.binding.amazonechocontrol.internal.Connection.command(Connection.java:627) [216:org.openhab.binding.amazonechocontrol:2.3.0]

	at org.openhab.binding.amazonechocontrol.internal.Connection.playRadio(Connection.java:645) [216:org.openhab.binding.amazonechocontrol:2.3.0]

	at org.openhab.binding.amazonechocontrol.handler.EchoHandler.handleCommand(EchoHandler.java:369) [216:org.openhab.binding.amazonechocontrol:2.3.0]

	at sun.reflect.GeneratedMethodAccessor138.invoke(Unknown Source) ~[?:?]

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]

	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [101:org.eclipse.smarthome.core:0.10.0.oh230]

	at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [101:org.eclipse.smarthome.core:0.10.0.oh230]

	at com.sun.proxy.$Proxy129.handleCommand(Unknown Source) [216:org.openhab.binding.amazonechocontrol:2.3.0]

	at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [108:org.eclipse.smarthome.core.thing:0.10.0.oh230]

	at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [108:org.eclipse.smarthome.core.thing:0.10.0.oh230]

	at sun.reflect.GeneratedMethodAccessor137.invoke(Unknown Source) ~[?:?]

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]

	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [101:org.eclipse.smarthome.core:0.10.0.oh230]

	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [101:org.eclipse.smarthome.core:0.10.0.oh230]

	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

	at java.lang.Thread.run(Thread.java:748) [?:?]



(Michael Geramb) #537

Hi Ben,
this means that the amazon server answer with an not found http error. I hope its an temporary problem.
Kind Regards,
Michael


(Michael Geramb) #538

:grinning::grinning::grinning::grinning::grinning::grinning::grinning::grinning: Release Time :grinning::grinning::grinning::grinning::grinning::grinning::grinning::grinning:

OpenHAB 2.3 is released now with the Amazon Echo Control Binding

:champagne::tada::boom::champagne::tada::boom::champagne::tada::boom::champagne::tada::boom::champagne::tada::boom::champagne::tada::boom::champagne::tada::boom:


(Alan Fenwick) #539

doesn’t beep for me - although the rings light up.
Either way though, this is a game changer


(Daniel) #540

Hi

after my update to 2.3 stable, I wanted to use the Eche Control Binding, starting with Volume Control via KNX.
I used the KNX switch to control the volume of my Onkyo, but I want to change that to control the volume of my Echo dot.
I made a dimmer Item with a KNX Group adress and linked that to the volume thing in the Paper UI.
What happens is, that the volume is always set to 1. I think this is due to the fact, that the bus sends a 12,5% increase command again and again as long as I am on the button.

Is ther any workaround, maybe with pressing the button just once to increase the volume by one step (no press and hold)

I hope you guys understand what I mean an can give me a hint.

BR
Daniel


(Ben) #541

@Daniel_OH: Hi my guess is, that you should use a rule for that kind of things and it would be better to create a seperate thread just because it’s actually a general topic.


(Ben) #542

I think I found out what causes the error. If I am putting a item linked to the radio channel in a group with other switch items and try to set this group to ON or OFF this error appears. It is a weired thing, because changing the radio item of my echo within a rule without a group its working like a charm. Switching the radio channel with control in paper ui is also working.


(Daniel) #543

Thank you ben

I thought this is the right place, because I am not the only one talking about issues in this thread.

BR


(Ben) #544

@Daniel_OH : Sorry, I meant no offence. :wink: It was actually not a command but an advice. The chance that the “right” guys read your problem is just much higher if they see the topic in the community. So as faar as I am concerned you can write whatever you want to.


(Home Agecra) #545

Great work @michi I’m loving the TTS function! Now Alexa welcome me home with a custom greeting with OwnTracks detected my presence :wink:

Is there a way I can add Sports Update (my favorite teams only, added using Settings) in flash briefing drop down menu?

I say this command ‘Alexa, sports update’ and Alexa will say the scores and when the team will play again.

Selection item=Echo_Living_Room_StartCommand mappings=[ 'Weather'='Weather', 'Traffic'='Traffic', 'GoodMorning'='Good Morning', 'SingASong'='Song', 'TellStory'='Story', 'FlashBriefing'='Flash Briefing', 'FlashBriefing.flashbriefing1'='Technical', 'FlashBriefing.flashbriefing2'='Life Style' ] 

I know I will just add this ‘SportsUpdate’=‘Sports Update’ in the mappings and it will show up but when I choose it nothing happen. How can I get the data for this briefing please?


(Michael Geramb) #546

Hi, no this will not work, the available option are derived from the possibilities of routines. If you find a way to start the sports update as a routine, you could use the startRoutine channel. Or you can check if you can get the update as flashbriefing, then you can create a flashbriefinprofile thing for it.
Kind regards, Michael


(Andrew Pawelski) #547

Ive got Alexa playing a random alarm sound, sleep command for some milliseconds to let it play then a random “hey humans…” style of introduction and then plays the TTS I want it to (in my case a calendar reminder) - its not perfect as the alarm sound doesnt start playing at the exact same time each time so sometimes it sounds cut off but is pretty good and the random introduction keeps the kids amused.

I was thinking of trying to fade out the alarm sound with a step down of the volume but I think that will then be mucked up with the volume beep.

can share what I have done if of interest.