
Code: Select all
<?php
$data=json_decode(file_get_contents('http://ip:port/json.htm?type=devices&rid=10'),true);
$co2 = filter_var($data['result']['0']['Data'], FILTER_SANITIZE_NUMBER_INT);
echo $co2;

Moderator: leecollings
Code: Select all
<?php
$data=json_decode(file_get_contents('http://ip:port/json.htm?type=devices&rid=10'),true);
$co2 = filter_var($data['result']['0']['Data'], FILTER_SANITIZE_NUMBER_INT);
echo $co2;
Sorry to give you misleading advice, it would be helpful if you added a description of what you are running in your signature, then people wouldn't give you duff advice.Lisa wrote: Since Domoticz is running on windows, linux examples won't help me. 'use the Lua socket library' this isn't helpfull (besides the fact that the socket library isn't implemented in Domoticz)...![]()
To jumpstart the Lua coding part, i'm in need of coding examples so that i can copy-paste the examples pieces i need. An API can be interpreted many ways, the examples create a shortcut to use the API...
I'm not an experienced LUA developer, nor do i wish to become one. The only reason i'm doing this, is to create a work-around for a bug in Domoticz...
have a look at this:hannibal2206 wrote:Do you have a pointer where to find the solution ?
right at the top of the page is a description how to install jq. below is a nice script reading values using jq.hannibal2206 wrote:jquery ? sorry, did not find that there
Users browsing this forum: No registered users and 1 guest