Showing posts with label echo. Show all posts
Showing posts with label echo. Show all posts

Monday, March 2, 2015

Amazon Echo Api

As I posted in my previous post, I recently bought an Amazon Echo. I saw some videos of people using their Echo to do home automation with a Raspberry Pi or Adriano. They did this by using something like Node, or python to monitor the tasks that are added to the Echo. To do the monitoring, they used the undocumented, unsupported, Api of the Echo.

I wanted to play around too. While I really don’t do anything related to home automation, I still wanted to explore the Echo Api and see if I could implement some type of wrapper for it in C#.

Here is what I found with the undocumented Api:

  • The desktop app connects to a WebSocket on the Echo device. I have not yet successfully connected to the socket, nor have I tried yet.
  • There is a url to get the latest “cards” - /api/cards?limit=N
  • Get the tasks - /api/todos?type=TASK
  • Get the shopping list - /api/todos?type=SHOPPING_ITEM
  • Get registered devices - /api/device
  • Get the media state for a device - /api/media/state?deviceSerialNumber={0}&deviceType={1}
  • Get the connected bluetooth devices - /api/bluetooth
  • Get music accounts - /api/music-account-details
  • logout - /logout
  • Get the capabilities of each provider - /api/media/provider-contenttype-capabilities

I also found that I should be able to send commands to Play, Stop, Next Track, Previous Track, Shuffle, Repeat, and set the Volume. The web app does this by first doing an HTTP/OPTIONS request, followed by an HTTP/POST. The post contains a JSON payload that contains the meta data of the device and what the volume is (if setting the volume). I have been unable to successfully POST these commands as there should be a CSRF token sent along with the POST. This token should be available in the cookies, but for some reason that I have not figured out yet, the token does not exist in the CookieContainer.

Currently, I have a working wrapper Api to Login, Logout, Get Tasks (TODO or SHOPPING), and update a task. I have posted my code on GitHub and I will push changes when I make them. This is just a little toy project that I decided to play with when bored. I will continue to work on it in free time, while I am interested in it. Feel free to fork it.

Amazon Echo Api

Happy Hacking of your Echo

Sunday, March 1, 2015

Amazon Echo Material Design Stylish Theme

echoI bought an Amazon Echo last week. I was looking for a Bluetooth speaker and for $100 (for Prime Members), it is a decent Bluetooth speaker, plus it integrates with Prime music, and other Amazon services. It allows you to purchase items from Amazon directly from the Echo. It also has other features like TuneIn radio, iHeartRadio, a timer, an alarm (seems like it should support more than one timer and alarm, hopefully they will add this functionality in the future), todo list, and a shopping list.

The Echo has a companion app for iOS and Android devices, and it has a web app for your desktop. I was playing around with the CSS the other day while I was off work and decided to re-theme all (or most) of the desktop app using Stylish (Chrome|Firefox).

 

Download Amazon Echo Material Theme

 

 

 

 

Here are screenshots of just about every page within the Echo desktop app. Some are pretty boring, but they do show some of the elements that have been changed on the page.

1 

2

3

4

5

6

7

8

9

10

Showing posts with label echo. Show all posts
Showing posts with label echo. Show all posts

Amazon Echo Api

As I posted in my previous post, I recently bought an Amazon Echo. I saw some videos of people using their Echo to do home automation with a Raspberry Pi or Adriano. They did this by using something like Node, or python to monitor the tasks that are added to the Echo. To do the monitoring, they used the undocumented, unsupported, Api of the Echo.

I wanted to play around too. While I really don’t do anything related to home automation, I still wanted to explore the Echo Api and see if I could implement some type of wrapper for it in C#.

Here is what I found with the undocumented Api:

  • The desktop app connects to a WebSocket on the Echo device. I have not yet successfully connected to the socket, nor have I tried yet.
  • There is a url to get the latest “cards” - /api/cards?limit=N
  • Get the tasks - /api/todos?type=TASK
  • Get the shopping list - /api/todos?type=SHOPPING_ITEM
  • Get registered devices - /api/device
  • Get the media state for a device - /api/media/state?deviceSerialNumber={0}&deviceType={1}
  • Get the connected bluetooth devices - /api/bluetooth
  • Get music accounts - /api/music-account-details
  • logout - /logout
  • Get the capabilities of each provider - /api/media/provider-contenttype-capabilities

I also found that I should be able to send commands to Play, Stop, Next Track, Previous Track, Shuffle, Repeat, and set the Volume. The web app does this by first doing an HTTP/OPTIONS request, followed by an HTTP/POST. The post contains a JSON payload that contains the meta data of the device and what the volume is (if setting the volume). I have been unable to successfully POST these commands as there should be a CSRF token sent along with the POST. This token should be available in the cookies, but for some reason that I have not figured out yet, the token does not exist in the CookieContainer.

Currently, I have a working wrapper Api to Login, Logout, Get Tasks (TODO or SHOPPING), and update a task. I have posted my code on GitHub and I will push changes when I make them. This is just a little toy project that I decided to play with when bored. I will continue to work on it in free time, while I am interested in it. Feel free to fork it.

Amazon Echo Api

Happy Hacking of your Echo

Amazon Echo Material Design Stylish Theme

echoI bought an Amazon Echo last week. I was looking for a Bluetooth speaker and for $100 (for Prime Members), it is a decent Bluetooth speaker, plus it integrates with Prime music, and other Amazon services. It allows you to purchase items from Amazon directly from the Echo. It also has other features like TuneIn radio, iHeartRadio, a timer, an alarm (seems like it should support more than one timer and alarm, hopefully they will add this functionality in the future), todo list, and a shopping list.

The Echo has a companion app for iOS and Android devices, and it has a web app for your desktop. I was playing around with the CSS the other day while I was off work and decided to re-theme all (or most) of the desktop app using Stylish (Chrome|Firefox).

 

Download Amazon Echo Material Theme

 

 

 

 

Here are screenshots of just about every page within the Echo desktop app. Some are pretty boring, but they do show some of the elements that have been changed on the page.

1 

2

3

4

5

6

7

8

9

10