Skip to content

dsetareh/NanoKVMScripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NanoKVM Pro (Desk) Custom Scripts

Very much vibecoded - take that as you will.

HomeAssistant/hass.py

Displays real-time Home Assistant sensor data on the NanoKVM Pro's (Desk Variant) RGB565 display with power monitoring graphs and temperature readings.

Features

  • Power Monitoring: Cycles through multiple power sensors with live graphing
  • Temperature Display: Shows temperature with color-coded indicators (blue→red gradient)
  • Auto-Cycling: Rotates between configured sensors at set intervals
  • Color Gradients: Visual indicators for power usage (grey→green→yellow→red)

Requirements

pip install -r requirements.txt

Dependencies: numpy, Pillow, requests, PyYAML

Setup

  1. Copy config.example.yaml to config.yaml

  2. Edit config.yaml with your Home Assistant details:

    • ha_url: Your Home Assistant URL
    • ha_token: Long-lived access token
    • font_path: Path to TTF font file
    • power_sensor_ids: List of power sensor entity IDs
    • temp_sensor_id: Temperature sensor entity ID
  3. Configure thresholds and intervals as needed

Configuration Options

Option Description Default
power_update_interval Power refresh rate (seconds) 10
temp_update_interval Temperature refresh rate (seconds) 60
sensor_switch_interval Time between sensor rotation (seconds) 30
power_graph_min/max Graph Y-axis range 0/1000
power_green/red_threshold Color gradient thresholds 100/500
temp_cold/hot_threshold Temperature color thresholds 60/80

Usage

python3 hass/hass.py

Run as a service for continuous display.

Display Layout

  • Top Right: Temperature with color gradient
  • Left Side: Power history graph (6 data points)
  • Bottom Right: Current time (12-hour format)
  • Graph Labels: Sensor name, min/max values, current readings

Troubleshooting

  • "Error: config.yaml not found": Copy and configure config.example.yaml
  • Connection errors: Verify Home Assistant URL and token
  • Font errors: Check font_path or script uses fallback fonts
  • Display issues: Ensure /dev/fb0 access permissions

Home Assistant Token

Generate a long-lived access token:

  1. Go to Home Assistant → Profile
  2. Scroll to "Long-Lived Access Tokens"
  3. Click "Create Token"
  4. Copy token to config.yaml

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages