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 'lqi' unit of measurement (linkquality 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 | |
| $files = array_slice($argv, 1); | |
| foreach ($files as $file) { | |
| $picture = file_get_contents($file); | |
| $size = getimagesize($file); | |
| // base64 encode the binary data, then break it into chunks according to RFC 2045 semantics | |
| $base64 = chunk_split(base64_encode($picture)); |