Page 18 of 76

Re: LUA Pass2php

Posted: Monday 30 January 2017 22:58
by Egregius
Could it be that you have different versions of the lua and pass2php file?
In the lua file the 4 tables (c,s,i,t) are sent but your php only captures one ($c).

Re: LUA Pass2php

Posted: Tuesday 31 January 2017 6:56
by Egregius
@Moderators: can you move this topic to the PHP board please?

Re: LUA Pass2php

Posted: Tuesday 31 January 2017 7:06
by dutchdevil83
Egregius wrote:Could it be that you have different versions of the lua and pass2php file?
In the lua file the 4 tables (c,s,i,t) are sent but your php only captures one ($c).
Nope, only have one pass2php version. Pull this from your github and copied this. This is the whole pass2php.php file (in /var/www/html/secure/):

Code: Select all

<?php error_reporting(E_ALL);ini_set("display_errors","on");date_default_timezone_set('Europe/Amsterdam');
define('time',$_SERVER['REQUEST_TIME']);$actions=0;
$c=ex($_REQUEST['c']);
//lg('4. Egregius Start of Pass2PHP');
foreach($c as $device=>$status){
 // lg($device.' = '.$status);
	if(@include '/var/www/html/secure/pass2php/'.$device.'.php'){
		//Filter the 'set level' stuff away for dimmers
		if(in_array($device,array('Verlichting Slaapkamer'))){
			if($status=='Off')apcu_store('s'.$device,'Off');
			else apcu_store('s'.$device,filter_var($status,FILTER_SANITIZE_NUMBER_INT));
		}else apcu_store('s'.$device,$status);
		apcu_store('t'.$device,time);
		$dev=$device;
		}
}
if(!isset($dev))die();
include '/var/www/html/secure/pass2php/__CRON.php';
function sw($idx,$action='',$info=''){
	lg('SWITCH '.$idx.' '.$action.' '.$info);
	if(empty($action))file_get_contents('http://127.0.0.1:8080/json.htm?type=command&param=switchlight&idx='.$idx.'&switchcmd=Toggle');
	else file_get_contents('http://127.0.0.1:8080/json.htm?type=command&param=switchlight&idx='.$idx.'&switchcmd='.$action);
	global $actions;$actions=$actions+1;
}
function double($idx,$action,$comment='',$wait=2000000){
	sw($idx,$action,$comment);
	usleep($wait);
	sw($idx,$action,$comment.' repeat',0);
	global $actions;$actions=$actions+2;
}
function sl($idx,$level,$info=''){
	lg('SETLEVEL '.$idx.' '.$level.' '.$info);
	file_get_contents('http://127.0.0.1:8080/json.htm?type=command&param=switchlight&idx='.$idx.'&switchcmd=Set%20Level&level='.$level);
}
function ud($idx,$nvalue,$svalue,$info=""){
	if(!in_array($idx, array(395,532,534)))lg("UPDATE ".$idx." ".$nvalue." ".$svalue." ".$info);
	file_get_contents('http://127.0.0.1:8080/json.htm?type=command&param=udevice&idx='.$idx.'&nvalue='.$nvalue.'&svalue='.$svalue);
	global $actions;$actions=$actions+1;
}
function telegram($msg,$silent=true,$to=1){
	$telegrambot='123456789:ABCD-xCRhO-RBfUqICiJs8q9A_3YIr9irxI';
	$telegramchatid=123456789;
	$telegramchatid2=234567890;
	for($x=1;$x<=100;$x++){
		$result=json_decode(file_get_contents('https://api.telegram.org/bot'.$telegrambot.'/sendMessage?chat_id='.$telegramchatid.'&text='.urlencode($msg).'&disable_notification='.$silent));
		if(isset($result->ok))
			if($result->ok===true){lg('telegram sent to 1: '.$msg);break;}
			else lg('telegram sent failed');sleep($x*3);
		global $actions;$actions=$actions+1;
	}
	if($to>=2)
		for($x=1;$x<=100;$x++){
			$result=json_decode(file_get_contents('https://api.telegram.org/bot'.$telegrambot.'/sendMessage?chat_id='.$telegramchatid2.'&text='.urlencode($msg).'&disable_notification='.$silent));
			if(isset($result->ok))
				if($result->ok===true){lg('telegram sent to 2: '.$msg);break;}
				else lg('telegram sent failed');sleep($x*3);
			global $actions;$actions=$actions+1;
		}
	elseif($to==3){ios($msg);global $actions;$actions=$actions+1;}

}
function lg($msg){file_get_contents('http://127.0.0.1:8080/json.htm?type=command&param=addlogmessage&message='.urlencode('=> '.$msg));}
function ios($msg){
	$appledevice='1234567890/ZHxYptWlD4zoKvGC1VYH805kSRqROHYVNSUzmWV';
	$appleid='[email protected]';
	$applepass='applepass';
	require_once('findmyiphone.php');
	$fmi=new FindMyiPhone(appleid,applepass);
	$fmi->playSound(appledevice,$msg);
	sms($msg);
}
function sms($msg){
	exit;
	$smsuser='clickatelluser';
	$smspassword='clickatellpass';
	$smsapi=1234567;
	$smstofrom=32123456789;
	file_get_contents('http://api.clickatell.com/http/sendmsg?user='.$smsuser.'&password='.$smspassword.'&api_id='.$smsapi.'&to='.$smstofrom.'&text='.urlencode($msg).'&from='.$smstofrom.'');
}
function RefreshZwave($node){
	$last=apcu_fetch('refresh'.$node);
	apcu_store('refresh'.$node,time);
	if($last<time-3600){
		$devices=json_decode(file_get_contents('http://127.0.0.1:8080/json.htm?type=openzwavenodes&idx=3',false),true);
		foreach($devices['result'] as $devozw)
			if($devozw['NodeID']==$node){
				$device=$devozw['Description'].' '.$devozw['Name'];
				break;
			}
		lg(' > Refreshing node '.$node.' '.$device);
		for($k=1;$k<=5;$k++){
			$result=file_get_contents('http://127.0.0.1:8080/ozwcp/refreshpost.html',false,stream_context_create(array('http'=>array('header'=>'Content-Type: application/x-www-form-urlencoded\r\n','method'=>'POST','content'=>http_build_query(array('fun'=>'racp','node'=>$node)),),)));
			if($result==='OK')break;
			sleep(1);
		}
		/*if(apcu_fetch('timedeadnodes')<time-298){apcu_store('timedeadnodes',time);foreach($devices as $node=>$data){if($node=="result"){foreach($data as $index=>$eltsNode){if($eltsNode["State"]=="Dead"&&!in_array($eltsNode['NodeID'],array(57))){telegram('Node '.$eltsNode['NodeID'].' '.$eltsNode['Description'].' ('.$eltsNode['Name'].') marked as dead, reviving '.ZwaveCommand($eltsNode['NodeID'],'HasNodeFailed'));ControllerBusy(10);ZwaveCommand(1,'Cancel');}}}}}*/
	}
}
function Zwavecancelaction(){file_get_contents('http://127.0.0.1:8080/ozwcp/admpost.html',false,stream_context_create(array('http'=>array('header'=>'Content-Type: application/x-www-form-urlencoded\r\n','method'=>'POST','content'=>http_build_query(array('fun'=>'cancel')),),)));}
function ZwaveCommand($node,$command){$cm=array('AssignReturnRoute'=>'assrr','DeleteAllReturnRoutes'=>'delarr','NodeNeighbourUpdate'=>'reqnnu','RefreshNodeInformation'=>'refreshnode','RequestNetworkUpdate'=>'reqnu','HasNodeFailed'=>'hnf','Cancel'=>'cancel');$cm=$cm[$command];for($k=1;$k<=5;$k++){$result=file_get_contents('http://127.0.0.1:8080/ozwcp/admpost.html',false,stream_context_create(array('http'=>array('header'=>'Content-Type: application/x-www-form-urlencoded\r\n','method'=>'POST','content'=>http_build_query(array('fun'=>$cm,'node'=>'node'.$node)),),)));if($result=='OK')break;sleep(1);}return $result;}
function ControllerBusy($retries){for($k=1;$k<=$retries;$k++){$result=file_get_contents('http://127.0.0.1:8080/ozwcp/poll.xml');$p=xml_parser_create();xml_parse_into_struct($p,$result,$vals,$index);xml_parser_free($p);foreach($vals as $val){if($val['tag']=='ADMIN'){$result=$val['attributes']['ACTIVE'];break;}}if($result=='false')break;if($k==$retries){ZwaveCommand(1,'Cancel');break;}sleep(1);}}
function convertToHours($time){if($time<600)return substr(strftime('%M:%S',$time),1);elseif($time>=600&&$time<3600)return strftime('%M:%S',$time);else return strftime('%k:%M:%S',$time);}
function ex($x){
	$return=array();
	$pieces=explode('#',$x);
	foreach($pieces as $piece){
		$keyval=explode('|',$piece);
		if(count($keyval)>1)$return[$keyval[0]]=$keyval[1];
		else $return[$keyval[0]]='';
	}
	return $return;
}
Do i have to change anything in APCU.php ? Or is there some way to print the contents of the device table that is stored away?

Re: Pass2PHP

Posted: Tuesday 31 January 2017 7:30
by Egregius
Oh, I see... I didn't update all files...
Github updated now, that's the version I'm using right now. Totally based on using apcu.

in __CRON.PHP the cron604800 part grabs all used devices from domoticz and stores their current state, timestamp and idx in cache.
Those can be retrieved with apcu_fetch('Xnameofdevice') where X is s for state, t for timestamp or i for idx.
The sw function is simplified and only requires the name of the device, the function itself grabs the idx then. Also new in this sw function is that virtual devices will be used in cache if the idx is unknown. This way I managed to remove my dummy hardware from domoticz.

Re: Pass2PHP

Posted: Tuesday 31 January 2017 8:30
by dutchdevil83
Egregius wrote:Oh, I see... I didn't update all files...
Github updated now, that's the version I'm using right now. Totally based on using apcu.

in __CRON.PHP the cron604800 part grabs all used devices from domoticz and stores their current state, timestamp and idx in cache.
Those can be retrieved with apcu_fetch('Xnameofdevice') where X is s for state, t for timestamp or i for idx.
The sw function is simplified and only requires the name of the device, the function itself grabs the idx then. Also new in this sw function is that virtual devices will be used in cache if the idx is unknown. This way I managed to remove my dummy hardware from domoticz.
OK thanx, will update the files and report back!

Re: Pass2PHP

Posted: Tuesday 31 January 2017 8:56
by Egregius
Could be that there are changes later today, installing on a friends domoticz at the moment. Maybe I'll find other issues.

Re: Pass2PHP

Posted: Tuesday 31 January 2017 9:14
by dutchdevil83
Egregius wrote:Could be that there are changes later today, installing on a friends domoticz at the moment. Maybe I'll find other issues.
I`m trying everything to get it working but it looks like it`s not storing in cache with apcu ? How can i debug this to look where it`s going wrong?
(I`m assuming i don`t have to change any other files to get apcu working??)

I have these files now;

TEST.php:

Code: Select all

<?php
lg($device.' = '.$status);

if ($status=="On"&&apcu_fetch('sVerlichting Dressoir')=='Off') {
	//lg("IDX : "$i['Verlichting_Dressoir']);
	lg('Hij staat aan'); 
   sw('Verlichting Dressoir','On');
} 
if ($status=="Off"&&apcu_fetch('sVerlichting Dressoir')=='On'){
	lg ('Hij staat niet aan');
    sw('Verlichting Dressoir','Off');
}
pass2php.php:

Code: Select all

<?php error_reporting(E_ALL);ini_set("display_errors","on");date_default_timezone_set('Europe/Amsterdam');define('time',$_SERVER['REQUEST_TIME']);$c=ex($_REQUEST['c']);
//lg('4. Egregius Start of Pass2PHP');
foreach($c as $device=>$status){
	// lg($device.' = '.$status);
	if(@include '/var/www/html/secure/pass2php/'.$device.'.php'){
		if($device=='brander'){
			if($status!=apcu_fetch('sbrander'))apcu_store('t'.$device,time);
		}else{
			if(apcu_fetch('t'.$device)<time)apcu_store('t'.$device,time);
		}
		//Filter the 'set level' stuff away for dimmers
		if(in_array($device,array('Verlichting Slaapkamer'))){
			if($status=='Off')apcu_store('s'.$device,'Off');
			else apcu_store('s'.$device,filter_var($status,FILTER_SANITIZE_NUMBER_INT));
		}else apcu_store('s'.$device,$status);
		$dev=$device;
		if($device=='miniliving1s'&&$status=='Off')print strftime("%Y-%m-%d %H:%M:%S",time()).'   => CRON Forced'.PHP_EOL;
		else print strftime("%Y-%m-%d %H:%M:%S",time()).'   -> '.$device.' -> '.$status.PHP_EOL;
	}
	else{if(!empty($device)&&!endswith($device,'_Utility')&&!endswith($device,'_Temperature'))print strftime("%Y-%m-%d %H:%M:%S",time()).'      '.$device.' -> '.$status.PHP_EOL;}
}
if(!isset($dev))die();
include '/var/www/html/secure/pass2php/__CRON.php';
function sw($name,$action='Toggle',$comment=''){
	$msg = strftime("%Y-%m-%d %H:%M:%S",time()).'   => SWITCH '.$name.' => '.$action;
	if(!empty($comment)) $msg.=' => '.$comment;
	print $msg.PHP_EOL;
	if(apcu_exists('i'.$name)){
		file_get_contents('http://127.0.0.1:8080/json.htm?type=command&param=switchlight&idx='.apcu_fetch('i'.$name).'&switchcmd='.$action);
		//sleep(2);
	}else{
		apcu_store('s'.$name,$action);apcu_store('t'.$name,time);
	}
}
function double($name,$action,$comment='',$wait=2000000){sw($name,$action,$comment);usleep($wait);sw($name,$action,$comment.' repeat');}
function sl($name,$level,$info=''){
	$msg=strftime("%Y-%m-%d %H:%M:%S",time()).'   => SETLEVEL '.$name.' => '.$level;
	if(!empty($comment)) $msg.=' => '.$comment;
	print $msg.PHP_EOL;
	if(apcu_exists('i'.$name)){
		file_get_contents('http://127.0.0.1:8080/json.htm?type=command&param=switchlight&idx='.apcu_fetch('i'.$name).'&switchcmd=Set%20Level&level='.$level);
		//sleep(2);
	}
}
function ud($name,$nvalue,$svalue,$info=""){
	if(apcu_exists('i'.$name)){
		file_get_contents('http://127.0.0.1:8080/json.htm?type=command&param=udevice&idx='.apcu_fetch('i'.$name).'&nvalue='.$nvalue.'&svalue='.$svalue);
		//sleep(4);
	}else{
		apcu_store('s'.$name,$svalue);apcu_store('t'.$name,time);
	}
}
function telegram($msg,$silent=true,$to=1){
	$telegrambot='123456789:ABCD-xCRhO-RBfUqICiJs8q9A_3YIr9irxI';
	$telegramchatid=123456789;
	$telegramchatid2=234567890;
	for($x=1;$x<=100;$x++){
		$result=json_decode(file_get_contents('https://api.telegram.org/bot'.$telegrambot.'/sendMessage?chat_id='.$telegramchatid.'&text='.urlencode($msg).'&disable_notification='.$silent));
		if(isset($result->ok))
			if($result->ok===true){lg('telegram sent to 1: '.$msg);break;}
			else lg('telegram sent failed');sleep($x*3);
		global $actions;$actions=$actions+1;
	}
	if($to>=2)
		for($x=1;$x<=100;$x++){
			$result=json_decode(file_get_contents('https://api.telegram.org/bot'.$telegrambot.'/sendMessage?chat_id='.$telegramchatid2.'&text='.urlencode($msg).'&disable_notification='.$silent));
			if(isset($result->ok))
				if($result->ok===true){lg('telegram sent to 2: '.$msg);break;}
				else lg('telegram sent failed');sleep($x*3);
			global $actions;$actions=$actions+1;
		}
	elseif($to==3){ios($msg);global $actions;$actions=$actions+1;}

}
function lg($msg){file_get_contents('http://127.0.0.1:8080/json.htm?type=command&param=addlogmessage&message='.urlencode('=> '.$msg));}
function ios($msg){
	$appledevice='1234567890/ZHxYptWlD4zoKvGC1VYH805kSRqROHYVNSUzmWV';
	$appleid='[email protected]';
	$applepass='applepass';
	require_once('findmyiphone.php');
	$fmi=new FindMyiPhone(appleid,applepass);
	$fmi->playSound(appledevice,$msg);
	sms($msg);
}
function sms($msg){
	exit;
	$smsuser='clickatelluser';
	$smspassword='clickatellpass';
	$smsapi=1234567;
	$smstofrom=32123456789;
	file_get_contents('http://api.clickatell.com/http/sendmsg?user='.$smsuser.'&password='.$smspassword.'&api_id='.$smsapi.'&to='.$smstofrom.'&text='.urlencode($msg).'&from='.$smstofrom.'');
}
function RefreshZwave($node){
	$last=apcu_fetch('refresh'.$node);
	apcu_store('refresh'.$node,time);
	if($last<time-3600){
		$devices=json_decode(file_get_contents('http://127.0.0.1:8080/json.htm?type=openzwavenodes&idx=3',false),true);
		foreach($devices['result'] as $devozw)
			if($devozw['NodeID']==$node){
				$device=$devozw['Description'].' '.$devozw['Name'];
				break;
			}
		print strftime("%Y-%m-%d %H:%M:%S",time()).'   => Refreshing node '.$node.' '.$device.PHP_EOL;
		for($k=1;$k<=5;$k++){
			$result=file_get_contents('http://127.0.0.1:8080/ozwcp/refreshpost.html',false,stream_context_create(array('http'=>array('header'=>'Content-Type: application/x-www-form-urlencoded\r\n','method'=>'POST','content'=>http_build_query(array('fun'=>'racp','node'=>$node)),),)));
			if($result==='OK')break;
			sleep(1);
		}
		if(apcu_fetch('timedeadnodes')<time-298){
			apcu_store('timedeadnodes',time);
			foreach($devices as $node=>$data){
				if($node=="result"){
					foreach($data as $index=>$eltsNode){
						if($eltsNode["State"]=="Dead"&&!in_array($eltsNode['NodeID'],array(57))){
							telegram('Node '.$eltsNode['NodeID'].' '.$eltsNode['Description'].' ('.$eltsNode['Name'].') marked as dead, reviving '.ZwaveCommand($eltsNode['NodeID'],'HasNodeFailed'));
							ControllerBusy(10);
							ZwaveCommand(1,'Cancel');
						}
					}
				}
			}
		}
	}
}
function Zwavecancelaction(){file_get_contents('http://127.0.0.1:8080/ozwcp/admpost.html',false,stream_context_create(array('http'=>array('header'=>'Content-Type: application/x-www-form-urlencoded\r\n','method'=>'POST','content'=>http_build_query(array('fun'=>'cancel')),),)));}
function ZwaveCommand($node,$command){$cm=array('AssignReturnRoute'=>'assrr','DeleteAllReturnRoutes'=>'delarr','NodeNeighbourUpdate'=>'reqnnu','RefreshNodeInformation'=>'refreshnode','RequestNetworkUpdate'=>'reqnu','HasNodeFailed'=>'hnf','Cancel'=>'cancel');$cm=$cm[$command];for($k=1;$k<=5;$k++){$result=file_get_contents('http://127.0.0.1:8080/ozwcp/admpost.html',false,stream_context_create(array('http'=>array('header'=>'Content-Type: application/x-www-form-urlencoded\r\n','method'=>'POST','content'=>http_build_query(array('fun'=>$cm,'node'=>'node'.$node)),),)));if($result=='OK')break;sleep(1);}return $result;}
function ControllerBusy($retries){for($k=1;$k<=$retries;$k++){$result=file_get_contents('http://127.0.0.1:8080/ozwcp/poll.xml');$p=xml_parser_create();xml_parse_into_struct($p,$result,$vals,$index);xml_parser_free($p);foreach($vals as $val){if($val['tag']=='ADMIN'){$result=$val['attributes']['ACTIVE'];break;}}if($result=='false')break;if($k==$retries){ZwaveCommand(1,'Cancel');break;}sleep(1);}}
function convertToHours($time){if($time<600)return substr(strftime('%M:%S',$time),1);elseif($time>=600&&$time<3600)return strftime('%M:%S',$time);else return strftime('%k:%M:%S',$time);}
function ex($x){
	$return=array();
	$pieces=explode('#',$x);
	foreach($pieces as $piece){
		$keyval=explode('|',$piece);
		if(count($keyval)>1)$return[$keyval[0]]=$keyval[1];
		else $return[$keyval[0]]='';
	}
	return $return;
}
function endswith($string, $test) {
    $strlen = strlen($string);
    $testlen = strlen($test);
    if ($testlen > $strlen) return false;
    return substr_compare($string, $test, $strlen - $testlen, $testlen) === 0;
}

Re: Pass2PHP

Posted: Tuesday 31 January 2017 9:28
by Egregius
What's in the domoticz log? Looking in bash that is. Something like tail -f /var/log/domoticz.log
That shows more than the logfile in the webui.
Do you have apcu installed? apt-get install php5-apcu or apt-get install php7-apcu depening on your php version.

I'm still not at that point of the installation at my friends pi. Thing is so outdated that It's already busy for 2 hours updating...

Re: Pass2PHP

Posted: Tuesday 31 January 2017 21:52
by ropske
adding some more and more to your script ;)
great way to learn php :D

one more question:
you are using also 'slapen'
it is set to 'on' when some PIR have not detected motion for some time, but where do you set this back to 'off' ?
thanks!

Re: Pass2PHP

Posted: Tuesday 31 January 2017 23:31
by Egregius
From my floorplan, or with a simple remote upstairs.
Slapen (sleep) activates pirs downstairs as alarm, makes sure everything downstairs is off.
We mostly activate it ourself, the script after 4 hours is there in case we forgot it.
Same thing with 'weg' (away) after 12 hours.
When away upstairs is also off and armed.

Re: Pass2PHP

Posted: Wednesday 01 February 2017 22:06
by sincze
Hey @Egregius more and more people getting inspired :) . System is snoring like a kitten here in The Netherlands. :)

Sent from my SM-G925F using Tapatalk

Re: Pass2PHP

Posted: Wednesday 01 February 2017 23:39
by Egregius
Lol, thanks and enjoy ;)

Re: Pass2PHP

Posted: Sunday 12 February 2017 11:33
by sincze
Egregius wrote:Lol, thanks and enjoy ;)
@Egregius.. Just to keep things fast as they are.

What do you think when using grafana and influxdb.. Use pass2php to push the data in Influxdb... Or have domoticz deal with it using data - push.

As most tutorials describe the push one but hey they are not familiar with the speed of pass2php.

Just want to create some nice dashboard :)

Re: Pass2PHP

Posted: Sunday 12 February 2017 14:59
by Egregius
I would use the cron in pass2php ;)

Re: RE: Re: Pass2PHP

Posted: Sunday 12 February 2017 20:40
by sincze
Egregius wrote:I would use the cron in pass2php ;)
A yes. That is what I thought :) the famous__CRON.php

Sent from my SM-G925F using Tapatalk

Re: Pass2PHP

Posted: Tuesday 14 February 2017 20:29
by ropske
do you save all measured data to a mysql server?

something off topic: is your domoticz database copied to somewhere else?
i'm just affraid my sdcard will get lost sometime of my raspberry pi and would love to have all data stored somewhere else, for example my nas server, maybe in a sql server?

Re: Pass2PHP

Posted: Tuesday 14 February 2017 21:11
by sincze
Try rsync to sync the dB each hour day :) it works excellent

Sent from my SM-G925F using Tapatalk

Re: Pass2PHP

Posted: Tuesday 14 February 2017 21:17
by Egregius
You can easily backup the whole sql3lite db with rsync.
And/or send data in realtime to sql.
I only sent all temps every minute to sql, just for good analysis of the heating script.

Re: Pass2PHP

Posted: Sunday 19 February 2017 16:06
by ropske

Code: Select all

$query="INSERT IGNORE INTO `temp`(`stamp`,`buiten`,`living`,`badkamer`,`kamer`,`tobi`,`alex`,`zolder`,`s_living`,`s_badkamer`,`s_kamer`,`s_tobi`,`s_alex`,`brander`,`badkamervuur`) VALUES ('$stamp','$buiten_temp','$living','$badkamer','$kamer','$tobi','$alex','$zolder','$s_living','$s_badkamer','$s_kamer','$s_tobi','$s_alex','$brander','$badkamervuur');";

$db=new mysqli('localhost','kodi','kodi','domotica');if($db->connect_errno>0)die('Unable to connect to database [' . $db->connect_error . ']');if(!$result=$db->query($query))die('There was an error running the query ['.$query .' - ' . $db->error . ']');$db->close();
i see you are using this, is it possible to give some more information about the 'new mysqli'
my sql server is running on my nas, so i will need to put instead of 'localhost', my address of nas-server
then we have the first and second 'kodi' and 'domotica'
what are these?

Thank you for your help ;)

Re: Pass2PHP

Posted: Sunday 19 February 2017 16:09
by ropske
hmm, just thinking:
1st kodi: username
2nd kodi: password
domotica: ?

$query="INSERT IGNORE INTO `temp` => temp will be the tabel where you store the values?