IFTTT Applet skipped, Unable to make web request: Error: ETIMEDOUT

I’ve been using IFTTT for quite a while now. Until now I only used it to store the data of the Withings body scale in a MySQL database. Now that’s gonna change since Bosch released their IFTTT integration for the Easycontrol CT200 room thermostat. Of course that has to get integrated into Domoticz and Pass2PHP …
View

Centralized Fail2ban database

Centralized fail2ban database I like fail2ban a lot. It blocks intrusions in realtime based on the jails you configure. The jails monitor logfiles for certain words. I’m not going to explain that here, there’s enough on the net about fail2ban. The one problem I had with fail2ban is that it’s has a local database. I …
View

Pass2PHP and Floorplan v3 for Domoticz

It’s been a while since I posted something here. For the urbex photo fans, I’m sorry but I don’t get out exploring that often anymore. Busy renovating the home.Anyway, here’s an update of my Pass2PHP advanced automation for Domoticz. The Github repository is now combined with the Floorplan files so you’ll get everything in one …
View

Store temperature data from Domoticz in mySQL for historical analyses

This PHP script will retrieve temperature data from Domoticz and store it in a MySQL database. This way you can keep detailed information for more than 7 days, which is the limit for the short log in Domoticz. Detailed temperatures are stored in the table temp_day. Daily minimal, average and maximum temperatures in temp_month.The script …
View

PHP Floorplan 2.0 for Domoticz

Update of PHP Floorplan for Domoticz and PHP Floorplan for Domoticz Extra screenshots I’ve been busy lately optimizing the code so it has a very small footprint on data traffic. I managed to optimize the code in a way that each pageview only requires 2.3KB instead of the 41KB before. Most of that is achieved by moving the …
View

LUA Pass2PHP v2.2 minimal script

<?php error_reporting(E_ALL); ini_set(“display_errors”,”on”); date_default_timezone_set(‘Europe/Brussels’); define(‘time’,$_SERVER[‘REQUEST_TIME’]); $c=json_decode(base64_decode($_REQUEST[‘c’]),true); $s=json_decode(base64_decode($_REQUEST[‘s’]),true); $i=json_decode(base64_decode($_REQUEST[‘i’]),true); $t=json_decode(base64_decode($_REQUEST[‘t’]),true); $r=str_replace(” “,”_”,key($c)); if(function_exists(key($c))) key($c)(); elseif(function_exists($r)) $r(); //START USER FUNCTIONS function pirhall() { global $s,$i,$t; if($s[‘pirhall’==”On”]) { if($s[‘lighthall’]==’Off’) sw($i[‘hall’],’On’,’hall by pir’,1000); } } //END USERFUNCTIONS. Only change IP:PORT and ios,sms account details below function sw($idx,$action=””,$info=””,$Usleep=600000) { lg(“SWITCH “.$action.” “.$info); if(empty($action)) curl(“http://127.0.0.1:8084/json.htm?type=command&param=switchlight&idx=”.$idx.”&switchcmd=Toggle”); else curl(“http://127.0.0.1:8084/json.htm?type=command&param=switchlight&idx=”.$idx.”&switchcmd=”.$action); usleep($Usleep); } function sl($idx,$level,$info=””,$Usleep=600000) …
View

LUA Pass2PHP v2.2 complete script

Another update for my Pass2PHP script. This time a great difference in setup. The $events array isn’t used anymore. Instead each update instantly executes the function with his name, if the function exists of course. Spaces can’t be used in function names, therefor they need to be replaced by underscores. In the $s, $i and …
View

LUA Pass2PHP v2.1 minimal script

Please read the information on LUA Pass2PHP v2.1 complete script for information about new stuff in 2.1 This script only contains the minimal stuff to get you started. In this example a PIR with idx 123 will switch a light on. <?php $c=json_decode(base64_decode($_REQUEST[‘c’]),true); $s=json_decode(base64_decode($_REQUEST[‘s’]),true); $i=json_decode(base64_decode($_REQUEST[‘i’]),true); $t=json_decode(base64_decode($_REQUEST[‘t’]),true); $a=$s[key($c)];$devidx=$i[key($c)]; $events=array( 123=>’pirhall’ ); if(isset($events[$devidx]))$events[$devidx](); //START USERFUNCTIONS function pirhall(){ global $a,$s,$i,$t; …
View

LUA Pass2PHP v2.1 complete script

Make sure you also read the other posts about pass2php on https://egregius.be/tag/domoticz/ as they contain more information on how to implement this. the script_device_pass2php.lua script has basically stayd the same: JSON=loadfile(‘/volume1/@appstore/domoticz/var/scripts/JSON.lua’)() base64=loadfile(‘/volume1/@appstore/domoticz/var/scripts/base64.lua’)() c=base64.encode(JSON:encode(devicechanged)) s=base64.encode(JSON:encode(otherdevices)) i=base64.encode(JSON:encode(otherdevices_idx)) t=base64.encode(JSON:encode(otherdevices_lastupdate)) os.execute(‘curl -s –data “c=’..c..’&s=’..s..’&i=’..i..’&t=’..t..'” http://127.0.0.1/secure/pass2php.php &’) commandArray={} return commandArray In the PHP file some changes are made in my own function. …
View

LUA Pass2PHP v2.0 Small example and explanation

Based on the script LUA Pass2PHP v2.0 a small example: 2 pirs in this script. They have idx 123 and idx 234. In the $events array we define wich function is called when this $idx is the changed device. Have a look at LUA Pass2PHP v2.0 for many more examples and conditional switching. Some explanation …
View

LUA Pass2PHP v2.0

Vervolg op LUA Pass2php In grote lijnen dezelfde werkwijze als de vorige versie, vooral de functies zijn een groot stuk eenvoudiger geworden waardoor de code wat overzichtelijker en makkelijker te gebruiken is. Download deze 2 bestanden en plaats ze in de Domoticz scripts folder: JSON.lua ee5_base64.lua Maak in Domoticz Events een device lua script, pas eventueel …
View

Speeding up things: Cache variables

I can say that I am quite addicted to speed, especially when it comes to websites and web applications. Speed is everything. I tent to search and squeeze to the last millisecond. Sometimes we assume that packages that are taken for granted just are the fastest, but are they really? Let’s do some tests and …
View