Pass2PHP
Moderator: leecollings
- sincze
- Posts: 1299
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
My neighbour recently bought a Growatt Inverter.
To have Solar values added to Domoticz.... Something was needed.
I created it using PHP and Pass2PHP main functions.
As he does not have a full Pass2PHP install, nor the knowledge to do so. I created a 1 off Pass2PHP light file.
It does the job.
https://www.domoticz.com/forum/viewtopi ... 11#p212311
To have Solar values added to Domoticz.... Something was needed.
I created it using PHP and Pass2PHP main functions.
As he does not have a full Pass2PHP install, nor the knowledge to do so. I created a 1 off Pass2PHP light file.
It does the job.
https://www.domoticz.com/forum/viewtopi ... 11#p212311
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.
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.
-
- Posts: 390
- Joined: Wednesday 30 November 2016 11:58
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.10717
- Contact:
Re: Pass2PHP
Hey Guys,
at this moment my Rpi is getting slower and slower as more devices and camera are added.
I looked at pass2php multiple times but thought it will be too hard to implement but I really want to put my teeth into it as I believe this will be the answer to my issues.
hopefully you guys are willing to help me out a bit with my noob questions
as for starters which database is needed? mariaDB fof MySQL, I see both being mentioned in previous posts. as the principle doesn't really matter is still would like to make the richt choice
also, are the instructions of gimic all there is to carry out?
thanks in advance guys!
at this moment my Rpi is getting slower and slower as more devices and camera are added.
I looked at pass2php multiple times but thought it will be too hard to implement but I really want to put my teeth into it as I believe this will be the answer to my issues.
hopefully you guys are willing to help me out a bit with my noob questions
as for starters which database is needed? mariaDB fof MySQL, I see both being mentioned in previous posts. as the principle doesn't really matter is still would like to make the richt choice
also, are the instructions of gimic all there is to carry out?
thanks in advance guys!
- sincze
- Posts: 1299
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
I can imagine that looking at it first time all @Egregius hard work looks overwhelming.Trigun wrote: ↑Wednesday 24 April 2019 18:21 Hey Guys,
at this moment my Rpi is getting slower and slower as more devices and camera are added.
I looked at pass2php multiple times but thought it will be too hard to implement but I really want to put my teeth into it as I believe this will be the answer to my issues.
hopefully you guys are willing to help me out a bit with my noob questions
as for starters which database is needed? mariaDB fof MySQL, I see both being mentioned in previous posts. as the principle doesn't really matter is still would like to make the richt choice
also, are the instructions of gimic all there is to carry out?
thanks in advance guys!
Keep in mind basically you only need:
- A Running Domoticz instance -> with a Pass2PHP lua file in the scripts/lua directory
- A Working Webserver (like NGINX) that calls a specific web page... pass2php.php
- A Pass2PHP.php file in the /var/www/html/secure directory
- A Function/ setting files that do thing in /var/www/html/secure
- A MariaDB (Debian default) database to store everything in.
- Phpmyadmin to keep an eye on the database
In addition a cron.sh will monitor A your Domoticz (and restart it if it crashed) B call cron jobs for things you want to happen at specific intervals. Like switch the lights off ar 23:00 or after 5 minutes of no motiion.
The rest he created is pure fun
Resume:
So everytime in Domoticz a device changes its state... It will call the lua file.
The lua calls the pass2php.php file and that file will store all changes in the database.
The database is also read in memory and that is the data you work with (An Array).
Should the Pi crash or reboot the changes are also kept in the Database so nothing lost.
I'm thinking of releasing a pass2php 'starter pack' that goes back to the beginning of Pass2PHP but is in line with the latest release of Egregius.
I hope this clears the smoke a bit.
viewtopic.php?f=64&t=12343&start=740#p211760
Code: Select all
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install nginx
sudo apt-get install mysql-server
sudo apt-get install phpmyadmin
sudo mysql_secure_installation
https://www.digitalocean.com/community/ ... untu-16-04
After changing the root password:
Code: Select all
mysql -u root -p
Code: Select all
GRANT ALL PRIVILEGES ON *.* TO 'domotica'@'localhost' IDENTIFIED BY 'domotica';
CREATE DATABASE domotica;
Now import the Egregius database.
Code: Select all
mysql -u domotica -p domotica < 'Create-Update SQL Database.txt'
Code: Select all
mysql -u root -p
Code: Select all
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| domotica |
| information_schema |
| mysql |
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)
Code: Select all
sudo ln -s /usr/share/phpmyadmin /var/www/html
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.
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.
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Pass2PHP
Great post Sincze!
I linked to it from the readme
A starter pack could be interesting. However it basically isn't needed.
All that has to be done from the Github repo is:
- Empty secure/pass2php folder
- Empty _cron*.php files
Update/replace the config file.
After that it should be good to start.
Of course if you'd like to use the floorplan also there's some work to be done there to.
All files are delivered as I use them on my system. The Github repository https://github.com/Egregius/PHP-Floorpl ... r-Domoticz is a realtime image of my system.
All _cron*.php and secure/pass2php files can be used as an example and to see/learn the great flexibility of it.
Without it I've would already have abandoned Domoticz and maybe even domotica completely. What's the use of spending thousands of € if the stuff doesn't do exactly what you want?
I linked to it from the readme
A starter pack could be interesting. However it basically isn't needed.
All that has to be done from the Github repo is:
- Empty secure/pass2php folder
- Empty _cron*.php files
Update/replace the config file.
After that it should be good to start.
Of course if you'd like to use the floorplan also there's some work to be done there to.
All files are delivered as I use them on my system. The Github repository https://github.com/Egregius/PHP-Floorpl ... r-Domoticz is a realtime image of my system.
All _cron*.php and secure/pass2php files can be used as an example and to see/learn the great flexibility of it.
Without it I've would already have abandoned Domoticz and maybe even domotica completely. What's the use of spending thousands of € if the stuff doesn't do exactly what you want?
- sincze
- Posts: 1299
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
tnx.Egregius wrote: ↑Thursday 25 April 2019 14:40 Great post Sincze!
I linked to it from the readme
A starter pack could be interesting. However it basically isn't needed.
All that has to be done from the Github repo is:
- Empty secure/pass2php folder
- Empty _cron*.php files
Update/replace the config file.
After that it should be good to start.
Of course if you'd like to use the floorplan also there's some work to be done there to.
All files are delivered as I use them on my system. The Github repository https://github.com/Egregius/PHP-Floorpl ... r-Domoticz is a realtime image of my system.
All _cron*.php and secure/pass2php files can be used as an example and to see/learn the great flexibility of it.
Without it I've would already have abandoned Domoticz and maybe even domotica completely. What's the use of spending thousands of € if the stuff doesn't do exactly what you want?
And you are correct with the light version
I found this OBS Studio video recorder.
Maybe I can create a video how to install from scratch
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.
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.
-
- Posts: 390
- Joined: Wednesday 30 November 2016 11:58
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.10717
- Contact:
Re: Pass2PHP
WoW! that would be fantastic! than anybody can have a great, fast and stable working working domoticz setup.sincze wrote: ↑Thursday 25 April 2019 14:53tnx.Egregius wrote: ↑Thursday 25 April 2019 14:40 Great post Sincze!
I linked to it from the readme
A starter pack could be interesting. However it basically isn't needed.
All that has to be done from the Github repo is:
- Empty secure/pass2php folder
- Empty _cron*.php files
Update/replace the config file.
After that it should be good to start.
Of course if you'd like to use the floorplan also there's some work to be done there to.
All files are delivered as I use them on my system. The Github repository https://github.com/Egregius/PHP-Floorpl ... r-Domoticz is a realtime image of my system.
All _cron*.php and secure/pass2php files can be used as an example and to see/learn the great flexibility of it.
Without it I've would already have abandoned Domoticz and maybe even domotica completely. What's the use of spending thousands of € if the stuff doesn't do exactly what you want?
And you are correct with the light version
I found this OBS Studio video recorder.
Maybe I can create a video how to install from scratch
I am happy to do some testing based on the video as I am not a programmer by nature
-
- Posts: 667
- Joined: Wednesday 08 March 2017 9:42
- Target OS: Linux
- Domoticz version: 3.8993
- Location: Amsterdam
- Contact:
Re: Pass2PHP
Hi All guys,
I tried to understand this but the installation makes me crazy already.
I understand to install MySQL, create user, import the .db file of Egregius.
But then ... Do I need to git pull the whole stuff to a folder or do I only need some .php files etc?
Can someone do the steps from a to z ?
I tried to understand this but the installation makes me crazy already.
I understand to install MySQL, create user, import the .db file of Egregius.
But then ... Do I need to git pull the whole stuff to a folder or do I only need some .php files etc?
Can someone do the steps from a to z ?
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
- sincze
- Posts: 1299
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
Mmm good question indeed.poudenes wrote: ↑Monday 29 April 2019 10:13 Hi All guys,
I tried to understand this but the installation makes me crazy already.
I understand to install MySQL, create user, import the .db file of Egregius.
But then ... Do I need to git pull the whole stuff to a folder or do I only need some .php files etc?
Can someone do the steps from a to z ?
I think after my holiday I do have to make that video
For the full experience pass2php + floorplan
The contents of: https://github.com/Egregius/PHP-Floorpl ... r-Domoticz should go directly to "/var/www/html". I just downloaded it als ZIP file and moved it to that directory. Git pull can do the trick as well indeed.
All pass2php stuff is located in /secure.
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.
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.
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Pass2PHP
I think download as a zip is the best option.
There's no need to do a git pull as you must do a lot of changes in the files.
The only git pull that I can think of is in a different folder. Then in your unzipped html folder change the functions.php file so it includes the version of the git pull.
There's no need to do a git pull as you must do a lot of changes in the files.
The only git pull that I can think of is in a different folder. Then in your unzipped html folder change the functions.php file so it includes the version of the git pull.
- sincze
- Posts: 1299
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
@Egregius, What hardware are you currently using for this setup? Still Synology? VM maybe?
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.
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.
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Pass2PHP
I run Debian in a Proxmox Container on a Intel Baby Canyon NUC7i3BNH with 8GB ram and a SSD.
Advantage of using virtualisation is that you can easily create full system backups. In case that the NUC dies I can install Proxmox on any other computer and restore the backup.
Advantage of using virtualisation is that you can easily create full system backups. In case that the NUC dies I can install Proxmox on any other computer and restore the backup.
-
- Posts: 390
- Joined: Wednesday 30 November 2016 11:58
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.10717
- Contact:
Re: Pass2PHP
Ok, got it all setup.sincze wrote:I can imagine that looking at it first time all @Egregius hard work looks overwhelming.Trigun wrote: ↑Wednesday 24 April 2019 18:21 Hey Guys,
at this moment my Rpi is getting slower and slower as more devices and camera are added.
I looked at pass2php multiple times but thought it will be too hard to implement but I really want to put my teeth into it as I believe this will be the answer to my issues.
hopefully you guys are willing to help me out a bit with my noob questions
as for starters which database is needed? mariaDB fof MySQL, I see both being mentioned in previous posts. as the principle doesn't really matter is still would like to make the richt choice
also, are the instructions of gimic all there is to carry out?
thanks in advance guys!
Keep in mind basically you only need:
- A Running Domoticz instance -> with a Pass2PHP lua file in the scripts/lua directory
- A Working Webserver (like NGINX) that calls a specific web page... pass2php.php
- A Pass2PHP.php file in the /var/www/html/secure directory
- A Function/ setting files that do thing in /var/www/html/secure
- A MariaDB (Debian default) database to store everything in.
- Phpmyadmin to keep an eye on the database
In addition a cron.sh will monitor A your Domoticz (and restart it if it crashed) B call cron jobs for things you want to happen at specific intervals. Like switch the lights off ar 23:00 or after 5 minutes of no motiion.
The rest he created is pure fun
Resume:
So everytime in Domoticz a device changes its state... It will call the lua file.
The lua calls the pass2php.php file and that file will store all changes in the database.
The database is also read in memory and that is the data you work with (An Array).
Should the Pi crash or reboot the changes are also kept in the Database so nothing lost.
I'm thinking of releasing a pass2php 'starter pack' that goes back to the beginning of Pass2PHP but is in line with the latest release of Egregius.
I hope this clears the smoke a bit.
viewtopic.php?f=64&t=12343&start=740#p211760
Do the secure installation after installin phpmyadmin, or be in some serious trouble....Code: Select all
sudo apt-get update sudo apt-get upgrade sudo apt-get install nginx sudo apt-get install mysql-server sudo apt-get install phpmyadmin sudo mysql_secure_installation
https://www.digitalocean.com/community/ ... untu-16-04
After changing the root password:Code: Select all
mysql -u root -p
Exit MYSQLCode: Select all
GRANT ALL PRIVILEGES ON *.* TO 'domotica'@'localhost' IDENTIFIED BY 'domotica'; CREATE DATABASE domotica;
Now import the Egregius database.Check if Database was createdCode: Select all
mysql -u domotica -p domotica < 'Create-Update SQL Database.txt'
Code: Select all
mysql -u root -p
To have phpmyadmin working via http://server_domain_or_IP/phpmyadmin for me I had to issue:Code: Select all
MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | domotica | | information_schema | | mysql | | performance_schema | +--------------------+ 4 rows in set (0.00 sec)
Code: Select all
sudo ln -s /usr/share/phpmyadmin /var/www/html
Got a new install of of domoticz(on a SSD. Thx Sincze! ).
Next step would probably be reconfiguring the different files and create device scripts? Is there a way to see if it all works? How to continue from here?
Thnx in advance guys!
Sent from my iPhone using Tapatalk
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Pass2PHP
Of course you can test it.
First of all you should check that the devices table is filled and that the idx's are known there.
To fill in the IDX's you have to include _fetchdomoticz.php somewhere, I have it included on a button on floorplan.others.php.
If the devices table is filled you know the exact names of all the devices.
Then, lets say you have a motion sensor called "PIRkitchen" you have to make a file secure/pass2php/PIRkitchen.php
In that file you could add something like:
Then, if the light switches on upon movement pass2php if operational.
Look at my examples starting with PIR for more advanced ways like using the sun and other devices to decide if the light needs to go on or not.
For example:
Here the light is only switch on if the virtual switch auto is on, we're at home, the light is off and the power of the solar panels is less than $zoninkom.
Or some more advanced:
The light of the kitchen is only switched on when all other lights of the kitchen are off and that the solar power is less than 50W except when the shutters are more than 70% closed.
First of all you should check that the devices table is filled and that the idx's are known there.
To fill in the IDX's you have to include _fetchdomoticz.php somewhere, I have it included on a button on floorplan.others.php.
If the devices table is filled you know the exact names of all the devices.
Then, lets say you have a motion sensor called "PIRkitchen" you have to make a file secure/pass2php/PIRkitchen.php
In that file you could add something like:
Code: Select all
<?php
if ($status=='On') {
sw('lightkitchen', 'On');
}
Look at my examples starting with PIR for more advanced ways like using the sun and other devices to decide if the light needs to go on or not.
For example:
Code: Select all
<?php
if ($status=="On"&&$d['auto']['s']=='On') {
if ($d['Weg']['s']==0&&$d['inkom']['s']=='Off'&&$d['zon']['s']<$zoninkom) {
sw('inkom', 'On');
}
}
Or some more advanced:
Code: Select all
<?php
if ($status=="On"&&$d['auto']['s']=='On') {
if (TIME<strtotime('20:00')&&$d['Weg']['s']==0&&$d['keuken']['s']=='Off'&&$d['wasbak']['s']=='Off'&&$d['werkblad1']['s']=='Off'&&$d['kookplaat']['s']=='Off'&&($d['zon']['s']<$zonkeuken||($d['RkeukenL']['s']>70&&$d['RkeukenR']['s']>70))) {
sw('keuken', 'On');
}
}
-
- Posts: 390
- Joined: Wednesday 30 November 2016 11:58
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.10717
- Contact:
Re: Pass2PHP
just checken the file now but after putting in the url I am getting a unexpected error in line 12.Egregius wrote: ↑Wednesday 01 May 2019 6:12 Of course you can test it.
First of all you should check that the devices table is filled and that the idx's are known there.
To fill in the IDX's you have to include _fetchdomoticz.php somewhere, I have it included on a button on floorplan.others.php.
If the devices table is filled you know the exact names of all the devices.
Then, lets say you have a motion sensor called "PIRkitchen" you have to make a file secure/pass2php/PIRkitchen.php
In that file you could add something like:Then, if the light switches on upon movement pass2php if operational.Code: Select all
<?php if ($status=='On') { sw('lightkitchen', 'On'); }
Look at my examples starting with PIR for more advanced ways like using the sun and other devices to decide if the light needs to go on or not.
For example:Here the light is only switch on if the virtual switch auto is on, we're at home, the light is off and the power of the solar panels is less than $zoninkom.Code: Select all
<?php if ($status=="On"&&$d['auto']['s']=='On') { if ($d['Weg']['s']==0&&$d['inkom']['s']=='Off'&&$d['zon']['s']<$zoninkom) { sw('inkom', 'On'); } }
Or some more advanced:The light of the kitchen is only switched on when all other lights of the kitchen are off and that the solar power is less than 50W except when the shutters are more than 70% closed.Code: Select all
<?php if ($status=="On"&&$d['auto']['s']=='On') { if (TIME<strtotime('20:00')&&$d['Weg']['s']==0&&$d['keuken']['s']=='Off'&&$d['wasbak']['s']=='Off'&&$d['werkblad1']['s']=='Off'&&$d['kookplaat']['s']=='Off'&&($d['zon']['s']<$zonkeuken||($d['RkeukenL']['s']>70&&$d['RkeukenR']['s']>70))) { sw('keuken', 'On'); } }
this is the error:
Code: Select all
PHP Parse error: syntax error, unexpected '192.168' (T_DNUMBER), expecting variable (T_VARIABLE) or '{' or '$' in /var/www/html/secure/_fetchdomoticz.php on line 12
Code: Select all
$domoticz=json_decode(file_get_contents($domoticzurl.'/json.htm?type=devices&used=true'), true);
this one(also, should the "." be there at the end?:
Code: Select all
$domoticz=json_decode(file_get_contents($http://192.168.1.200:8080.'/json.htm?type=devices&used=true'), true);
Code: Select all
$domoticz=json_decode(file_get_contents($192.168.1.200:8080.'/json.htm?type=devices&used=true'), true);
- sincze
- Posts: 1299
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
$domoticz=json_decode(file_get_contents($domoticzurl.'/json.htm?type=devices&used=true')
The $domoticzurl.'/json...
Is defined somewhere else as
http://127.0.0.1:8080 or similar
With that variable filled you can use it everywhere in Domoticz and believe me... A lot of functions use that variable.
The $domoticzurl.'/json...
Is defined somewhere else as
http://127.0.0.1:8080 or similar
With that variable filled you can use it everywhere in Domoticz and believe me... A lot of functions use that variable.
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.
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.
-
- Posts: 390
- Joined: Wednesday 30 November 2016 11:58
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.10717
- Contact:
Re: Pass2PHP
Ok, no I am a bit lost too.sincze wrote: ↑Wednesday 01 May 2019 14:34 $domoticz=json_decode(file_get_contents($domoticzurl.'/json.htm?type=devices&used=true')
The $domoticzurl.'/json...
Is defined somewhere else as
http://127.0.0.1:8080 or similar
With that variable filled you can use it everywhere in Domoticz and believe me... A lot of functions use that variable.
if I understand correctly there is one file that in need to fill in with the correct information and all other files refer to that file?
which file do I need to use for all the personal information?
- sincze
- Posts: 1299
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
No worries
It should be in the secure directory.
As we want it Secure.
Egregius calls it config.php if I am correct
It should be in the secure directory.
As we want it Secure.
Egregius calls it config.php if I am correct
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.
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.
-
- Posts: 390
- Joined: Wednesday 30 November 2016 11:58
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.10717
- Contact:
Re: Pass2PHP
ok, this is what I did so far:
installed:
NginX
Mysql-server
phpmyadmin
mysql_secure_installation
created the database and got access to the phpmyadmin webportal.
I put the pass2php.php file in the /var/html/secure directory
I put the functions.php file in the /var/html/secure directory
also, the _fetchdomoticz.php is in this directory
I put the config.php file in the /var/html/secure directory
I entered my domoticzurl in the config.php file
via the phpmyadmin webconsole I imported the Creat-Update SQL Database.txt file
as for now I still get an error when I execute _fetchdomoticz.php
the error is as follows:
Code: Select all
pi@raspberrypi:/var/www/html/secure $ php _fetchdomoticz.php
PHP Parse error: syntax error, unexpected ':', expecting ',' or ')' in /var/www/html/secure/_fetchdomoticz.php on line 12
What to do next?
thnx guys!
- sincze
- Posts: 1299
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
Don't forget the lua file in the Domoticz directory later.
Can you echo the string (line12l that is failing so we can see what the problem is?
There seems to be a typo.
Can you echo the string (line12l that is failing so we can see what the problem is?
There seems to be a typo.
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.
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.
Who is online
Users browsing this forum: Google [Bot] and 1 guest