Skip to content

Home Information - Your home, your data, organized.

Python

Added new documentation directory structure and initial content.

Anthony Cassandrac53920209d6a
diff --git a/.gitignore b/.gitignore
index 5cfcb3f8..cb2a5120 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,7 +21,9 @@ __pycache__/
/venv/
/data/
/design/
-/docs/
/src/*json
/src/*csv
/src/*txt
+
+/*.html
+/docs/*.html
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 00000000..73219afb
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,7 @@
+<img src="../src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="128">
+
+# Change Log
+
+_High-level view of the applications change history. See releases and commits for more fine-grained history._
+
+- v0.0.1 : February 12, 2025 : Initial public version with basic functionality working.
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 00000000..aed03e81
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,62 @@
+<img src="src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="128">
+
+# Home Information License
+
+This software is licensed under a **dual-license model**:
+
+1. **MIT License** - Free for personal, educational, and non-commercial use.
+2. **Commercial License** - Required for commercial use, including proprietary applications, SaaS, or product distribution.
+
+## 1. Personal and Non-Commercial Use (MIT License)
+
+This software is licensed under the terms of the MIT License for **personal, educational, and non-commercial purposes**.
+You may use, modify, and distribute the software **only** if you comply with the full MIT License terms, available at:
+
+[https://opensource.org/licenses/MIT](https://opensource.org/licenses/MIT)
+
+The MIT License text is included below:
+``` text
+Copyright 2025, Anthony R. Cassandra
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+```
+
+## 2. Commercial Use Requires a License
+
+Any **commercial use** of this software **requires a separate license** from:
+
+POMDP, Inc.
+
+Commercial use includes, but is not limited to:
+- Using the software in a proprietary product
+- Selling or distributing the software as part of a paid service
+- Deploying the software in a revenue-generating SaaS application
+
+To obtain a commercial license, please contact [email protected].
+
+## 3. Contributions
+By contributing to this project, you agree that your contributions are provided under the same dual-license terms.
+
+---
+
+## Summary
+- **You can**: Use, modify, and share for personal and non-commercial purposes under the MIT License.
+- **You cannot**: Use this software commercially without a separate license from POMDP, Inc.
+
+For licensing inquiries, contact: [email protected]
diff --git a/README.md b/README.md
new file mode 100644
index 00000000..7435ff6e
--- /dev/null
+++ b/README.md
@@ -0,0 +1,80 @@
+<img src="src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="204">
+
+# Home Information
+
+An application to visually organizes data about your home and the things in it. Add and place items on the screen and then attach manuals, notes, links, maintenance and repair histories or any other information for easy reference. Optionally integrate with security and home automation systems for a single view of all your house-related information.
+
+
+<img src="docs/img/screenshot-kitchen.png" alt="Kitchen Example" width="300"> <img src="docs/img/screenshot-security.png" alt="Security Example" width="300">
+
+## Project Status
+
+We are looking for early adopters and contributors. The software is functional, but early in its development with many additional feature planned.
+
+# Installation / Running
+
+## Requirements
+
+- Python 3 - installed
+- Docker - installed and running
+- Git - installed
+
+## Installation Quick Start
+``` shell
+git clone [email protected]:cassandra/home-information.git
+cd home-information
+make env-build
+make docker-build
+make docker-run
+```
+Then visit: [http://localhost:9411](http://localhost:9411) to start.
+
+See the [Installation Page](docs/Installation.md) for more details and troubleshooting.
+
+To begin using the app, see the [Getting Started Page](docs/GettingStarted.md).
+
+# Contributing / Development
+
+## Requirements
+
+- Python 3.11 (or higher) - installed
+- Git - installed
+
+The tech stack is:
+- Django 4.2
+- Javascript using jQuery 3.7
+- Bootstrap 4 (CSS)
+- SQLite (database)
+- Redis (caching)
+
+## Development Setup Overview
+
+Setting up for local development looks like this:
+``` shell
+git clone [email protected]:cassandra/home-information.git
+cd home-information
+make env-build-dev
+python3.11 -m venv venv
+. ./init-env-dev.sh
+pip install -r src/hi/requirements/development.txt
+cd src
+./manage.py check
+./manage.py migrate
+./manage.py hi_createsuperuser
+./manage.py hi_creategroups
+./manage.py runserver
+```
+See the [Development Page](docs/Development.md) for more details.
+
+---
+
+# Resources
+
+- [Installation](docs/Installation.md)
+- [Getting Started](docs/GettingStarted.md)
+- [Development](docs/Development.md)
+- [Integrations](docs/Integrations.md)
+- [Contributing](docs/Contributing.md)
+- [Security](docs/Security.md)
+- [ChangeLog](CHANGELOG.md)
+- [License](LICENSE.md)
diff --git a/docs/Contributing.md b/docs/Contributing.md
new file mode 100644
index 00000000..29f5d3ef
--- /dev/null
+++ b/docs/Contributing.md
@@ -0,0 +1,5 @@
+<img src="../src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="128">
+
+# Contributing
+
+_TBD_
diff --git a/docs/Design.md b/docs/Design.md
new file mode 100644
index 00000000..53257db4
--- /dev/null
+++ b/docs/Design.md
@@ -0,0 +1,87 @@
+<img src="../src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="128">
+
+_WORK IN PROGRESS_
+
+# Design
+
+## Branding, Icons, Logos
+
+
+
+*** Gimp
+
+
+*** ImageMagick
+# Use this to scale images
+
+sudo apt install imagemagick potrace
+** MacOS setup
+*** Python 3.11
+# get python 3.11 package and install on OS X
+https://www.python.org/downloads/
+*** ImageMagick
+# Use this to scale images
+
+brew install imagemagick potrace
+
+
+## Location SVGs
+
+For best result use SVG viewbox at least 1200 in each direction and less than 2200.
+
+Does not have to be square.
+
+Create a series of individual SVG files with a single <path> tag to represent different types of features. The <path> "id" attribute should have one of the following ids to indicate which feature it is:
+
+asphalt
+bathtubs
+brick
+ceiling-transitions
+countertops
+dead-space
+door-arcs
+doors
+exterior-walls
+fencing
+fireplaces
+floor-transitions
+foliage
+furniture
+grass
+gravel
+ground
+interior-floors
+interior-walls
+landscape-transitions
+mulch
+pavement
+pavers
+pool-coping
+property-lines
+rock-beds
+secondary-walls
+sheds
+shelves
+sinks
+stairs
+stone-walls
+tiles
+toilets
+utilities
+water
+windows
+wood-decks
+
+If using Gimp, this translates to having a "Path" with the given name, then using the "Export Path" function since Gimp will add the path name as the path id.
+
+With the individual SVG files assembled in a directory, run the following command to combine and format them into a single SVG suitable for importing.
+
+./tools/combine-svgs.py -i <INPUT_DIR> -o <OUTPUT_FILE>
+
+e.g.,
+
+./tools/combine-svgs.py -i locations/bordeaux/paths -o locations/bordeaux/bordeaux.svg
+./tools/combine-svgs.py -i locations/bordeaux-attic/paths -o locations/bordeaux-attic//bordeaux-attic.svg
+./tools/combine-svgs.py -i locations/default/paths -o locations/default/default.svg
+
+Try to keep the SVG image size on the small side. It will get loaded and manipulated by javascript, so past a certain size there will probably be issues.
diff --git a/docs/Development.md b/docs/Development.md
new file mode 100644
index 00000000..b5924981
--- /dev/null
+++ b/docs/Development.md
@@ -0,0 +1,152 @@
+<img src="../src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="128">
+
+# Development
+
+## Requirements and Dependencies
+
+- Python 3.11 (or higher) - installed
+- Git - installed
+- Redis - installed and running
+
+See the [Prerequisite Installs Section](#prerequisite-installs) below if you want help installing those.
+
+## Tech Stack
+
+- Django 4.2 (back-end)
+- Javascript using jQuery 3.7 (front-end)
+- Bootstrap 4 (CSS)
+- SQLite (database)
+- Redis (caching)
+
+## Development Setup
+
+### Download
+
+Decide where you want to download the code to and adjust the following:
+``` shell
+PROJ_DIR="proj"
+mkdir -p $PROJ_DIR
+cd $PROJ_DIR
+```
+Download the code:
+``` shell
+git clone [email protected]:cassandra/home-information.git
+cd home-information
+```
+
+### Environment Setup
+
+Generate the environment variable file and review with the command below. The file will contain sensitive secrets and are stored in a `.private` directory. Also note that administrative credentials created during this next step and save them somewhere safe.
+``` shell
+make env-build-dev
+```
+This generates an environment variable file that is sourced before running:
+```
+$PROJ/.private/env/development.sh
+```
+This directory and its files should not be checked into the code repository. There is an existing `.gitignore` entry to prevent this.
+
+
+Next, create the Python virtual environment.
+``` shell
+cd $PROJ_DIR
+python3.11 -m venv venv
+```
+Now source trhe environment and virtual environment with this convenience script:
+``` shell
+. ./init-env-dev.sh
+```
+In the future, just source'ing this script is all you need to set things up for development.
+
+Next, install all the app's required Python packages.
+``` shell
+pip install -r src/hi/requirements/development.txt
+```
+
+### App and Database Initializations
+
+Initialize the database and add the admin users and groups.
+``` shell
+cd $PROJ_DIR
+cd src
+./manage.py check
+./manage.py migrate
+./manage.py hi_createsuperuser
+./manage.py hi_creategroups
+```
+
+### Running
+
+
+``` shell
+./manage.py runserver
+```
+
+Then, visit: [http://127.0.0.1:8411](http://127.0.0.1:8411) to access the app.
+
+If you want to familiarize yourself with how to use the app before diving inot the code, see the [Getting Started Page](GettingStarted.md).
+
+## Developer Documentation
+
+The code is the best documentation for lower-level details, but there are some higher-level concepts that are useful to help orient developers. See [dev/README.md](dev/README.md) for all that high-level, developer-specific documentation.
+
+## Contributing
+
+See the [Contributing Page](Contributing.md) for guidelines and processes.
+
+## Prerequisite Installs <a id="prerequisite-installs"></a>
+
+_Provided for convenience. May be outdated._
+
+### Python
+
+#### MacOS
+
+Get python 3.11 package and install from: [https://www.python.org/downloads/](https://www.python.org/downloads/)
+
+#### Ubuntu (GNU/Linux)
+
+``` shell
+ sudo apt update && sudo apt upgrade
+ sudo add-apt-repository ppa:deadsnakes/ppa
+ sudo apt-get update
+ apt list | grep python3.11
+ sudo apt-get install python3.11
+ sudo apt install python3.11-venv
+```
+
+### Redis
+
+#### MacOS
+
+Download tarball from: [https://redis.io/download](https://redis.io/download).
+
+
+``` shell
+brew install redis
+
+# Yields these executables:
+/usr/local/bin/redis-server
+/usr/local/bin/redis-cli
+
+mkdir ~/.redis
+touch ~/.redis/redis.conf
+```
+Then run with `redis-server`.
+
+#### Ubuntu (GNU/Linux)
+
+``` shell
+cd ~/Downloads
+tar zxvf redis-6.2.1.tar.gz
+cd redis-6.2.1
+make test
+make
+
+sudo cp src/redis-server /usr/local/bin
+sudo cp src/redis-cli /usr/local/bin
+
+mkdir ~/.redis
+touch ~/.redis/redis.conf
+```
+Then run with `redis-server`.
diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md
new file mode 100644
index 00000000..b5cfe407
--- /dev/null
+++ b/docs/GettingStarted.md
@@ -0,0 +1,8 @@
+<img src="../src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="128">
+
+
+ZZZ WIP
+
+# Getting Started
+
+
diff --git a/docs/Installation.md b/docs/Installation.md
new file mode 100644
index 00000000..89bf4c38
--- /dev/null
+++ b/docs/Installation.md
@@ -0,0 +1,175 @@
+<img src="../src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="128">
+
+# Installation
+
+## Requirements and Dependencies
+
+- Python 3 - installed
+- Docker - installed and running
+- Git - installed
+
+## Pre-install Considerations
+
+By default, the installation does not require sign in and does not have email configure for alerts. This is to make it as simple as possible to get started. However, before installing, you might want to consider whether you want to enable these. You can change these after the initial install by adjusting the environment variable file.
+
+### Emails
+
+The alert mechanisms have a visual and audible presentation on the screen, but to allow email alerts when away from the device, you can configure it to send emails. This is prompted when you run the `make env-build` script (see below).
+
+### Sign In
+
+If you want to require sign in and authentication of users, then you will need to also configure email sending since it uses emailed "magic codes" as its authentication mechanism. For local deployments, security might not be a major priority, so it is up to you whether you see this as a feature of annoyance.
+
+## Installation Steps
+
+### Running on localhost
+
+Decide where you want to download the code to and adjust the following:
+``` shell
+PROJ_DIR="proj"
+mkdir -p $PROJ_DIR
+cd $PROJ_DIR
+```
+Download the code:
+``` shell
+git clone [email protected]:cassandra/home-information.git
+cd home-information
+```
+
+#### Building
+
+Generate the environment variable file and review with the command below. The file will contain sensitive secrets and are stored in a `.private` directory. Also note that administrative credentials created during this next step and save them somewhere safe.
+``` shell
+make env-build
+```
+This generates an environment variable file used when running:
+```
+$PROJ/.private/env/local.env
+```
+This directory and its files should not be checked into the code repository. There is an existing `.gitignore` entry to prevent this.
+
+Build the Docker image. (This will take a while the first time.)
+``` shell
+make docker-build
+```
+
+#### Running
+
+Decide if you want to run the Docker image in the foreground or background. Foreground best for first attempts as it will show the errors to the console.
+
+The first time you run this container, it will need to do some initializations (e.g., setting up the database). It will start faster after this first time.
+
+To run in the foreground:
+``` shell
+make docker-run-fg
+```
+Or in the background:
+``` shell
+make docker-run
+```
+When you want to stop the Docker container:
+``` shell
+make docker-stop
+```
+
+#### Result
+
+The server runs on port 9411, so point your browser to: [http://localhost:9411](http://localhost:9411)
+
+The database file and any uploaded documents live outside the Docker container in your home directory. Their default locations are:
+- Database file: `$HOME/.hi/database/hi.sqlite3`
+- Uploaded files: `$HOME/.hi/media`
+
+### Getting Started
+
+With the server running, you are now ready to set up for your home's use. See the [Getting Started Page](GettingStarted.md).
+
+### Beyond localhost
+
+When you are ready to deploy this for access to other devices, some extra steps are needed. Web browser and Django security models enforce strict checking of hostnames, so you may need to change some of your environment configurations in the file `$PROJ/.private/env/local.env`.
+
+#### Allowed Hosts
+
+You will need to know what URL(s) you will be loading in the web browser and set this environment variable:
+``` shell
+export HI_EXTRA_HOST_URLS="${SCHEME}://${HOST}:${PORT}"
+```
+If you want to use more than one url, put them all in there with a space between them. e.g., Adding one for the mnemonic host name and one for accessing through its IP address.
+
+#### User Sign In
+
+If you have enabled requiring individual user logins, then you will need to create users manually. There is no general signup process through the app (currently), so all users need to be added using the administrator credentials using Django administrative pages.
+
+Sign into the Django admin console using the credentials defined in the environment file as:
+- `DJANGO_SUPERUSER_EMAIL`
+- `DJANGO_SUPERUSER_PASSWORD`
+
+The Django admin console URL for adding users is: [http://127.0.0.1:8411/admin/custom/customuser/add/](http://127.0.0.1:8411/admin/custom/customuser/add/)
+
+Make sure email is configured and that you use a valid email address. Login requires getting an email confirmation code.
+
+Note: You could sign in without creating users by using the existing admin user. That is (naturally) not recommended.
+
+#### Integrations
+
+If you use any of the built-in integrations, so additional changes may be needed. See the
+[Integrations Page](docs/Integrations.md) for more details.
+
+## Troubleshooting
+
+### Emails (if enabled)
+
+Email settings can be adjusted in env file with these settings:
+``` shell
+HI_EMAIL_HOST
+HI_EMAIL_PORT
+HI_EMAIL_HOST_USER
+HI_EMAIL_HOST_PASSWORD
+HI_EMAIL_USE_TLS
+HI_EMAIL_USE_SSL
+```
+Your email provider may require configuration to allow the program to send emails.
+
+### Sign Ins (if enabled)
+
+Requiring sign in depends on emails. If you have problems getting email working, then disable sign in by setting the env file:
+``` shell
+HI_SUPPRESS_AUTHENTICATION="true"
+```
+
+## Prerequisite Installs
+
+_Provided for convenience. May be outdated._
+
+### Python
+
+#### MacOS
+
+Get python 3.11 package and install from: [https://www.python.org/downloads/](https://www.python.org/downloads/)
+
+#### Ubuntu (GNU/Linux)
+
+``` shell
+ sudo apt update && sudo apt upgrade
+ sudo add-apt-repository ppa:deadsnakes/ppa
+ sudo apt-get update
+ apt list | grep python3.11
+ sudo apt-get install python3.11
+ sudo apt install python3.11-venv
+```
+
+### Docker
+
+#### MacOS
+
+See: [https://docs.docker.com/desktop/setup/install/mac-install/](https://docs.docker.com/desktop/setup/install/mac-install/)
+
+#### Ubuntu (GNU/Linux)
+
+``` shell
+sudo apt-get update
+sudo apt-get remove docker docker-engine docker.io
+sudo apt install docker.io
+sudo apt install docker-compose
+sudo systemctl start docker
+```
diff --git a/docs/Integrations.md b/docs/Integrations.md
new file mode 100644
index 00000000..4235b2bc
--- /dev/null
+++ b/docs/Integrations.md
@@ -0,0 +1,18 @@
+<img src="../src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="128">
+
+ZZZ WIP
+
+
+# Integrations
+
+## ZoneMinder
+
+
+### Permission Issues
+
+zzzz
+If you are going to use the zoneminder integration, then viewing the camera video streams requires requires the server to authroize the browser to allow this off-site "origin". You will need to add the ZoneMinder URL to this envirornment variable.
+
+export HI_EXTRA_CSP_URLS="${SCHEME}://${HOST}:${PORT}"
+
+## Home Assistant
diff --git a/docs/Security.md b/docs/Security.md
new file mode 100644
index 00000000..aa00b70f
--- /dev/null
+++ b/docs/Security.md
@@ -0,0 +1,8 @@
+<img src="../src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="128">
+
+# Security
+
+The current version of this software is meant to be run on local, trusted networks only.
+
+When future versions are developed to be multi-tenant and Internet accessible, this document will be updated.
+
diff --git a/docs/dev/Architecture.md b/docs/dev/Architecture.md
new file mode 100644
index 00000000..95eacffc
--- /dev/null
+++ b/docs/dev/Architecture.md
@@ -0,0 +1,8 @@
+<img src="../src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="128">
+
+_WORK IN PROGRESS_
+
+# Architecture
+
+_TBD_
+
diff --git a/docs/dev/DataModel.md b/docs/dev/DataModel.md
new file mode 100644
index 00000000..7fdee7eb
--- /dev/null
+++ b/docs/dev/DataModel.md
@@ -0,0 +1,92 @@
+<img src="../src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="128">
+
+_WORK IN PROGRESS_
+
+# Data Model and Concepts
+
+## Location
+
+- Has an SVG image that defines the visual and coordinate space
+- Has zero or more entities
+- Entities indirectly associated through a position
+- Has zero or more collections
+- Collections indirectly associated through a position
+- Can have one or more locations, though 1 is most typical
+
+## LocationView
+
+- Defines a bounding box area of the location
+- Defines what is and is not visible
+- Defines the view context for sensors and controllers (info, control)
+- ViewContext = { information, control }
+
+## LocationItem
+
+- Used as an abstraction/interface for items that can be associated with a Location.
+- Helps define a consistent visual represenation for LocationView.
+- Initially, Entity and Collection are the two concrete examples fof an LocationItem
+
+## Entity
+
+- A physical or logical object
+- Has attributes
+- May or may not have a position in the location
+- May or may not have sensors and controller
+- May or may not have (hidden) state variables.
+- May or may not define a coverage Area for its sensors/controllers
+
+## EntityState
+
+- The hidden state of the entity/device that is sensed and/or controlled
+- A single entity may have many states
+
+## EntityStateDelegation
+
+- An EntityState of an entity may just be a proxy for another entity's state
+- e.g., A thermometer entity with a temperature state is a proxy for an area
+- We use the terms 'delegate' and 'principal' for the entities involved in the relation.
+- May be one-to-one, one-to-many or many-to-one relationship
+
+## Device (runtime concept, not a DB model)
+
+- An entity with at least one sensor or controller
+
+## Area (runtime concept, not a DB model)
+
+- An wrapper around Entity[type=area]
+- Usually defining a physical area that is being sensed and/or controlled
+- Defines special visual handling
+- Usually defined by SVG path
+- If has location/path, should be a (closed, convex) SVG path
+- Usually created to be proxied by entities/devices
+- Has implicit states that can be related to sensors and controller states
+- Clicking will invoke sensors/controllers defined for the area
+- Only shows for views it is associated with
+- Can be associated with mutliple views
+
+## Sensor
+
+- Provides an observation value of a single entity state variable
+- Sensors and their states can only be created through integrations (not user editable)
+
+## Controller
+
+- Provides an action to affect a single entity state variable
+- Controllers and their states can only be created through integrations (not user editable)
+
+## Collection
+
+- Defines a logical connection for a group of one or more entities
+- Collection of Entity for showing button and accessing list view
+- Often used to group non-positional items
+- Some entities in a collection may be unpositioned
+- Tools, appliances and devices are examples of unpositioned collections
+- Collections are tied to a view
+- Collection access buttons show at bottom
+- If has SVG position, can be overlayed on view
+- Inherits from view the view type (control, info)
+- Can be associated with mutliple views
+
+## Collection[type=zone]
+
+- Can provide way to group to get single button control of multiple controllers
diff --git a/docs/dev/EntityStatus.md b/docs/dev/EntityStatus.md
new file mode 100644
index 00000000..aa29464b
--- /dev/null
+++ b/docs/dev/EntityStatus.md
@@ -0,0 +1,34 @@
+<img src="../src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="128">
+
+_WORK IN PROGRESS_
+
+# Entity Status Display
+
+All entity state variables are indirectly observed through a sensor, and all sensor values come from an integration, usually by polling an external service, device, file, etc. Integrations are responsible for normalizing sensor values and encapsulating them in a SensorResponse instance. The SensorResponseManager is the module that will receive these responses from integrations and will provide the latest status values and value histories to the various views. The SensorResponseManager also detects changes of status values and feed those into the alerting subsystem.
+
+## Status (Visual) Display [Location View]
+
+A given Entity (SVG icon or SVG path) can alter its screen appearance based on the value of sensor readings for its underlying state variables. Mapping sensor responses to SVG appearance is the responsibility of the Status Display Helpers using StatusDisplayData. There are a few ways this can be done, depending on the underlying entity state type that the sensor is observing.
+
+1. It can take the (normalized) sensor value directly and add it as a CSS class name to the displayed SVG file. This allows CSS rules to adjust the visual display for any well-known sensor values (hardcoded in CSS rules).
+2. For well known sensor values, there can also be predefined/hard-coded alternative SVG icons.
+3. It can map a sensor value into a color scheme that is used for the SVG fill, stroke and opacity attributes. This is predominantly used for area entitiess (closed SVG paths) to visually show activity in an area. This can be from a continuous variable sensor value (e.g., temperature) or a function of the sensor value history (see Value Decaying section below).
+
+## Value Decaying
+
+For some entity state types (and sensors), we not only want to display the current sensor value, but also represent the recent past values. For example, when motion is detected in an area, we want to highlight that, but after the motion event is over, we will want to visually show that it was "active" in the recent past. e.g., Active motion is shown as red, but over time decays to oranges then yellows when the motion is over.
+
+## Multiple Sensors
+
+The visual representation provided is always for an Entity, but an entity can have multiple states and multiple sensors. Trying to reason about and support visual distinctions across the cross-product of values for multiple sensors would be more complicated than anyone could understand as well and complicated to implement. Thus, the design decision is that at most one entity state will determine the visual view of the SVG.
+
+To achieve this, we define a default priority of the entity states and the highest priority state will be used. However, a single static priority order is too limiting for many use cases. Thus, we need to be able to support different priorties for different purposes. For example, we may want a climate control view and a security view of a defined area. In the former, we want the temperature sensor value to dictate the visual display, while in the latter, the motion sensor should have its value impacting the area's visual display.
+
+To allow some user control over the visuals from sensor values, each LocationView instance can have its location_view_type set to one of the enum values whicih will determine which EntityStateType value will take precedence for status displays. See hi.apps.location.enums.LocationViewType.
+
+## Client-Server Interactions to Refresh State Display
+
+The Javascript polling.js module polls the server for the latest sensor values for all entity states. The server fetches the latest sensor values via StatusDataHelper, computes their visual display using StatusDisplayData and then returns a generalized JSON dicttionary that maps css class names to a set of attribute name-value pairs to update. The original rendered HTML from the Django templates will make sure the proper entities have the proper class names and attribute values for this to work.
+
+The polling.js module tries to be general and only deal with finding class names and updating attribute name-value pairs. This works for the SVG <g> aND <path> tags. However, there a few special case patterns needs for SELECT tags for controllers and <div> elements for the non-SVG display cases (e.g., viewing entity status in a Collection View or in a sttaus modal).
+
diff --git a/docs/dev/EventsAlarmsAlerts.md b/docs/dev/EventsAlarmsAlerts.md
new file mode 100644
index 00000000..bdf173a8
--- /dev/null
+++ b/docs/dev/EventsAlarmsAlerts.md
@@ -0,0 +1,19 @@
+<img src="../src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="128">
+
+_WORK IN PROGRESS_
+
+# Events, Alarms and Alerts
+
+`SensorResponses` can create events for a user-defined set of rules.
+
+`EventDefinitions` define rules and get triggered off changes in one or more `EntityStates`.
+
+Events may result in zero or more `Alarms` (can also trigger a control action).
+
+An `Alarm` defines which `SecurityLevel` it is applicable to and the importance via the `AlarmLevel`.
+
+If the `Alarm` matches the current system security level, it becomes an `Alert` with the defined `AlarmLevel` and an unique `Alarm` signature.
+
+Alerts are those `Alarms` that we want to get the user's attention for.
+
+An `Alert` may contain one or more `Alarm` instances since there is only ever one `Alert` active for a given alarm signature.
diff --git a/docs/dev/Integrations.md b/docs/dev/Integrations.md
new file mode 100644
index 00000000..7053c30d
--- /dev/null
+++ b/docs/dev/Integrations.md
@@ -0,0 +1,93 @@
+<img src="../src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="128">
+
+_WORK IN PROGRESS_
+
+# Integrations
+
+- Each integration is a Django app in the `hi/services` directory.
+- The `hi.integration` app handles integration management and required interfaces.
+
+## Nomenclature
+
+- **integration_id** - Unique identifier for each integration type
+- **integration_key** - Used to associate with external integration for entities, sensors, controllers. etc
+- **integration_attr_key** - Unique identifier for the user-defined attributes needed by the implementation
+
+## How to Add an Integration
+
+_Looking at an existing integration is the best way to see the pattern of what is needed._
+
+Create a new Django app. e.g.,
+``` shell
+cd src/hi/services
+../../manage.py startapp myintegration
+cd ..
+```
+
+Ensure `name` is fully qualified in (e.g., `hi.services.myintegration`):
+``` shell
+hi/services/myintegration/app.py
+```
+
+Add 'myintegration' to `INSTALLED_APPS` in:
+``` shell
+hi/settings/base.py
+```
+
+Need this to be able to reference templates, e.g., `myintegration/panes/somepage.html`
+
+Add to the IntegrationType enum
+
+``` shell
+ MYINTEGRATION = ( 'My Integration', 'For my stuff.' )
+```
+
+Create subclass of enum `IntegrationAttributeType`. This defines the necessary attributes the integration needs (URLs, credentials, etc.)
+
+Create an "Integration Gateway" using `IntegrationGateway`.
+``` shell
+hi/services/myintegration/myintegration_gateway.py
+```
+
+With content starting like this:
+
+``` shell
+from hi.integration.integration_gateway import IntegrationGateway
+
+class MyIntegrationGateway( Singleton, IntegrationGateway ):
+```
+
+Add gateway to the `IntegrationFactory` class
+``` shell
+hi/integrations/integration_factory.py:get_integration_gateway()
+
+from hi.services.myintegration.myintegration_gateway import MyIM
+
+elif integration_type == IntegrationType.MYINTEGRATION:
+ return MyIntegrationGateway
+
+```
+
+### Implement the IntegrationGateway Methods
+
+#### Activate
+
+In this simplest case, this can just update the status of the Integration DB object and display an 'info_message'.
+
+In other caess, this allows an entry point into any activation flow. As a typical example, this would first render apage with a form for the user to fill out any prerequirsite integration properties. e.g., URLs, usernames, passwords, etc.
+
+#### Deactivate
+
+In this simplest case, this can just update the status of the Integration DB object and display an 'info_message'.
+
+In other cases, this allows an entry point into a deact9ivation flow. For example, if the database entries associated with thei integration need to be removed, this could first gather and show all that need deletion and asking user for confirmation.
+
+#### Manage
+
+The manage method is the gateway to adding as much additional configuration views and administratuve features as needed.
+
+Any additional views needed beside for enable, disable and manage should go through the 'manage' url with adding appropriate GET and POST parameters as needed for the particular admin feature.
+``` shell
+{% url 'integration_manage name=integration.integration_type.name %}
+```
+This url support both GET and POST, thoujgh bth go through the manage() method.
diff --git a/docs/dev/README.md b/docs/dev/README.md
new file mode 100644
index 00000000..5f5ba80b
--- /dev/null
+++ b/docs/dev/README.md
@@ -0,0 +1,5 @@
+<img src="../src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="128">
+
+# Developer Documentation
+
+See the markdown files in this directory for various developer-related documentation.
diff --git a/docs/dev/RoadMap.md b/docs/dev/RoadMap.md
new file mode 100644
index 00000000..38228727
--- /dev/null
+++ b/docs/dev/RoadMap.md
@@ -0,0 +1,8 @@
+<img src="../src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="128">
+
+_WORK IN PROGRESS_
+
+# Development RoadMap
+
+_TBD_
+
diff --git a/docs/dev/Settings.md b/docs/dev/Settings.md
new file mode 100644
index 00000000..339d5917
--- /dev/null
+++ b/docs/dev/Settings.md
@@ -0,0 +1,19 @@
+<img src="../src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="128">
+
+_WORK IN PROGRESS_
+
+# Settings
+
+_TBD_
+
+## Adding a New Tab Section to the Config UI
+
+- Add entry to `ConfigPageType`
+- Add a View - view class should extend `ConfigPageView`
+- Override:
+ - `config_page_type()`
+ - `get_main_template_name()`
+ - `get_template_context()`
+- Create template (matching name)
+- Should extend `config/pages/config_base.html`
+- Add to `urls.py` (ensure this is included in top-level `urls.py`)
diff --git a/docs/dev/Simulator.md b/docs/dev/Simulator.md
new file mode 100644
index 00000000..9317c505
--- /dev/null
+++ b/docs/dev/Simulator.md
@@ -0,0 +1,18 @@
+<img src="../src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="128">
+
+_WORK IN PROGRESS_
+
+# Simulator
+
+The simulator is used to simulate integrations to help test the Home Application app.
+
+## Initialize the Simulator Database
+
+``` shell
+cd $PROJ_DIR
+cd src
+./simulator.py migrate
+./simulator.py hi_createsuperuser
+./simulator.py hi_creategroups
+./simulator.py runserver
+```
diff --git a/docs/dev/Templates.md b/docs/dev/Templates.md
new file mode 100644
index 00000000..179c4034
--- /dev/null
+++ b/docs/dev/Templates.md
@@ -0,0 +1,25 @@
+<img src="../src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="128">
+
+_WORK IN PROGRESS_
+
+# Django Templates
+
+## Template naming conventions
+
+- `pages` - For full HTML pages
+- `modals` - For HTML modals
+- `panes` - For all other HTML page fragments
+- `email` - For email templates
+- `svg` - for SVG files.
+
+## The "Hi Grid" Template Structure
+
+# Important DIV Ids
+
+This are gathered in `src/hi/constants.py:DIV_IDS`:
+
+- `#hi-main-content` - This is the main display area, excluding header buttons, footer buttons and the side panel.
+- `#hi-side-content`
+- `#hi-top-buttons`
+- `#hi-button-bottons`
+- `#hi-config-integration-tab` - Integrations use this for any configuration-related views.
diff --git a/docs/dev/VisualTesting.md b/docs/dev/VisualTesting.md
new file mode 100644
index 00000000..9c1a26be
--- /dev/null
+++ b/docs/dev/VisualTesting.md
@@ -0,0 +1,34 @@
+<img src="../src/hi/static/img/hi-logo-w-tagline-197x96.png" alt="Home Information Logo" width="128">
+
+# Visual Testing Page
+
+Visit: [http:/tests/ui](http:/tests/ui).
+
+These tests/ui views are only available in the development environment when DEBUG=True. (They are conditionally loaded in the root urls.py.)
+
+## Adding to the Visual Testing Page
+
+The `hi.tests.ui` module uses auto-discovery by looking in the app directories.
+
+In the app direcxtory you want to have a visual testing page:
+
+``` shell
+mkdir -p tests/ui
+touch tests.__init__.py
+touch tests/ui.__init__.py
+```
+
+Then:
+- Create `tests/ui/views.py`
+- Create `tests/ui/urls.py` (This gets auto-discovered. Esnure some default home page rule.)
+
+The templates for these tests, by contention, would be put in the app's templates directory as `templates/${APPNAME}/tests/ui`.
+
+## Email testing
+
+There are some helper base classes to test viewing email formatting and sending emails.
+``` shell
+hi.tests.ui.email_test_views.py
+```
+This requires the email templates follow the naming patterns expected in view classes.
+
diff --git a/docs/img/screenshot-kitchen.png b/docs/img/screenshot-kitchen.png
new file mode 100644
index 00000000..cf16f36d
Binary files /dev/null and b/docs/img/screenshot-kitchen.png differ
diff --git a/docs/img/screenshot-security.png b/docs/img/screenshot-security.png
new file mode 100644
index 00000000..2bf770bf
Binary files /dev/null and b/docs/img/screenshot-security.png differ
diff --git a/src/hi/static/img/hi-logo-w-tagline-197x96.png b/src/hi/static/img/hi-logo-w-tagline-197x96.png
new file mode 100644
index 00000000..14c612e6
Binary files /dev/null and b/src/hi/static/img/hi-logo-w-tagline-197x96.png differ
diff --git a/src/hi/templates/pages/interstitial_page.html b/src/hi/templates/pages/interstitial_page.html
index b58e58f9..6c56555a 100644
--- a/src/hi/templates/pages/interstitial_page.html
+++ b/src/hi/templates/pages/interstitial_page.html
@@ -7,7 +7,7 @@
<div class="">
<img class="img-fluid" src="{% static 'img/hi-logo-467x200.png' %}" alt="Home Information Logo" />
</div>
- <div class="">
+ <div class="lead">
<em>Your home, your data, organized.</em>
</div>
</div>