Pass2PHP

Moderator: leecollings

ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Pass2PHP

Post 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 :lol: ;)


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!
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Pass2PHP

Post by Egregius »

Are you sure there isn't a potential free contact?
ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Pass2PHP

Post by ropske »

Hi mate,

this is the layout of the printboard of my Vaillant heater:
brander1.jpg
brander1.jpg (111.28 KiB) Viewed 1213 times
and the functions:
burner2.jpg
burner2.jpg (40.89 KiB) Viewed 1213 times

i was using before a Fibaro Double Relay FGS-222
burner3.jpg
burner3.jpg (8.51 KiB) Viewed 1213 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 ?
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Pass2PHP

Post 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.
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Pass2PHP

Post by Egregius »

After viewing https://www.vaillant.be/downloads/foutc ... 720578.pdf I'm pretty sure you can safely connect to 12 RT 24v.
ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Pass2PHP

Post 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
mysql1.jpg (51.96 KiB) Viewed 1201 times
the values i'm getting are good:
mysql2.jpg
mysql2.jpg (65.06 KiB) Viewed 1201 times
this is my code:
mysql3.jpg
mysql3.jpg (45.11 KiB) Viewed 1201 times
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Pass2PHP

Post 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);
ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Pass2PHP

Post by ropske »

here it is:
mysql4.jpg
mysql4.jpg (39.66 KiB) Viewed 1192 times
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Pass2PHP

Post 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.
ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Pass2PHP

Post by ropske »

Thanks a lot mate, as usual :lol:
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 :lol: 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
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Pass2PHP

Post 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.
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Pass2PHP

Post by sincze »

Very nice to see the progress you made @ropske with pass2php. :lol:
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Pass2PHP

Post 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 :lol:
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Pass2PHP

Post 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;)
ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Pass2PHP

Post 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 :lol: 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
Trigun
Posts: 390
Joined: Wednesday 30 November 2016 11:58
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Contact:

Re: Pass2PHP

Post 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!
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Pass2PHP

Post 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);
    }
}
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
Gertony
Posts: 4
Joined: Friday 01 November 2019 7:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Pass2PHP

Post 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.
Trigun
Posts: 390
Joined: Wednesday 30 November 2016 11:58
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Contact:

Re: Pass2PHP

Post 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
Gertony
Posts: 4
Joined: Friday 01 November 2019 7:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Pass2PHP

Post 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!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest