Skip to content

Instantly share code, notes, and snippets.

@Mr-Groch
Mr-Groch / offline-notification-for-sensors-with-last_seen.yaml
Last active February 25, 2024 23:14
Home Assistant Blueprint: Offline detection for Z2M devices with last_seen
blueprint:
name: Offline detection for Z2M devices with last_seen
description: Regularly test all sensors with 'last_seen' in name and 'timestamp' device_class
('last seen' Z2M sensors) to detect offline and if so execute an action.
domain: automation
input:
hours:
name: Hours not seen
description: Sensors not seen this amount of time are assumed to be offline.
default: 24
@Mr-Groch
Mr-Groch / flussonic-api-catchup-source-add.php
Last active August 20, 2020 19:14
PHP online converters for adding catchup-source tag for PVR IPTV Archive Client on the fly (requires https://github.com/ttodua/useful-php-scripts/blob/master/get-remote-url-content-data.php)
<?php
function get_flussonic_catchup_days($api_result)
{
if (empty($api_result)) {
return -1;
}
else {
$result = json_decode($api_result, true);
if (json_last_error() === 0) {
@Mr-Groch
Mr-Groch / xc-api-catchup-source-add.php
Last active March 4, 2020 17:52
PHP online converters for adding catchup-source tag for PVR IPTV Archive Client on the fly (requires https://github.com/ttodua/useful-php-scripts/blob/master/get-remote-url-content-data.php)
<?php
$catchup_channels = array();
function init_xc_catchup_channels($api_result)
{
global $catchup_channels;
if (empty($api_result)) {
return;
@Mr-Groch
Mr-Groch / 32 bit version of niahash.c
Last active November 13, 2016 14:45 — forked from Noctem/niahash.c
niahash c
#include <stdint.h>
#include <string.h>
#define HI(n) ((uint64_t)(n)>>32)
#define LO(n) ((uint64_t)(n)&0xffffffff)
#define U128(hi,lo) ((my_uint128_t){ .high = hi, .low = lo})
typedef struct {
uint64_t high;
uint64_t low;