Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hemtjanst/hallonlarm
Raspberry Pi GPIO to MQTT and Hemtjänst
https://github.com/hemtjanst/hallonlarm
domotic gpio home-automation homekit mqtt raspberry-pi smarthome
Last synced: about 1 month ago
JSON representation
Raspberry Pi GPIO to MQTT and Hemtjänst
- Host: GitHub
- URL: https://github.com/hemtjanst/hallonlarm
- Owner: hemtjanst
- License: apache-2.0
- Created: 2017-08-12T23:49:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-18T10:35:30.000Z (over 5 years ago)
- Last Synced: 2024-10-29T01:13:36.402Z (2 months ago)
- Topics: domotic, gpio, home-automation, homekit, mqtt, raspberry-pi, smarthome
- Language: Go
- Homepage: https://hemtjan.st/hallonlarm
- Size: 30.3 KB
- Stars: 5
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HallonLarm
HallonLarm is:
* The Swedish words "Hallon" (Raspberry) and "Larm" (Alarm)
* An RaspberryPi application that:
* Forwards GPIO events to MQTT
* Listens to MQTT topics and sets GPIO outputs
* Implements the [Hemtjänst](https://github.com/hemtjanst/hemtjanst) protocol for automatic discovery## Usage
Build and install HallonLarm:
```bash
# Install dep and dependencies
go get -u github.com/golang/dep/cmd/dep
dep ensure# Build for ARMv6, Raspberry Pi 1-2:
env GOOS=linux GOARCH=arm GOARM=6 go build -o hallonlarm_armv6 .# Build for ARMv7, Raspberry Pi 3+:
env GOOS=linux GOARCH=arm GOARM=7 go build -o hallonlarm_armv7 .# Copy the binary to /usr/local/bin
sudo cp hallonlarm_armv[67] /usr/local/bin/hallonlarm# Install the unit file
sudo cp hallonlarm.service /etc/systemd/system/# Edit the unit file to change mqtt address
sudo vim /etc/systemd/hallonlarm.service# Reload systemd
sudo systemctl daemon-reload# Copy and edit the sample configuration
sudo cp example.conf /etc/hallonlarm.conf
sudo vim /etc/hallonlarm.conf# Start the service
sudo systemctl start hallonlarm.service# Enable at boot
sudo systemctl enable hallonlarm.service
```## Configuration
The default configuration path is `/etc/hallonlarm.conf`.
This can be changed by adding the argument `-hl.config path/to/hallonlarm.conf` to the start commandA minimal configuration looks like this (the configuration language is [HCL](https://github.com/hashicorp/hcl):
```HCL
device "sensor/contact/bedroom_window" {
name = "Bedroom Window"
type = "contactSensor"
feature "contactSensorState" {
gpioIn = {
pin = 24
}
}
}
```For a complete example with more options, see [example.conf](example.conf)