Hatki - Homeassistant to Kindle - Kiosk Dashboard

Hey together,

Today I want to give you a first view of a Project i worked on for a while, so that I am more motivated to finish this up an post it on GitHub most of my projects get stuck on the “works for me” state.

 __              __    __     __                                        
|  |__  _____  _/  |_ |  | __|__|                                       
|  |  \ \__  \ \   __\|  |/ /|  |  hatki - Home Assistant To Kindle/HTML
|   |  \ / __ \_|  |  |    \ |  |  v2 (2021-03-13) by Knoe-WG           
|___|__/(______/|__|  |__|__\|__|                                       


This Project is intendet to gives old Devices such as a Amazon Kindle a new life by enabeling them to represent Homeassistant enteties.

This Script will take all placeholders in HTML templates and propegate them with data from the homeassistant API

usage: hatki.py [-h] -u URL [-t TOKENFILE] [-i INPUTFOLDER] [-o OUTPUTFOLDER]

optional arguments:
  -h, --help            show this help message and exit
  -u URL, --url URL     Home Assistant API URL, e.g.
                        https://localhost:8123/api
  -t TOKENFILE, --tokenfile TOKENFILE
                        File that contains the Token for the Home Assistant
                        API. (default value: token.txt)
  -i INPUTFOLDER, --inputfolder INPUTFOLDER
                        Path to the folder that contains the HTML templates.
                        NOTE: Subfolders are NOT supported. (default value:
                        html-templates)
  -o OUTPUTFOLDER, --outputfolder OUTPUTFOLDER
                        Path to the folder where the generated HTML files will
                        be written. (default value: generated-html)

For example:

If windows are open i display text white with shadow.
If a door is locked (bathroom) i show a locked icon
if a door is open to the outside i show a Icon.
Show last time Doorbell has been triggered
Show Trash collection days.
refresh every 60s if there is new content.

I bought some Kindle Touch very cheap of ebay for about 15€ per Kindle,
the kindle needs to be jailbroken to be able to open the browser in full-screen.

WebLaunch extension for the Kindle Touch

Additional things I integrated in Home Assistant:
via command_line integration:

  • Track the battery of the devices and show it in Home Assistant
  • Push tts from Home Assistant to the Kindle via local rhasspy

Thanks for checking it out :slight_smile:
Cheers Tom

EDIT: Removed pictures as new users can only post one as it seems.
EDIT: Now live on github!

18 Likes

1 Like

Here is how it looks docked/mounted at the wall.

2 Likes

Nice! Is this using a web view in the kindle’s browser? I assume this is custom code running on your server. I would be interested to see the code.

1 Like

I have installed this custom Kindle package which allows the Kindle to open a Web view in full screen.

I also had a look into GitHub - NiLuJe/FBInk: FrameBuffer eInker, a small tool & library to print text & images to an eInk Linux framebuffer to make a nativ app for the kindle but stuck to the low hanging fruit of just using the web view.

The Code will be published. There is currently one “hard coded entity fix” i want to solve before i publish it.

3 Likes

I have a question. I have the new Kindle (2022) and this is very interesting for me but, at least for now, I don’t want to jailbreak it. Do I need to jailbreak it ONLY to use it in full screen or I need to do it to use this at all?

This will work on any device that has a browser. To make it look pretty you need a alternative browser on the kindle.

You will need to write your HTML code. I provide some examples in the git repo

If you want to have different generations you would need to implement it in .css

because it would look different on any device.

For example a 10 Gen Paperwhite has a lot more dpi and it looks “small” and the browser UI is visible.

You will need to checkout if there is a way to disable screensaver/sleep mode seems like it works without jailbrake:

Thanks. For now I just want to test even if is not fullscreen. Then will decide if this is a solution.

But still, I’m not very familiar with theses things. Where should I put the files you provide in github? Can you share a more detailed procedure to use this? Again, thanks for this!

This looks really neat!

A cool follow up addition could be to have it directly serve the HTML files and populate the templates live when the page is requested. Then, no secondary web server needed, and the data would always be live :grinning_face_with_smiling_eyes:

1 Like

You would run hatki.py (every min via cron for example) and have a web-server that hosts the files it generates and images etc.

So it can run wherever you want as it connects to your Home Assistant via API.

I have a docker container for that case.

It’s just a template, so you would need to write a bit HTML in the html-templates and add your entities you want.

1 Like

I have Home Assistant running inside docker, so i just spawned another container that hosts me generated-HTML files and images.

This has the advantage that I only do an API call every minute (or how often you want to run the script)

Moonshot would be to integrate this directly into Home Assistant and have it like an add-on.

Great idea! Thanks a lot, I will try it!

Hi Tom,

that looks great. I tried it and used a kindle paperwhite 2. In the browser I get “There was a problem loading this page.” nearly all the time, when trying to access the dashboard. Interestingly it does not happen always, I somehow was able to open the dashboard ones. Did you also experience that behavior and do you have a workaround?

No i did not have that problem, maybe check your webserver logs? make sure the paperwhite is not changing to https://

You need to write the html page yourself. Maybe an syntax error in the files?

I figured it out, the error was in front of the pc. It was related to the IP I gave the webserver, so not related to kindle or hatki.

Hi, I managed to jailbreak my PW3 on 5.13.7 with the watch this jailbreak. However, when I install and attempt to run the WebLaunch extension via KUAL, it kicks me to the home screen and I get an Application Error. When I checked the thread on Mobile Reads, thee two latest entries (one from 2021 and one from this year) both state the same thing. Did you do anything special to get it to work?

I think i have seen this error when the Application has not been installed properly on the kindle. Maybe start from scratch?

There is at least some people having problems:

Hello!

Based on Hatki, I’ve created Kfloorp!

A similar dashboard, but with no need to create templates, no python scripts and easier to host.

Thanks for the inspiration!

Check it out:

3 Likes