Skip to content

Instantly share code, notes, and snippets.

View tubalainen's full-sized avatar

tubalainen

View GitHub Profile
@tubalainen
tubalainen / gist:14d9e1811d851277b4ca699124f0a0a5
Created February 5, 2020 10:26
Camera Loop (camloop.yaml) package file
### packages/camloop.yaml ###
input_boolean:
loop_the_cameras:
name: Loop The Cameras
initial: off
icon: mdi:camera-burst
# The automation that starts the loop
automation:
@tubalainen
tubalainen / gist:413befca05c7935b8686015216980996
Last active April 6, 2020 07:05
Svenskt "package" för Home Assistant för covid19 viruset - datakälla SVT <UPDATED>
# **** OBS OBS OBS OBS ****
# -- För der som kör MariaDB eller möjligen också mysql så columnen för state och event för liten i databasen, den är "TEXT" och den behöver vara minst "MEDIUMTEXT" för att kunna mellanlagra json informationen i sensorn
######
##
## Detta är en "package" fil som visar antal smittade i Sverige per län/region
## Datat kommer via SVTs api
## Automationen är ett exempel för att pusha ut en talad röst till en Google Home-enhet med antalet smittade i Sverige och i Värmland
##
## Installation
@tubalainen
tubalainen / gist:e36a5f6ca44593f2ca306a33e90d7398
Last active June 2, 2023 22:23
FTX temperature sensor and relay control
At home I have a dumb Östberg Heru 75 with no smartness what so ever, it is also a bit unclear how efficient the system really is. How much heat that can be recycled.
The components (other than the tools, 3D printed box for the electronics etc)
1x NodeMCU (I use a LUA board), can be found on all tinker shops and all big online retail stores such as ali, banggood, amazon and ebay as well as locally sourced supplers (prefered!)
4x Dallas temperature sensors DS18B20 "waterproofed with metal sleeve". Souced from same as the NodeMCU
1x relay board, souced from the same as the NodeMCU
Some cables
For the project installation of the software
- Install esphome (addon store in Home Assistant)
@tubalainen
tubalainen / gist:0d415941ad9a1f658ebac2fac20f007a
Last active September 1, 2020 17:48
Directional lightning sensor based on azimuth
sensor:
- platform: template
sensors:
lightning_direction:
friendly_name: 'Blitzortung Lightning Direction'
value_template: >-
{%if states.sensor.blitzortung_lightning_azimuth.state | float<=11 %}Nord
{% elif states.sensor.blitzortung_lightning_azimuth.state | float>348 %}Nord
{% elif states.sensor.blitzortung_lightning_azimuth.state | float<=34 | float>11 %}Nord Nord Öst
{% elif states.sensor.blitzortung_lightning_azimuth.state | float<=56 | float>34 %}Nord Öst
### ESPHome koden för mina fyra reläer. Baserat på en Wimos D1 Mini (ESP8266)
esphome:
name: bevattningskontroller_01
platform: ESP8266
board: d1_mini
wifi:
ssid: 'ssid'
password: 'hemligt'
ap:
@tubalainen
tubalainen / package_blue_iris.yaml
Last active June 11, 2021 05:53
Instructions/readme.MD
**Frigate - Home Assistant - Blue Iris NVR automation example**
The basics:
Blue Iris is a normal "dumb" NVR software that records several camera RTSP streams and present it to an API and a number of user interfaces. There isnt any great local AI features built in, it normally triggers motion based on "motion detection" (that would be considered somewhat advanced). There´s a lot of false positives causing the NVR event recording to be somehwat useless. Yes, I know, there are several ways to tweak and fix this to lessen the false positives.
There are quite a community around the Blue Iris software and there are other stabs at making local AI such as the "aitool" with Deepstack.
I got inspired by the video from "The Hookup" on youtube explaining the setup with the "aitool" and Deepstack. I tried it and it works - ish.
Link to the hookups video with all Blue Iris configuration: https://www.youtube.com/watch?v=fwoonl5JKgo
@tubalainen
tubalainen / gist:7d66ba22e6e26fd8d7ba08df889cc897
Created April 24, 2021 11:55
TTGO - ESPHOME example code
esphome:
name: ttgotcam01
platform: ESP32
board: esp-wrover-kit
wifi:
manual_ip:
static_ip: 192.168.xx.xx
gateway: 192.168.xx.1
subnet: 255.255.255.0
@tubalainen
tubalainen / gist:117f5c528b6a46159a5491d39de75bbe
Created May 5, 2021 12:33
Google Home "Where is Helga" routine script/package
sensor:
- platform: template
sensors:
helga_laddar_last_changed:
friendly_name: 'Helga Laddar Last Changed'
value_template: >
{%- set time = (as_timestamp(now()) - as_timestamp(states.binary_sensor.helga_laddar.last_changed)) | int %}
{%- set minutes = ((time % 3600) // 60) %}
{%- set minutes = '{} minuter '.format(minutes) if minutes > 0 else '' %}
{%- set hours = ((time % 86400) // 3600) %}
@tubalainen
tubalainen / gist:f88e78d0e97aebe67c35fd63b9fc7f79
Last active April 26, 2024 12:32
ESP8266 GPS Tracker user Tasmota GPS and Home Assistant
# GPS tracker for Home Assistant using Tasmota
## The GPS module
Get your self an ESP8266 and a GPS module, for GPS module I do recommend the NEO-6M module: https://www.aliexpress.com/item/1005002579586721.html
## The Tasmota firmware
The Tasmota firmware is based on the "basic" setup with the enabled options '#define USE_GPS' and '#define USE_FLOG' set
It you want to download a pre-compiled version, it is available here: https://www.pucebaboon.com/TASMOTA/
Download and flash Tasmota-GPS.bin, configure the GPS RX/TX pins (I use D1 and D2), wifi, mqtt and device name
@tubalainen
tubalainen / gist:19103e725c1d7331bc16eae130a6757d
Created June 10, 2021 12:49
ESPHome - SSD1306 display example
esphome:
name: display_hall
platform: ESP8266
board: nodemcuv2
wifi:
manual_ip:
static_ip: 192.168.XX.XX
gateway: 192.168.XX.1
subnet: 255.255.255.0