Skip to content

Instantly share code, notes, and snippets.

@koleson
koleson / pvs_vars_check.sh
Last active November 6, 2025 05:27
PVS System Information Checker - Retrieves system info from SunPower PVS devices via API
#!/bin/bash
#############################################################################
# pvs_vars_check.sh
#
# Description: Retrieves and displays system information from SunPower PVS
# devices via their API, including serial number, model, hardware
# revision, firmware version, system type, and eMMC flashwear.
#
# Usage: ./pvs_vars_check.sh [OPTIONS] <PVS_IP>
@koleson
koleson / sunpower_ess_mode_set-sh-README.md
Last active November 4, 2025 22:18
Sunpower ESS Mode Set Shell Script README
@koleson
koleson / sunpower_ess_mode_set.sh
Last active July 5, 2025 18:23
Script to set SunPower SunVault ESS discharge mode via SunPower GraphQL API
#!/usr/bin/env zsh
# Created 5 April 2023 by Kiel Oleson - kiel@kmo.email - @kielo
# updated 6 July 2024
#
# example usage: ./sunpower_ess_mode_set.sh -m SELF_CONSUMPTION -r 0.04 -s A_123456 -u user@test.lol -p SuperSecret1!
#
# README/NOTES: https://gist.github.com/koleson/db9df38ef6051715d743e572acebdd4d
#
@koleson
koleson / Battery_CAN.md
Last active September 29, 2026 03:21
PVS6 Notes

Battery CAN

My first-gen SunVault uses two tall M0012 batteries. Later SunVaults use two or three M0020 batteries.

The CAN protocol seems similar to the Pylontech LV CAN protocol, but the message IDs don't line up, so it is not directly compatible.

Note that some of this information is also exposed over Modbus/TCP via the Conext Gateway / InsightFacility. We focus only on CAN here.

Observed Message IDs

@koleson
koleson / gist:253c64a5bf0a6a9ea8d0558c0b01988f
Created August 5, 2017 20:22
SSL failure - istatd to iStat View
default 13:21:34.342074 -0700 iStat View Server 'orange pi' Connecting
default 13:21:34.343108 -0700 iStat View Server 'orange pi' Connecting to address: opp.local, port: 5109
default 13:21:34.343199 -0700 iStat View Stream client bypassing proxies on TCP Conn [21:0x61000019f6f0]
default 13:21:34.343215 -0700 iStat View TCP Conn 0x61000019f6f0 started
default 13:21:34.517381 -0700 iStat View TCP Conn 0x61000019f6f0 event 1. err: 0
default 13:21:34.517425 -0700 iStat View TCP Conn 0x61000019f6f0 complete. fd: 17, err: 0
default 13:21:34.517785 -0700 iStat View Server 'orange pi' Connected
default 13:21:34.517830 -0700 iStat View Server 'orange pi' starting tls
default 13:21:34.517966 -0700 iStat View TCP Conn 0x61000019f6f0 starting SSL negotiation
default 13:21:34.520422 -0700 iStat View CFNetwork SSLHandshake failed (-9847)
@koleson
koleson / keybase.md
Created April 13, 2016 23:13
My Keybase Proof

Keybase proof

I hereby claim:

  • I am koleson on github.
  • I am kiel (https://keybase.io/kiel) on keybase.
  • I have a public key ASDvdliPTK7Kb1TXDJn5qSEbwR_vpSy-38I7jSVmQlmwmAo

To claim this, I am signing this object:

@koleson
koleson / ExtensionOverrides.swift
Last active January 29, 2016 20:47
Confusion: Method overrides in extensions
// Playground - unexpected extension method selection
import Foundation
var str = "Hello, playground"
protocol MethodProtocol {
func aMethod() -> String
}
//
// CLLocationManager+AutomationMock.m
//
#import "CLLocationManager+AutomationMock.h"
@implementation CLLocationManager (AutomationMock)
+ (BOOL)authorizationStatus