Skip to content

Instantly share code, notes, and snippets.

View golles's full-sized avatar

Sander golles

View GitHub Profile
@golles
golles / directadmin.sh
Created April 24, 2024 17:08
DirectAdmin DDNS bash script
#!/usr/bin/env bash
# Info about username password:
# You should use your own username
# For the password I strongly advise to create a 'Login Key' that has alowance for CMD_API_DNS_CONTROL.
if [[ "$#" -ne 6 ]]; then
echo "Usage: $0 username password direct_admin_server domain subdomain ip"
exit 1
fi
@golles
golles / kamers.yaml
Created July 30, 2022 18:28
New room cards, Mushroom <3 vertical-stack-in-card
type: vertical-stack
cards:
- type: custom:vertical-stack-in-card
styles:
"--chip-box-shadow": none
"--chip-background": none
"--chip-spacing": 0
cards:
- type: horizontal-stack
cards:
@golles
golles / card template
Created June 19, 2021 10:23
HA room info card
kamer_info:
aspect_ratio: 1/1
show_state: false
triggers_update: all
variables:
climate_entity:
light_entity:
temperature_entity:
humidity_entity:
view:
@golles
golles / 1. Mechanische ventilatie in Home Assistant.md
Last active April 14, 2023 07:47
Mechanische ventilatie in Home Assistant

Allereerst bedankt @eelcohn voor je prachtige project --> https://github.com/eelcohn/nRF905-API

Als je packages gebruikt, zou het makkelijk zijn om dit te kopieren naar jouw HA. Anders zou je de elementen in zehnder.yaml handmatig moeten kopieren naar je configuration.yaml.

Hoe werkt het?

Een rest sensor (sensor.mechanische_ventilatie_status) haalt de data van de api en een fan template maakt er vervolgens een fan entity van (fan.mechanische_ventilatie). Op deze manier krijg je out of the box een speed list in lovelace en bijbehorende services.

De individuele rest commands worden gewrapt door scripts, dit zodat de host uit secrets kan komen, helaas is er geen manier om een secret in een template toe te passen. Fan templates moeten verplicht een turn_on en turn_off hebben, dit heeft de mechanische ventilatie niet, nu roepen deze acties een dummy script ventilation_turn_on_off_dummy aan die niks doet (als ieman

@golles
golles / Turnip.exchange sort bookmarklet
Last active May 28, 2020 16:00
This bookmarklet orders turnip prices descending on turnip.exchange
javascript:void((function(doc) { if(typeof jQuery == "undefined") { var script_jQuery = document.createElement("script"); script_jQuery.setAttribute("src", "//code.jquery.com/jquery-latest.min.js"); document.body.appendChild(script_jQuery); } setTimeout(function() { var allNodes = jQuery("div.note"); var parent = allNodes.first().parent(); parent.empty(); var orderedNodes = allNodes.sort(function (a, b) { return $(b).find("p.ml-2").text().split(" ")[0] - $(a).find("p.ml-2").text().split(" ")[0]; }); parent.html(orderedNodes); }, 1000); })(document));