Skip to content

Instantly share code, notes, and snippets.

View mikesmitty's full-sized avatar

Michael Smith mikesmitty

View GitHub Profile
@mikesmitty
mikesmitty / automation|climate|bathroom.yaml
Last active April 25, 2023 23:55
Home Assistant Basic Layout
---
- alias: Climate - Bathroom - House Mode/Presence
description: ''
trigger:
- entity_id:
- input_select.house_mode
- input_select.presence
platform: state
action:
- choose:
@mikesmitty
mikesmitty / ld2410-d1-mini.txt
Last active April 1, 2023 17:09
Hydrated ESPHome example configs for LD2410 mmWave presence sensors
substitutions:
friendly_name: Basement Presence
name: pres01
esphome:
friendly_name: ${friendly_name}
name: ${name}
esp8266:
board: d1_mini
@mikesmitty
mikesmitty / main.tf
Last active February 16, 2022 19:57
workload identity
locals {
members = tolist([
for i, v in setproduct(var.wli_namespaces, var.wli_services) :
"serviceAccount:your-project-id.svc.id.goog[${v[0]}/${v[1]}]"
])
}
@mikesmitty
mikesmitty / esphome-temp-sensors.txt
Created January 26, 2022 17:27
No-solder Home Assistant/ESPHome temperature/humidity sensors
Components
============================================
~$4 NodeMCUv2 ESP8266 (fairly generic, get wherever's convenient)
~$6 Adafruit SHT40: https://www.adafruit.com/product/4885
~$1 Adafruit StemmaQT to female Dupont cable: https://www.adafruit.com/product/4397
USB wall wart (Optional, however you power the ESP8266 is fine)
USB A to micro B (Optional, however you power the ESP8266 is fine)
Assembly
============================================
func CreateCertificate(rand io.Reader, template, parent *Certificate, pub, priv interface{}) (cert []byte, err error) {
<...>
publicKeyBytes, publicKeyAlgorithm, err := marshalPublicKey(pub)
if err != nil {
return nil, err
}
privKeyBytes, _, err := marshalPublicKey(&priv.PublicKey)