VPN/Proxy erkannt
Es scheint, dass Sie einen VPN- oder Proxy-Dienst verwenden. Bitte beachten Sie, dass die Nutzung eines solchen Dienstes die Funktionalität dieser Webseite einschränken kann.
-
Hi Realpapla
Thanks your script. I tried your nice program and it works.
My first attempt it was this
<?php
$tmp = $_GET["tmp"];
$hum = $_GET["hum"];
$Log= date("Y-m-d H:i:s")
. " - temp: " . $tmp
. " hum: " . $hum
. "\n";
echo $Log;
$fLog = fopen('log.txt', 'a') or die('Unable to open file!');
fwrite($fLog, $Log);
fclose($fLog);
// url web: http://mysite.com/action.php?tmp=tmp.value&hum=hum.value&id=shellyht-xxxxxx
?>
Alles anzeigen
but it isn't work. Can you explain me please why?
2021-08-16 23:12:02 - temp: tmp.value hum: 55
2021-08-16 23:12:07 - temp: tmp.value hum: 55
My second attempt and it's working, I question directly the shelly's cloud, so:
$url='https://xxxx.shelly.cloud/device/status?id=xxxxxx&auth_key=xxxx';
$request = file_get_contents($url);
$json_status = json_decode($request, true);
$tmp = $json_status['data']['device_status']['tmp']['value'];
$hum = $json_status['data']['device_status']['hum']['value'];
etc...
-
Hi and welcome to the forum. 
Maybe, my coupling to Homematic is an inspiration for you!? 
The code is at the end of the thread. Perhaps you need a translater. The thread is written in German.
Hi 66er
Thanks your solution but I think the Homematic is too complex idea.
Shelly has to work with its API
-
Hi Realpapla
wonderfull, can you post here your file action.php?
I don't undestand why my string it isn't good: http://myserver.com/action.php?tmp=tmp.value&hum=hum.value
I don't send id=xxxx
I actually got both temperature andhumudity in the GET message to the server so then I also removed the bat query
http://myserver.com/action.php?tmp=tmp.value&hum=hum.value
The response looks like this
/action.php?tmp=tmp.value&hum=hum.value&hum=52&temp=25.38&id=shellyht-AC6147
Now I'm testing other solution.
This evening I'm writing the way by https://xxxx.shelly.cloud/device/xxxx
-
Hi guy,
I would like to create a datalogger for record the temperature and humidity data in file log or in a database mysql.
I had thought about using Shelly HT and the Report URL feature in I / O URL Actions
I wrote a script in php
/* Example Report URL */
http://mysite.com/action.php?tmp=tmp.value&hum=hum.value&bat=bat.value
Unfortunately,
the log output recovers only the humidity data, while temperature and battery the variable via GET is not valued (tmp.value and bat.value)
/* Example Output log*/
2021-08-15 20:41:58 - temp: tmp.value | hum: 59 | bat: bat.value
Can anyone help me please and explain me how to write URLs in actions,
or if there is already a script to read the data stored in the cloud?
Thanks Nic 