Categorygithub.com/benleb/automoli-go
modulepackage
0.3.3
Repository: https://github.com/benleb/automoli-go.git
Documentation: pkg.go.dev

# README

automoli

Go Report Card Go Reference GitHub Workflow Status No Maintenance Intended

Fully automatic light management based on motion, daytime, brightness and even humidity šŸ’¦ 🚿

šŸ•“ multiple daytimes to define different scenes for morning, noon, ...
šŸ’” supports Hue (for Hue Rooms/Groups) & Home Assistant scenes
šŸ”Œ switches lights and plugs (with lights)
ā˜€ļø supports illumination sensors to switch the light just if needed
šŸ’¦ supports humidity sensors as blocker (the "shower case")
šŸ”’ locks the light if the light was manually turned on

- successor of the famous original ad-AutoMoLi (written in Python as AppDaemon plugin/app) -

install

via go install

go install github.com/benleb/automoli-go@latest

run

see the example config for a multi-room configuration with different daytimes and sensors and settings.

# run
automoli-go run --config ~/automoli.yaml

# more options
automoli-go --help

systemd service example

this is an example how the systemd service file can be used for running AutoMoLi as a service. uuser, group and repo/config directory may need to be adjusted.

# clone repo
git clone https://github.com/benleb/automoli-go ~/automoli

# create a new user and group for automoli
useradd --system --home-dir /etc/automoli --user-group automoli

# create config directory and set permissions
mkdir /etc/automoli && chown automoli:automoli /etc/automoli

# link or copy the systemd service file
ln -s ~/automoli/automoli.service /etc/systemd/system/automoli.service

build

single target

# build for current platform
goreleaser build --clean --snapshot --single-target

# build for specific platform
GOOS="linux" GOARCH="amd64" GOAMD64="v3" goreleaser build --clean --snapshot --single-target

docker image

with ko

# build image and push to registry
KO_DOCKER_REPO=your.registry.io:5000 ko build --verbose --base-import-paths --tags dev

development

lint

with golangci-lint

# run all linters
golangci-lint run --verbose --enable-all --fix --max-issues-per-linter 0 --max-same-issues 0

tests

# run tests with coverage
go test -cover ./...

release/tag

vith goreleaser triggered by a git tag

# create a new annotated tag
git tag -a "vX.Y.Z" -m "short release description vX.Y.Z"
# push tag to trigger the release workflow
git push --follow-tags

# Packages

No description provided by the author