Skip to content

Instantly share code, notes, and snippets.

@schlan
schlan / esb_smart_meter_stats.py
Last active July 19, 2024 21:56
Download Smart Meter stats from https://myaccount.esbnetworks.ie
#!/usr/bin/env python3
import requests
from bs4 import BeautifulSoup
import re
import json
from datetime import datetime, timedelta, timezone
def load_esb_data(user, password, mpnr, start_date):
s = requests.Session()
@markgdev
markgdev / solis_5g_modbus.py
Last active October 29, 2023 19:30
Query a Solis Hybrid 5G inverter and push to MQTT
import minimalmodbus
import time
import paho.mqtt.publish as publish
instrument = minimalmodbus.Instrument('/dev/ttyUSB0', 1, debug = False)
instrument.serial.baudrate = 9600
# This probably doesn't need setting but I was getting timeout failures
# rather than wrong data address when I had the registers wrong
instrument.serial.timeout = 2
# An example read for long
@dlashua
dlashua / README.md
Created October 13, 2020 12:26
PyScript Candle Light Simulator

Use this in a Home Assistant Automation or Script to start a candle light effect on a bulb.

action:
  - service: pyscript.candle_light
    data:
      entity_id: light.living_overhead
      state: 'on' #use 'off' to stop the effect
      brightness: 12 #optional
 color_temp: 450 #optional
@shenghaoyang
shenghaoyang / blueEnable_ALARM_non_mainline.md
Last active February 19, 2024 00:14
Bluetooth support on Raspberry Pis running Arch Linux ARM with non-mainline kernel.

#1 Update: Recent Rapsberry Pi (downstream) kernel dt-overlays now exposes a config option "krnbt" that negates the need for all this.

Relevant PRs: raspberrypi/linux#3682

Enabling bluetooth

[Pi 3B (Non-Plus) / Pi Zero W ONLY]

As of kernel package, linux-raspberrypi-4.14.59-1, support for notifying the kernel of the

@grindars
grindars / steam_bootstrap.sh
Created December 7, 2012 07:53
Steam installer for Debian
#!/bin/bash
#
# Steam installer for Debian wheezy (32- and 64-bit)
#
# Place into empty directory and run.
#
download() {
local url="$1"
local filename="$(basename "$url")"
@endolith
endolith / Readme.txt
Last active September 23, 2023 11:04
Gnome to Wine color scraper
This is a Python script to extract GNOME/GTK's color scheme and apply it to Wine, so that the themes (approximately) match.
Instructions:
1. Set your Gnome theme as you would like it
2. Run with a command like "python wine_colors_from_gtk.py"
3. Restart any apps running in Wine. They should match the Gnome theme colors now.
Better description with screenshots here: http://www.endolith.com/wordpress/2008/08/03/wine-colors/
This is also stored on https://code.launchpad.net/~endolith/+junk/wine-color-scraper