This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$catchup_channels = array(); | |
function init_xc_catchup_channels($api_result) | |
{ | |
global $catchup_channels; | |
if (empty($api_result)) { | |
return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |