Jump to content

Emby with Amazon Alexa


chef

Recommended Posts

AgileHumor

Personally, I use the Kodi/Alexa addon that is AMAZING!  Of couse, Emby is my backend and the Emby Kodi addon works great using the Alexa/Kodi skill.  So technically, you can control Emby with Alexa :)

 

Some configuration needed as it's a custom server, benefit is you can pick the control word (I use "TV", i.e. "Alexa, tell TV X")

 

https://github.com/m0ngr31/kodi-alexa

 

I run AWS Lambda instance and it can handle complex items that Kodi doesn't have native like "Alexa, tell TV to play the latest episode of Conan"  (no native latest episode API call).   

Edited by AgileHumor
Link to comment
Share on other sites

@@chef

 

Forgot to ask: do you have emby server configured to listen on port 443 for public https and serving up your pfx certificate?

I'll change the port for HTTPS. How do I server the pfx cert?

 

Hmmm... it seems that my Https address is throwing HTTPS 0 Error when testing it on http://resttesttest.com/

Edited by chef
Link to comment
Share on other sites

nxenos83

I'll change the port for HTTPS. How do I server the pfx cert?

 

I used AMCESharp powershell cmd-let to register and create my certificate through Let's encrypt. I was able to export to a pfx

PS> Get-ACMECertificate cert1 -ExportPkcs12 "path\to\cert1.pfx"

You can also create a pfx with OpenSSL. Command line is:

openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt

Use the output file as the custom certificate in Emby's advanced settings.

Link to comment
Share on other sites

I used AMCESharp powershell cmd-let to register and create my certificate through Let's encrypt. I was able to export to a pfx

PS> Get-ACMECertificate cert1 -ExportPkcs12 "path\to\cert1.pfx"
You can also create a pfx with OpenSSL. Command line is:
openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt
Use the output file as the custom certificate in Emby's advanced settings.

Right, I can use OpenSSL I've been practicing making certs with it.

 

The next step would be adding the cert info to the self signed certificate option in the SSL page of the Alex Skills kit online config.

 

I think I get it.

Link to comment
Share on other sites

nxenos83

Personally, I use the Kodi/Alexa addon that is AMAZING!  Of couse, Emby is my backend and the Emby Kodi addon works great using the Alexa/Kodi skill.  So technically, you can control Emby with Alexa :)

 

Some configuration needed as it's a custom server, benefit is you can pick the control word (I use "TV", i.e. "Alexa, tell TV X")

 

https://github.com/m0ngr31/kodi-alexa

 

I run AWS Lambda instance and it can handle complex items that Kodi doesn't have native like "Alexa, tell TV to play the latest episode of Conan"  (no native latest episode API call).   

 

This looks great for Kodi clients. To control multiple devices, are you setting up separate Skils and Lamba Endpoints?

 

For my personal use, I use many closed devices that are DLNA playto devices (Xbox and audio receivers) and chromecast to consume media from Emby. If we have a skill that talks to the Emby server, and not the individual clients, we can control Kodi (though not navigation or volume control) and all other Emby client types with the same code and Skill. Alexa, tell Emby  X on Y -- and to save the "to Y" portion we can save the last device used, so command after the first will assume the device.

Link to comment
Share on other sites

The only problem I am facing right now is that I keep getting .pem files out of OpenSSL

 

I get a key and certificate but they are not .pfk files.

 

I donno... Losing interest fast lol!

 

I'll pick it back up tomorrow.

Link to comment
Share on other sites

Losing interest fast lol!......   As someone who has no idea what you are going thru, i think there are a lot of people like me watching this thread, waiting,,,,

 

Keep it up, you have support!!!!

  • Like 1
Link to comment
Share on other sites

Losing interest fast lol!...... As someone who has no idea what you are going thru, i think there are a lot of people like me watching this thread, waiting,,,,

 

Keep it up, you have support!!!!

Thanks man.

 

I have saved all the command lines for OpenSSL.

 

I was able to create a new pfk certificate for Emby using the pem files.

 

So now, Amazon has the proper cert information, and emby is displaying the same certificate info in a custom certificate.

 

But, it is still not trusted. So! That would explain why my custom skill isn't responding with information from my custom endpoint in emby.

 

Or I screwed up the config information when I built the certificate.

 

But, definitely further along then yesterday!

Edited by chef
Link to comment
Share on other sites

@@nxenos83

 

Did you get play commands working by creating an endpoint that was a function which used a parameter from the custom skill.

Edited by chef
Link to comment
Share on other sites

nxenos83

@@chef

 

 

Here's the function i use to send playstate changes;

public string remoteChangeState(string deviceId, PlaystateCommand psCmd)
        {
            _logger.Info("playstatechange");
            var s = getSession(deviceId);
            if(s == null)
            {
                return buildAlexaResponse("device is not setup or is unavailable");
            }
            PlaystateRequest command = new PlaystateRequest()
            {
                Command = psCmd,
                ControllingUserId = s.UserId.ToString()
            };

            s.SessionController.SendPlaystateCommand(command, new CancellationToken(false));
            return buildAlexaResponse("ok");
        }

​Here's how I get the session object from the deviceId (_sessionManager is based upon the ISessionManager interface)

 public SessionInfo getSession(string deviceId)
        {
            _logger.Info("Looking for sessions for device " + deviceId);
            var r = _sessionManager.Sessions.Where(i => i.DeviceId == deviceId); // "db464421188f5622f73acab7252660facbd63078");
            _logger.Info("Found {0} sessions for device {1}", r.Count().ToString(), deviceId);
            return r.FirstOrDefault();
        }

To send Pause command :

remoteChangeState(PlayToDeviceId, PlaystateCommand.Pause);

where PlayToDeviceId is the device's id. 

  • Like 1
Link to comment
Share on other sites

TolkienBard

What do people expect/want from using Alexa - the obvious first step would be playing music from your library - although i believe Alexa is supposed to be able to find most music "online" - not yet having an echo yet to test i could be wrong :) but i have a phone that can do that simply and play it directly on the speakers of my choice rather than a single Echo speaker

 

At the other end of the spectrum i would guess telling Alexa to play movie X on TV Y would be a nice feature/option 

 

Finding out what the demand is for feature X,Y ,Z is also needed to focus the limited dev resource as i dont see a large demand on the forum for it yet - but that may change in time

 

 

I also like the sound of Google Home :) also waiting patiently 

 

also be mindful that if Amazon or Google do not get enough traction they have a habit of dropping products - fingers crossed this is not an issue  :blink:

 

As far as Echo playing music is concerned, what Echo can play is anything in the Amazon Prime music library and anything the user has uploaded to their Amazon music account. For many, this will cover pretty much anything they want to listen to. For those with sizeable libraries, there will be vast holes in the playback selections unless the user is paying the annual rate for unlimited music "storage", which is not actually storage at all. What it is really doing is creating a link to a mp3 of the song found somewhere in Amazon's massive online collection of music.

 

As for what people are looking for, I'm guessing it would be the ability to use voice commands to do the simple things like play a media file, pause, skip, control volume, and navigate some simple menus, much like can be done with Google Voice command tied to XBMC/Kodi.

 

As an early adopter of Echo, I have been pleasantly surprised by how often updates were added in the background. Those updates are coming slower these days, but I do like that it is a versatile hub for home automation not tied to only one automation environment. Google Home looks nice, but I'll be waiting a bit longer on that. I am mostly satisfied with my Echo and I expect it will continue to improve.

Link to comment
Share on other sites

Today's the day. I have a domain in place pointing to my emby server and just revived confirmation in my SSL certificate.

 

I actually took the day off work to try and get this working.

 

Hopefully by the end of the day Alexa will be ported to Emby.

 

I took the paid route.

  • Like 1
Link to comment
Share on other sites

Guest asrequested

Today's the day. I have a domain in place pointing to my emby server and just revived confirmation in my SSL certificate.

 

I actually took the day off work to try and get this working.

 

Hopefully by the end of the day Alexa will be ported to Emby.

 

I took the paid route.

It sounds very promising

Link to comment
Share on other sites

Holy macaroni! Finally! Freaking Finally! I got Alexa to talk to emby and emby to talk to Alexa!

 

What an ordeal!

 

Seriously! What a long, drawn out, freaking ordeal!

 

I think I jumped for joy and my family might think I have lost my mind.

  • Like 2
Link to comment
Share on other sites

LOL..well done!

@

 

You have been interested in this for awhile now.

 

I can show you how to do it, but my way costs money.

 

There are other ways to do it for less money, but you're going to need some "internet stuffs" to do it, and at least one item you need could cost money.

 

You'll need a Certificate signed by a Certificate Authority.

For me it was confusing as hell. But, I kind of get it.

Link to comment
Share on other sites

Guest asrequested

@

 

You have been interested in this for awhile now.

 

I can show you how to do it, but my way costs money.

 

There are other ways to do it for less money, but you're going to need some "internet stuffs" to do it, and at least one item you need could cost money.

 

You'll need a Certificate signed by a Certificate Authority.

For me it was confusing as hell. But, I kind of get it.

 

How much, exactly? And what are the steps? Maybe you want to post a "How to" step by step, so anyone who is interested can give it a shot.

Link to comment
Share on other sites

In the end, you have an Internet address which is connected through an encrypted connection directly to your computer.

It is "kind of like" emby connect, I say that loosely because connect redirects, and you domain will be open to the Internet.

 

You'll need to create what is called a CSR, which is a request for the certificate.

 

That certificate is what you'll use to encrypt your internet connection.

 

My certificate cost 70 dollars Canadian. Might not have been the best deal... I don't know because the Internet stuff is all new to me...

 

From there you'll need to create a developer account with Amazon. That is free.

 

So, money for a domain?? Maybe... Unless you can get a free one, or a "sub domain" on a shared domain.... See it get confusing as hell.

 

The rest is coding an emby plugin with entry points which return data that your Alexa will understand. That is free, and I can help with that because I'm back in territory I understand.

 

Lol! Yeah...

Link to comment
Share on other sites

Guest asrequested

Yeah, I can see why you were getting frustrated, lol. I think I'll forgo attempting to do it, for now. I just know that I'll have big problems trying to get it done. Hopefully, your efforts and results will pave the way for development of a plugin. Great job, on figuring it out  :)

Link to comment
Share on other sites

Something just occurred to me. Maybe Luke could make sense of it.

 

You know that page for emby connect where you can "add a server"

 

What if people shared their server with someone who hosted a domain.

 

Then the domain could sit as an Internet access point for anyone who wanted to login to their server through the domain.

 

Then there could theoroetically only have to be one domain with an SSL with a list of severs attached to it.

 

Then all we would need is the plugin.

 

Does that make sense.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...