Falls jemand ein "Proxy Script" braucht um einen Alarm zu aktivieren / deaktivieren per URL:
PHP
<?php
$id = $_REQUEST[ 'id' ];
$enabled = $_REQUEST[ 'enabled' ];
if( empty( $id ) || empty( $enabled ) ) {
http_response_code( 400 );
exit;
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://shelly-XX-eu.shelly.cloud/scene/enable?auth_key=YOUR_AUTH_KEY');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "enabled=" . $enabled . "&id=" . $id);
$headers = array();
$headers[] = 'Content-Type: application/x-www-form-urlencoded';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
http_response_code( 400 );
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
Alles anzeigen