Skip to content

mitchfen/nanoleaf-controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nanoleaf Controller

A Blazor Server dashboard for controlling Nanoleaf panels from a browser on your local network.

Nanoleaf Controller UI

What It Does

  • Turns panels on and off
  • Adjusts brightness with a debounced slider
  • Selects scenes/effects from the device effect list
  • Sets a solid color via hue/saturation
  • Shows a live SVG panel layout preview based on the Nanoleaf panel map
  • Polls the controller every 5 seconds to keep UI state in sync

Tech Stack

  • .NET Blazor Server
  • Nanoleaf OpenAPI over local HTTP
  • Container image published to GitHub Container Registry

Configuration

The app reads these settings from configuration (appsettings or environment variables):

  • Nanoleaf:IpAddress
  • Nanoleaf:AuthToken

Environment variable equivalents:

  • Nanoleaf__IpAddress
  • Nanoleaf__AuthToken

Example appsettings.json section:

"Nanoleaf": {
	"IpAddress": "192.168.1.100",
	"AuthToken": "your-token"
}

Run Locally

Prerequisites:

  • .NET 10 SDK
  • Network access to your Nanoleaf controller

From src/:

dotnet run

By default (launch profile http) the app runs on:

  • http://0.0.0.0:5009

Run with Docker

Use the published image:

docker run --rm -it \
	-p 8080:8080 \
	-e Nanoleaf__IpAddress="YOUR_IP" \
	-e Nanoleaf__AuthToken="YOUR_TOKEN" \
	ghcr.io/mitchfen/nanoleaf-controller:latest

Then open http://localhost:8080.

Build Container Image Locally

From src/:

dotnet workload restore
dotnet publish nanoleaf-controller.csproj -c Release -o ./app
docker build -t ghcr.io/mitchfen/nanoleaf-controller:latest .

Deploy to Kubernetes

  1. Base64-encode your Nanoleaf values and update kubernetes/secrets.yaml.
  2. Create namespace:
kubectl create namespace nanoleaf-controller
  1. Apply secret:
kubectl apply -f kubernetes/secrets.yaml -n nanoleaf-controller
  1. Apply deployment/service/ingress:
kubectl apply -f kubernetes/manifest.yaml -n nanoleaf-controller

The provided ingress host is nanoleaf-controller.home and is configured for Traefik TLS entrypoint websecure.

Notes

  • This app is intended for trusted local network use.
  • The Nanoleaf API calls are made over HTTP to port 16021 on the controller.

About

IoT controller which replaces the proprietary app for the Nanoleaf smart lights on my home network.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors