Skip to content

Instantly share code, notes, and snippets.

View Argelbargel's full-sized avatar

Karsten Kraus Argelbargel

  • Baden-Baden, Germany
View GitHub Profile
@Argelbargel
Argelbargel / gist:ee2acc2039dd29c4d65d1d1b44ac9143
Created September 13, 2024 10:57
OpenHAB-Rule to update temperature offsets of AVM Fritz! DECT Radiator Thermostats (FritzOS >= 7.50)
// *************************************************************************************************************************************
// Groovy Script/Rule for OpenHAB to update the temperature offset of AVM Fritz! DECT 301/302 or COMET DECT Thermostats based on
// measurements of arbitrary external temperature-sensor connected as items/things in OpenHAB.
// This implementation is based on https://github.com/SeydX/homebridge-fritz-platform/issues/149#issuecomment-883098365 an uses the
// login-example code provided by AVM here: https://avm.de/fileadmin/user_upload/Global/Service/Schnittstellen/AVM_Technical_Note_-_Session_ID_english_2021-05-03.pdf
//
// Requirements:
// - Fritzbox with FritzOS-Version >= 7.50
// - install the XPATH-Transformation-Addon
// - download Google's GSON-Library (e.g. from https://mavenlibs.com/jar/file/com.google.code.gson/gson) and place it in OpenHABs
@Argelbargel
Argelbargel / update-fritz-thermostat-temperature-offset.groovy
Last active September 13, 2024 10:59
OpenHAB-Rule to update temperature offsets of AVM Fritz! DECT Radiator Thermostats (FritzOS < 7.50)
// *************************************************************************************************************************************
// Groovy Script/Rule for OpenHAB to update the temperature offset of AVM Fritz! DECT 301/302 or COMET DECT Thermostats based on
// measurements of arbitrary external temperature-sensor connected as items/things in OpenHAB.
// This implementation is based on https://github.com/SeydX/homebridge-fritz-platform/issues/149#issuecomment-883098365 an uses the
// login-example code provided by AVM here: https://avm.de/fileadmin/user_upload/Global/Service/Schnittstellen/AVM_Technical_Note_-_Session_ID_english_2021-05-03.pdf
//
// Requirements:
// - Fritzbox with FritzOS-Version < 7.50
// - install the XPATH-Transformation-Addon
// - download Google's GSON-Library (e.g. from https://mavenlibs.com/jar/file/com.google.code.gson/gson) and place it in OpenHABs
@Argelbargel
Argelbargel / apache2-proxy-for-rest-service-allowing-slashes.conf
Last active July 5, 2022 17:41
How to use Apache 2.4+ as proxy for Rest-Service which allows encoded slashes (%2F)
######################################################################################################################################
# When to use:
# You have a REST-Service which accepts requests like /endpoint/id%2Fwith%2Fslashes and you want to proxy it through Apache,
# either to load-balance multiple server or to add authentication to a service you can not modify for that.
#
# Resolves these problems:
# - Apache2 prevents requests to URIs containing encoded slashes by default and rejects them by returning 404 Not Found
# - Additionally mod_proxy canonicalizes URLs replacing %2F with %252F before passing the request to the backend
# - while Apache 2.4 added the special keyword "nocanon" to the ProxyPass directive there is a security feature built-in that
# enforces canoncialisation when the incoming request URL matching the given prefix (e.g. "/") contains an unescaped path