thejuice79/govee-smart-plug-controller

By thejuice79

Updated about 1 year ago

Auto-controls Govee smart plugs using weather data. Great for pool heaters and outdoor gear.

Image
Networking
Integration & delivery
Internet of things
1

999

thejuice79/govee-smart-plug-controller repository overview

Govee Smart Plug Controller

Automate your Govee smart plug based on real-time weather conditions. Ideal for pool heaters, fans, or other devices that depend on temperature and sunlight.


✅ Features

  • Fetches weather from Open-Meteo API
  • Automatically turns plug ON/OFF using temperature and cloud thresholds
  • Avoids redundant API calls by caching plug state
  • Time-based control window (START_TIME to END_TIME)
  • Fully configurable with environment variables
  • Lightweight Docker image
  • Graceful shutdown handling and retry logic

📦 Docker Usage

Run from GitHub Container Registry
docker run --env-file .env --restart unless-stopped --name govee-controller \
  ghcr.io/thejuice79/govee-smart-plug-controller:latest
Run from Docker Hub
docker run --env-file .env --restart unless-stopped --name govee-controller \
  thejuice79/govee-smart-plug-controller:latest
Build Locally
docker build -t govee-controller .
docker run --env-file .env --restart unless-stopped govee-controller

🧱 Docker Compose

version: '3.8'
services:
  govee-controller:
    container_name: govee-controller
    image: thejuice79/govee-smart-plug-controller:latest
    environment:
      - GOVEE_API_KEY=your_govee_api_key
      - DEVICE_MAC=your_device_mac
      - DEVICE_MODEL=your_device_model
      - LAT=39.8333
      - LON=-98.5855
      - START_TIME=09:00
      - END_TIME=18:00
      - TEMP_UNIT=fahrenheit
      - TEMP_THRESHOLD=75
      - CLOUD_THRESHOLD=50
      - CHECK_INTERVAL=15
      - TZ=America/Chicago
    restart: unless-stopped

⚙️ Supported Environment Variables

You'll need to provide:

  • GOVEE_API_KEY (string): Your Govee developer API key
  • DEVICE_MAC (string): MAC address of your Govee plug
  • DEVICE_MODEL (string): Model ID (e.g. H5083)
  • LAT & LON (float): Location for weather lookup

Optional configuration:

  • TEMP_UNIT (fahrenheit or celsius, default: fahrenheit)
  • TEMP_THRESHOLD (float, default: 75)
  • CLOUD_THRESHOLD (float, default: 50)
  • START_TIME, END_TIME (HH:MM, defaults 00:0023:59)
  • CHECK_INTERVAL (minutes, default: 15)

📋 Version

Latest release: v1.5.2

Added:

  • force parameter to plug control methods, enabling forced state resets before sending ON/OFF commands.
  • Improved weather API fallback logic: if WeatherAPI fails, the system gracefully falls back to Open-Meteo for reliable data.

See the changelog for details on each version.


📝 Author & License

Developed by TheJuice79
Licensed under Apache 2.0

Tag summary

Content type

Image

Digest

sha256:ab36a216f

Size

50.8 MB

Last updated

about 1 year ago

docker pull thejuice79/govee-smart-plug-controller