GithubHelp home page GithubHelp logo

xrolfex / hass-lovelace-kindle-4 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sibbl/hass-lovelace-kindle-4

0.0 1.0 0.0 678 KB

How to build your own Kindle 4 photo frame displaying your Home Assistant Lovelace panel

License: MIT License

Shell 100.00%

hass-lovelace-kindle-4's Introduction

Kindle 4 Non Touch Home Assistant Lovelace Dashboard

This repository gives details about how I built my own Home Assistant dashboard using an old Kindle 4 non touch.

A lovelace UI panel of your Home Assistant instance is rendered to an image and polled from a jailbroken Kindle 4 on a regular basis.

Outside photo

Software

I keep this short as I think this should be pretty straight forward.

  1. Set up Home Assistant on the platform of your choice.
  2. Set up the rendering software i.e. using docker, see my hass-lovelace-kindle-screensaver repository.

Hints:

  1. there's an eink HA theme inside this repository which you can configure for your newly created panel.
  2. I recommend installing this kiosk mode extension (i.e. via HACS) to remove the UI app header bar.

Finally, You should end up with a URL pointing to the exposed port of the rendering docker container to configure this on your kindle as described in the following section.

This URL needs to be plain HTTP as no TLS or SSL is supported by the Kindle 4. If your server is HTTPS only (which is a good thing!), I recommend using a free CDN like Hostry.

Hardware

While the software part should be the same for other Kindle models like the newer Paperwhites, the following section specifically addresses the Kindle 4 non touch. I've also primarily built it for an always powered device, but I assume it might be easily adapted to a battery powered use. PRs are welcome!

If you're using a Paperwhite, it's probably better to use the online screensaver extension. It uses features like rtcwake and upscript which are not available on the Kindle 4 NT out of the box.

Thus, a bit more work was necessary to get a reliable solution for a good Kindle 4 experience. Btw - this solution is also approved by my parents as I've built it for them and they put it on the walls in their kitchen.

  1. Jailbreak your Kindle 4 Non Touch as described here.
  2. Install USBNetwork so that you can SSH into your device. See download including instructions here.
  3. Install mkk certificates so that KUAL can be used. See download including instructions here.
  4. Install kite so that we can start our script on each boot. See download including instructions here - I've used the kite.sh from the kite.gz download.
  5. Copy KUAL v1 azw file into /mnt/us/documents as described here.
  6. Clone this repository. Important for Windows users: ensure that the *.sh files have LF line endings and NOT CRLF.
  7. Set the variables at the top of this repository's extensions/homeassistant/script.sh.
    • If you want to run the device on battery, I recommend increasing the INTERVAL (so that it suspends longer) and decrease DELAY_BEFORE_SUSPEND so that the (artificial) delay between drawing the image and suspending is as low as possible. But please keep in mind that this wasn't what I've built the script for. E.g. the online screensaver extension supports configuring a scheduler to run less frequent at night and save battery.
  8. Copy homeassistant and kite folders from this repository into /mnt/us/ on the device (I used SFTP, specifically WinSCP on Windows).
  9. Reboot your device and the script should run 2 minutes after booting up. That's it.

Changing config or debugging

There are two possibilities to SSH into your Kindle to change your config or debug if something didn't work as expected.

  1. The extensions/homeassistant/startup.sh sleeps 2 minutes until it starts the daemon on boot. On boot, you have time to SSH into your kindle.
  2. After drawing the image, the extensions/homeassistant/script.sh sleeps a short time until it suspends - see the DELAY_BEFORE_SUSPEND config option. This gives you time to SSH into your device and stop the daemon using sh /mnt/us/extensions/homeassistant/daemon.sh stop.

For debugging purposes, LOGGING can be configured to 1 so that an extended log is written to extensions/homeassistant/homeassistant.log.

Photo frame

Similarly to this project, I've bought a 13x18 cm photo frame from an online store over here in Germany.

My wife and I removed the front cover of the Kindle 4 and also decided to remove the mainboard from the frame as there wasn't enough space to plug a Micro USB cable into the device's bottom while keeping it centered. A 90 degree adapter might be a better choice, also depending on the exact size of the frame.

The following photo should demonstrate it. The connectors beetween the battery and screen are the most important, the ones of the side buttons are not required. Of course, the photo also clearly indicates that we're both software developers...

Inside photo

My sources and similar projects

The following two projects were my inspiration and I've also used them for quite some time. However, manually rebooting or charging the device was necessary too often and would've never gotten an approval by my parents.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.