Page 56 of 76
Re: Pass2PHP
Posted: Wednesday 23 October 2019 17:57
by ropske
Hello people,
something complete differently now, i already posted it on the heating subforum, but no reactions there and i know there are sme smart people in this forum
i want to control my heating by myself,
i did it in my 'older' house with a fibaro relay, but that was with a Vaillant VCW346/3-5 and i was able to connect a 230V thermostat (wich i replaced by the fibaro module)
But now in my new house the type is VCW346/5-5 and has no connections anymore for a 230V thermostat, so i can not connect my fibaro relay anymore.
The Vaillant heater has only a connection for a 24V thermostat.
Anyone knows how i can control my heating again by myself without using a fysical thermostat?
So i can use the pass2php_verwarming.php again
Thanks!
Re: Pass2PHP
Posted: Wednesday 23 October 2019 17:59
by Egregius
Are you sure there isn't a potential free contact?
Re: Pass2PHP
Posted: Wednesday 23 October 2019 21:39
by ropske
Hi mate,
this is the layout of the printboard of my Vaillant heater:

- brander1.jpg (111.28 KiB) Viewed 1219 times
and the functions:

- burner2.jpg (40.89 KiB) Viewed 1219 times
i was using before a Fibaro Double Relay FGS-222

- burner3.jpg (8.51 KiB) Viewed 1219 times
but then i connected the thermostat between IN and Q1, and IN was connected to my L(230V)
But i cant connect my IN anymore to my 230V because the contact on the printboard of the heater now is only 24VDC
Or i just need to connect the RT24V (printboard burner) to IN and Q1 of my Fibaro relay?
and L & N of the Fibaro module to the normal 230VAC ?
Re: Pass2PHP
Posted: Thursday 24 October 2019 6:37
by Egregius
Definitely IN and Q1 (without connection to L) to have a potential free relay.
I'm just not sure wether you should connect it to 11 or 12.
I would go for 12. And if it doesn't work as desired 11.
My Bosch burner has the same kind of connection. 13 is a bus where a 'smart' (read stupid) thermostat is connected. At 12 there was a bridge installed. When I removed that the burner stopped and I knew I could connect my relay there.
Re: Pass2PHP
Posted: Thursday 24 October 2019 6:39
by Egregius
After viewing
https://www.vaillant.be/downloads/foutc ... 720578.pdf I'm pretty sure you can safely connect to 12 RT 24v.
Re: Pass2PHP
Posted: Friday 25 October 2019 12:19
by ropske
Ok, thank you mate.
I will try tonight.
Another issue i have:
i want to save my electricity and gas usage to mysql database.
but the data inside is allways 0.999 (in mysql database)

- mysql1.jpg (51.96 KiB) Viewed 1207 times
the values i'm getting are good:

- mysql2.jpg (65.06 KiB) Viewed 1207 times
this is my code:

- mysql3.jpg (45.11 KiB) Viewed 1207 times
Re: Pass2PHP
Posted: Saturday 26 October 2019 6:44
by Egregius
What is the structure of your table?
You can also combine your lgmsg into one:
Code: Select all
lgmsg('idx: '.$idx.' stamp: '.$stamp.' verbruik: '.$verbruik);
Re: Pass2PHP
Posted: Saturday 26 October 2019 9:00
by ropske
here it is:

- mysql4.jpg (39.66 KiB) Viewed 1198 times
Re: Pass2PHP
Posted: Saturday 26 October 2019 14:51
by Egregius
Change the columns to float 5,3.
Now you have 3,3 wich means a total number of 3 with 3 digits after the decimal. Therefor the value can never be more than 1 and gets truncated.
Re: Pass2PHP
Posted: Sunday 27 October 2019 19:15
by ropske
Thanks a lot mate, as usual
i thought the 3,3 was 3 numbers before comma and 3 after, NOT
what kind of devices are you using to measure the temperature in the room of your kids for example
or living, keuken?
i'm using now a smoke detector or motion sensor, but they are mounted on the ceiling (denk dat dit het juiste woord is

ik bedoel plafond)
but the heat is much higher there at the ceiling than at a desk for example.
so to have a correct temperature, its kinda 'difficult'
thank you
Re: Pass2PHP
Posted: Sunday 27 October 2019 20:05
by Egregius
I use the fibaro smoke sensors but they’re mounted on the wall at 180cm height. I’m pretty sure they will still respond to smoke as they’re very sensitive. Combined with my temperature alarm script I should know about a fire in early state.
Re: Pass2PHP
Posted: Sunday 27 October 2019 20:08
by sincze
Very nice to see the progress you made @ropske with pass2php.

Re: Pass2PHP
Posted: Sunday 27 October 2019 20:51
by ropske
ok,thank you. didnt thought about hanging them at 1m80 instead of 2m25 (on the ceiling)
at what interval are they updating then? every 5 minutes?
and how are your batteries doing?
thanks mate.
@Sincze, i'm just using the functions of this wonderfull program

Re: Pass2PHP
Posted: Sunday 27 October 2019 22:36
by Egregius
They only send when 0,1 degree changed. I have rechargeable batteries and recharge them every 2 months.
If you find high power rechargeable batteries let me know;)
Re: Pass2PHP
Posted: Sunday 27 October 2019 22:52
by ropske
ah ok, i'm also using now rechargeble batteries for my thermostat valves.
still need to buy some new one (batteries and thermostat valves

house now is much bigger than the on before, so more radiators)
i didn't know the CR123A existed in rechargeble format, because the fibaro smoke sensor is working with CR123A
i got 2 now
Re: Pass2PHP
Posted: Thursday 31 October 2019 17:14
by Trigun
Hi Guys,
I want to push values of different devices to a influx database, for exampe gas and electricity usage.
I know this option is possible via the GUI of domoticz but this does not seem stable to me and I prefer to do this via php.
Unfortunately I don't know how, hopefully you can help me out.
Thanks in advance!
Re: Pass2PHP
Posted: Thursday 31 October 2019 19:35
by sincze
Trigun wrote: ↑Thursday 31 October 2019 17:14
Hi Guys,
I want to push values of different devices to a influx database, for exampe gas and electricity usage.
I know this option is possible via the GUI of domoticz but this does not seem stable to me and I prefer to do this via php.
Unfortunately I don't know how, hopefully you can help me out.
Thanks in advance!
Created a function for that.
Code: Select all
function influxdb($device,$value,$offset=0)
{
if(influxdb && cget('influxdbonline')==true) // Is Database available?? Function check for alarms
{
// FAMOUS STRING REPLACEMENT UTILITY
if (strpos($device, " ") !== false) { $device=str_replace(" ","_",$device); }
// ENDOF FAMOUS STRING REPLACEMENT UTILITY
$d = system('date +%s%N'); // Grab correct Dateformat
$timesplit = split_on($d, 10); // First part is time indicating NOW
$timesplit[0] = ($timesplit[0]-$offset); // Recalculate time!
$posttime = ($timesplit[0].$timesplit[1]);
$postdata = ("device_$device value=$value ".$posttime);
// lg('InluxDB Data: '.$postdata);
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-Type:application/octet-stream',
'content' => $postdata
)
);
$context = stream_context_create($opts);
$result = file_get_contents(ínfluxdbserver.'write?db=Domoticz', false, $context);
if(debug) lg('InfluxDB Notification: '.$postdata.' with result: '.$result);
}
}
Re: Pass2PHP
Posted: Friday 01 November 2019 7:15
by Gertony
Good morning all!
I really want to try the Pass2php script.
I treid a lot to get it working but it isnt working right now.
What i did:
Installed all the php versions wich i could find on my Raspberry pi (running Domoticz)
placed the JSON.lua and ee5_base64.lua in the script folder on my pi,
made a pass2php.php file configured it and placed it on my pi,
made a Lua device script in Domoticz with the right locations to find the files.
Now i dont get any sign of the Pass2php working or doing something.
What am i doing wrong?,
"wat zie ik over het hoofd?"
Thanks in advance for ure reaction.
Re: Pass2PHP
Posted: Friday 01 November 2019 7:21
by Trigun
Gertony wrote:Good morning all!
I really want to try the Pass2php script.
I treid a lot to get it working but it isnt working right now.
What i did:
Installed all the php versions wich i could find on my Raspberry pi (running Domoticz)
placed the JSON.lua and ee5_base64.lua in the script folder on my pi,
made a pass2php.php file configured it and placed it on my pi,
made a Lua device script in Domoticz with the right locations to find the files.
Now i dont get any sign of the Pass2php working or doing something.
What am i doing wrong?,
"wat zie ik over het hoofd?"
Thanks in advance for ure reaction.
Please look a few pages back, there is a how-to file attached
Sent from my iPhone using Tapatalk
Re: Pass2PHP
Posted: Friday 01 November 2019 12:00
by Gertony
Trigun wrote: ↑Thursday 08 August 2019 20:05
ok, GOT IT SOLVED!!!
I thought I had this issue before and after scrolling down this topic I found it!
The folowing lines need to be added to the _Fetchdomoticz.php file.
Code: Select all
require '/var/www/config.php';
require 'functions.php';
Is there a chance you want to add them to your file as well? ( for future updates

)
I also added this to my pass2php guide. if anyone is interested I attached it

please let me know if anyone thinks I missed something.
8-8-2019 Pass2php Guide.txt
of course all the credits go Egregius(the majority of the credits

) and Sincze for helping me out and spending time for all my noob questions!
again, thanks guys!
cheers!
Found it!
Gonna give it a new try!