Skip to content

Instantly share code, notes, and snippets.

@markfickett
markfickett / evse_surplus_solar.py
Created October 7, 2025 18:05
AppDaemon app to connect vuegraf and OpenEVSE via MQTT
"""Forwards Emporia Vue Watts value to OpenEVSE for the Solar Divert feature.
This connects an Emporia Vue's net usage reading to the OpenEVSE eco charging
mode.
The Vue needs vuegraf (https://github.com/jertel/vuegraf) to publish its data
to MQTT. (The Emporia API provides fresh values every 60s at most often.)
The OpenEVSE needs the "Solar Divert" service turned on and configured to read
from this plugin's "publish_net_watts_topic" MQTT topic. Then switch to
@markfickett
markfickett / gist:c37e085fed88d321b773387f09012c56
Created August 15, 2017 19:51
Comparison of looking up Python class in dict
from pyprofiling import Profiled
import logging
import random
import threading
A_HASH_INDEX = 1
class A(object):
@markfickett
markfickett / gist:e092164ae3d88fbfba7c6f93ab9a5710
Created August 15, 2017 14:03
Multi-threaded comparison of lookups in Python dict and ResizingList
from pyprofiling import Profiled
import logging
import random
import threading
class ResizingList(list):
"""A list of values that automatically grows when items are set, and returns None if an index
greater than the list length is provided."""
@markfickett
markfickett / fht_curses_graph
Last active June 20, 2017 16:43
ArduinoFHT Demo Graph (Python using curses)
"""Draw a live bar graph of frequency data (from Arduino FHT)."""
import collections
import curses
import math
import serial # http://pyserial.sourceforge.net/
import time
_SERIAL_DEVICE = '/dev/tty.usbmodemfa141'
_GRAPH_MAX_Y = 100