Hi all, is there a library that lets me communicate via php tunneling with KNX?
What are the disadvantages of such a system?
What are the disadvantages of such a system?
<?php
require('./include/boot.php');
//Server creation
$ha = €('::ha', array(
'mode' => 'server',
'key' => 'maria'
));
//I add interfacing to knx, or other home automation systems in the future
$ha->addModule('knx', array(
'host' => '192.168.178.21',
'port' => 3671,
'tunneling' => 'udp',
));
$ha->onLoad(function($m, $t)
{
//On loading event I start tunneling
$m->knx->start();
$m->knx->change('0/5/2', function($m, $t){
//Whenever the value is changed, I run this function,
//for example if the temperature is 30, if the state has changed.. etc
});
})->addQueue(function($m, $t) //$m are modules, $t instance $ha
{
//A queue is basically a timeout function
if($m->knx->isConnected())
{
//I do a connection check however this check is done surreptitiously when calling request functions
$m->knx->set('0/5/50', 50, '5.001'); //write the value
$val = $m->knx->get('0/5/50', '5.001'); //read the value
}
}, 10) //every 10 seconds
->onUnload(function()
{
//..
})
->run(); //I start the process.. only in server mode
Wir verarbeiten personenbezogene Daten über die Nutzer unserer Website mithilfe von Cookies und anderen Technologien, um unsere Dienste bereitzustellen. Weitere Informationen findest Du in unserer Datenschutzerklärung.
Indem Du unten auf "ICH stimme zu" klickst, stimmst Du unserer Datenschutzerklärung und unseren persönlichen Datenverarbeitungs- und Cookie-Praktiken zu, wie darin beschrieben. Du erkennst außerdem an, dass dieses Forum möglicherweise außerhalb Deines Landes gehostet wird und bist damit einverstanden, dass Deine Daten in dem Land, in dem dieses Forum gehostet wird, gesammelt, gespeichert und verarbeitet werden.
Kommentar