Skip to content

Instantly share code, notes, and snippets.

@TheGroundZero
TheGroundZero / ga_textstyle.gs
Created June 21, 2024 00:25
Google Apps Script to extract TextStyle information from a slide
/**
* Extract TextStyle info for the text inside slide element based on Body placeholder
* @param {Number} slidenumber Number of the slide to analyze (starting from 1)
*/
function analyseBodyStyles(slidenumber) {
const presentation = SlidesApp.getActivePresentation();
const slide = presentation.getSlides()[slidenumber-1];
const body = slide.getPlaceholders().find(ph => ph.asShape().getPlaceholderType() === SlidesApp.PlaceholderType.BODY);
const textRange = body.asShape().getText();
const textRuns = textRange.getRuns();
@TheGroundZero
TheGroundZero / ha_darebee_daily.yaml
Last active July 18, 2023 15:23
Display DAREBEE daily challenge on Home Assistant dashboard
---
# Create an image entity showing the DAREBEE daily challenge
#
# https://www.home-assistant.io/integrations/image/
# https://darebee.com/daily
# https://sequr.be/blog/2023/07/darebee-daily-challenge-on-home-assistant-dashboard/
#
scrape:
- resource: https://darebee.com/
scan_interval: 3600 # Every hour
@TheGroundZero
TheGroundZero / ha_awtrix_yearprogress.yaml
Last active January 26, 2024 10:53
AWTRIX Year Progress Flow using Home Assistant Automation
---
# https://flows.blueforcer.de/flow/jyNg0oGXOX6D
#
# Update the MQTT topic at the bottom of this automation.
# Don't forget to upload year.jpg to your AWTRIX clock in the ICONS folder
#
automation:
- id: awtrix_year_progress
alias: Year Progress
description: Publishes the current year progress in % to the Awtrix clock
@TheGroundZero
TheGroundZero / solis_meter.py
Created February 16, 2022 12:27
Read modbus data from Ginlong Solis inverter and send over MQTT. For more info, see blog post.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Read modbus data from Ginlong Solis inverter
# and send over MQTT
#
# Based on https://github.com/rogersia/Solis-4G
# Includes fixes, small modifcations and refactoring. Migrated to Python3.
# See https://sequr.be/blog/2021/08/reading-ginlong-solis-inverter-over-serial-and-importing-in-home-assistant-over-mqtt/
#
@TheGroundZero
TheGroundZero / hyperion_fix_mmap.sh
Last active August 30, 2021 09:32
Fix Hyperion mmap() issue with WS281x LEDs
# ssh pi@<ip.of.raspberry.pi> # password: raspberry
# Run Hyperion service as root
sudo systemctl disable --now [email protected]
sudo systemctl enable --now [email protected]
# Created symlink /etc/systemd/system/multi-user.target.wants/[email protected] → /etc/systemd/system/[email protected].
# Update Message of the Day to check correct service
sudo sed -i 's/pi.service/root.service/' /etc/update-motd.d/10-hyperbian
@TheGroundZero
TheGroundZero / ha_afvalbeheer.yaml
Created August 20, 2021 06:51
Custom sensor based of Pippyn's Afvalbeheer integration
---
# Waste collection integration
#
# Home Assisant sensor component for Afvalbeheer
# https://github.com/pippyn/Home-Assistant-Sensor-Afvalbeheer
#
# sensor:
- platform: afvalbeheer
wastecollector: RecycleApp # Change this to match your waste collector
resources:
@TheGroundZero
TheGroundZero / ha_webradio.yaml
Last active August 13, 2021 15:14
Webradio player for Home Assistant, with dropdown list and input field
# Requirements
# - Media extractor integration - https://www.home-assistant.io/integrations/media_extractor/
# - Mini media player (HACS) - https://github.com/kalkih/mini-media-player
# - A smart speaker, e.g. Xiaomi Mi Smart Speaker - https://s.click.aliexpress.com/e/_A0zLJq
# - Some URLs for web radio stations
# - (optional) Images/logos of the radio stations
# configuration.yaml
# ------------------
@TheGroundZero
TheGroundZero / esp32_tcam.yaml
Created July 16, 2021 20:08
ESPHome config for LILYGO® TTGO T-Camera ESP32
# https://s.click.aliexpress.com/e/_9y4QA5
# Based on https://gist.github.com/Snipercaine/d8345571563536e9661422c3509d1119
# And https://community.home-assistant.io/t/working-esphome-config-for-ttgo-esp32-camera-board-with-microphone/126231
# Note: pins are not the same as in the docs above and even the picture on AE differs from the picture in the box
#
# Folder structure based on Frenck's config
# https://github.com/frenck/home-assistant-config/tree/master/config/esphome
substitutions:
slug: esp32_tcam
@TheGroundZero
TheGroundZero / esphome_ir_lg.md
Last active November 13, 2024 13:31
LG infrared codes captured using ESPHome Remote Receiver
@TheGroundZero
TheGroundZero / esp32_ttgo_t5_213.yaml
Created May 8, 2021 23:05
TTGO T5 v2.3.1 2.13" display in ESPHome
# Board
# https://s.click.aliexpress.com/e/_9IDl91
# ESPHome docs:
# - https://esphome.io/components/display/waveshare_epaper.html
# - https://esphome.io/components/spi.html#spi
# - https://esphome.io/components/display/index.html#formatted-text
substitutions:
esphome_name: esp32_ttgo_t5