Package: hud
# Homeassistant UI DisplayThis is a UI for [home-assistant](http://home-assistant.io) i'vewritten for own use. It's main purpose is to be able to controlhome-assistant from a pi with a touchscreen mounted on the wall.This project uses [pygame](http://pygame.org) as backed & the awesome[pgu](https://github.com/parogers/pgu) for the GUI. Using a custom theme& UI elements, I've tried to mimmick the web ui of home-assistant.## Screenshot![images/screencast.png](images/screencast.gif)![images/touchscreen.gif](images/touchscreen.gif)## features* displaying group items* switching on/off of lights* displaying sensor data* Uses EventStream (`/api/stream`) for streaming updates* Using `icon_font_to_png` to use the Material Design Icon font on the fly.* Cool## Install```bash# install the pygame dependencies for compilation.sudo apt install python3-pip python3-dev libsdl-image1.2-dev libsdl-mixer1.2-dev  libsdl-ttf2.0-dev libsdl1.2-dev libsmpeg-dev# Clone the repogit clone https://github.com/subutux/HUD# Install using pipsudo pip3 install --process-dependency-links .# run the helphud --help```### Why `--process-dependency-links`To my knowledge, there are no packages for `pygame` and `pgu` in PyPi forpython3.This option uses the `dependency_links` in `setup.py` for getting the tar.gzfiles from their repos. It's nasty, I know. Can't help it!Side note: The raspberry pi repos contain a pygame package for python3!## ConfigurationHUD needs a configuration file, ini-style. For Example:```ini[HomeAssistant]Host = localhostPort = 8123Key = my-secret-passwordSSL = False[lights]group=lichten_living```The first one speaks for itself, home assistant configuration.The second one is a group definition. it needs an group entity name(for ex. if you have `group.lichten_living` enter `lichten_living`)There can be as many sections as you want, if you have at least oneHomeAssistant section.## Auto startWhen running on a pi, you probably want to auto start hud.When installing hud, there are some extra files installed:- /etc/systemd/system/hud.serviceA systemd service for starting up HUD- /etc/default/hud.optsYour command line parameters for HUD- /usr/local/sbin/hud.inita workaround for a problem with sseclient in systemdAbout that last one,This is a work around for a nasty problem withSSEClient/requests. The problem was that the requests with'stream=True' would'nt initialize when hud is run directly fromsystemd.For some weird reason running hud from this bash'wrapper' fixesthe annoyance.If someone has any idea why this is, let me know. I'm eager to know.### Enabling serviceTo enable the service, run:```bashsudo systemctl enable hud.servicesudo systemctl daemon-reload```## Arguments```usage: hud [-h] -c CONFIG [-f /dev/fbX] [-t /dev/input/eventX] [-n][-H host.name] [-p PORT] [-k KEY] [-s] [-v][-L {INFO,WARNING,ERROR,CRITICAL,DEBUG}] [-l LOGFILE]A pygame GUI for Home Assistant.optional arguments:-h, --help            show this help message and exitConfiguration:-c CONFIG, --config CONFIGconfig file to use-f /dev/fbX, --framebuffer /dev/fbXUse this framebuffer as output for the UI (defaults towindow mode)-t /dev/input/eventX, --touchscreen /dev/input/eventXEnable touchscreen integration. Use this as eventinput-n, --no-display      We don't have a display. Sets the SDL_VIDEODRIVER to"dummy". Usefull for testingHomeAssistant:(optional) Parameters to override the config file-H host.name, --homeassistant host.nameThe location of home-assistant-p PORT, --port PORT  the port to use for home-assistant (default: 8123)-k KEY, --key KEY     The api password to use (default: None)-s, --ssl             Use ssl (default false)Logging:(optional) Logging settings-v, --verbose         Log output-L {INFO,WARNING,ERROR,CRITICAL,DEBUG}, --logLevel {INFO,WARNING,ERROR,CRITICAL,DEBUG}Log level to use (default: ERROR)-l LOGFILE, --logfile LOGFILEInstead of logging to stdout, log to this file```## DisclamerDon't look at the code, it's ugly! You're always welcome to post a pull requestto make the code cleaner, or just give me some pointers. I love to learn more!