Simple Home Assistant Addon
This is a simple Home Assistant addon that demonstrates the basic structure and functionality of a Home Assistant addon with a web interface.
Features
- Basic addon structure
- Service registration
- Logging capabilities
- Python-based implementation
- Web interface for interaction
- API endpoints for status and messaging
Installation
Method 1: Local Development
- Build the Docker image:
docker build -t simple-addon .
-
Push the image to your container registry
-
Add the addon to your Home Assistant instance through the Supervisor interface
Method 2: Home Assistant Add-on Store
-
Add this repository URL to your Home Assistant add-on store:
- Navigate to Settings → Add-ons → Add-on Store
- Click the three dots in the top right corner
- Select "Repositories"
- Add the URL of this repository
-
Find the "Simple Addon" in the add-on store and click install
Configuration
The addon can be configured through the Home Assistant Supervisor interface. Available options:
message: Default message to display (default: "Hello from Home Assistant!")
Usage
Web Interface
The addon provides a web interface accessible through:
- Home Assistant sidebar (the addon adds an icon to the sidebar)
- Direct URL:
http://your-home-assistant:8099/addon/
The web interface allows you to:
- Check the addon status
- Send messages to Home Assistant
- View activity logs
Service Calls
You can also use the addon's services through Home Assistant's service calls:
service: simple_addon.hello
data:
message: "Hello from Home Assistant!"
API Endpoints
The addon exposes the following API endpoints:
GET /api/status- Get the current status of the addonPOST /api/message- Send a message to the addon
Development
To develop this addon, you'll need:
- Docker
- Python 3.8+
- Home Assistant development environment
Project Structure
/
├── config.yaml # Addon configuration
├── Dockerfile # Docker build instructions
├── main.py # Main Python code
├── README.md # Documentation
└── web/ # Web interface files
├── index.html # HTML interface
├── styles.css # CSS styling
└── script.js # JavaScript for interactivity
License
MIT License
Description
Languages
Python
33.8%
JavaScript
29.2%
CSS
16.8%
HTML
11.5%
Dockerfile
7.4%
Other
1.3%