Beiträge von nicbed

    Hi Realpapla

    Thanks your script. I tried your nice program and it works.


    My first attempt it was this

    but it isn't work. Can you explain me please why?

    Code
    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:

    Code
    $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 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

    Code
    /* 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)

    Code
    /* 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 :thumbup: