KiboOst / php-simpleNetatmoAPI

Need a simple way to get your Netatmo Presence datas with a few lines of php? Here you are!
MIT License
35 stars 9 forks source link

Camera Presence / Sirene impossible #19

Open loicdeschamps opened 1 month ago

loicdeschamps commented 1 month ago

Hi

How to run the sirene ? i use this code

<?php
$Netatmo_app_id = 'xxxxx';
$Netatmo_app_secret= 'xxxx';

require($_SERVER['DOCUMENT_ROOT']."/netatmo/splNetatmoAPI.php");
$_splNetatmo = new splNetatmoAPI($Netatmo_app_id, $Netatmo_app_secret);
if (isset($_splNetatmo->error)) die($_splNetatmo->error);

$Cam=$_GET['Cam'];
if (!$Cam) $Cam="Welcome";
$Arg=$_GET['Arg'];
$Arg2=$_GET['Arg2'];
echo $Cam."<br>".$Arg."<br>".$Arg2."<hr>";
switch($Arg)

{
    // ++++++++++++++++++++++++++ PRESENCE +++++++++++++++++++++++++++++

        // Sirene Presence
    case 'setSirene':
        $sirene = $_splNetatmo->setSirenStatus($Cam, $Arg2);
        //You can always echo answer to check result ok, or error:
        echo "<pre>sirene:<br>".json_encode($sirene, JSON_PRETTY_PRINT)."</pre><br>";
    break;

`


I use

http://192.168.xx.xx/camera-netatmo.php?Cam=Garage&Arg=setSirene&Arg2=1

Result

Garage setSirene 1 sirene: null

loicdeschamps commented 2 weeks ago

Nobody help me ?

KiboOst commented 2 weeks ago

Sorry, I don't have siren anymore. Anyway I'm not sure echoing the $sirene status wwould be updated, but I guess you don't hear it ringing...

loicdeschamps commented 2 weeks ago

Bonjour

oui elle ne sonne pas, dommage je pensais pouvoir utiliser cette action pour l'activer a la demande

Loïc

Le mer. 9 oct. 2024 à 10:35, KiboOst @.***> a écrit :

Sorry, I don't have siren anymore. Anyway I'm not sure echoing the $sirene status wwould be updated, but I guess you don't hear it ringing...

— Reply to this email directly, view it on GitHub https://github.com/KiboOst/php-simpleNetatmoAPI/issues/19#issuecomment-2401693208, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3B66KA64PHKFSHL54QVPVDZ2TTF5AVCNFSM6AAAAABNKQ5UNOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBRGY4TGMRQHA . You are receiving this because you authored the thread.Message ID: @.***>

-- https://www.linkedin.com/in/loic-deschamps/ http://www.francerussie.com/

KiboOst commented 2 weeks ago

j'avais une presence avec sirene (qui a lachée) quand j'ai fais cette fonction et elle marchait très bien.