Search found 2021 matches

by Egregius
Tuesday 22 August 2017 10:14
Forum: Other questions and discussions
Topic: which User initiated command
Replies: 3
Views: 84

Re: which User initiated command

What do you want to do with the username? Send it to a text sensor? A notification?
If you create your own interface, like I did with PHP Floorplan for Domoticz you can do everything you want.
by Egregius
Tuesday 22 August 2017 9:01
Forum: dzVents Lua Framework
Topic: Notify on setpoint temperature change
Replies: 2
Views: 91

Re: Notify on setpoint temperature change

In pass2php it's easy:

Code: Select all

<?php
if($status!=apcu_fetch('sliving_set')){
	telegram('Setpoint living set to '.$status);
}
by Egregius
Monday 21 August 2017 23:42
Forum: Other questions and discussions
Topic: script at running and stop
Replies: 1
Views: 39

Re: script at running and stop

Include your scripts in the domoticz.sh start/stop script.
by Egregius
Saturday 19 August 2017 17:13
Forum: Scripts [cleaning in progress]
Topic: Reading values from database
Replies: 10
Views: 213

Re: Reading values from database

If not: ask ;)
by Egregius
Saturday 19 August 2017 7:00
Forum: Scripts [cleaning in progress]
Topic: Reading values from database
Replies: 10
Views: 213

Re: Reading values from database

I have these PHP packages installed on my RPi: php7.0 php7.0-cgi php7.0-common php7.0-fpm php7.0-json php7.0-mysql php7.0-phpdbg php7.0-sqlite3 php-apcu php-common php7.0-bcmath php7.0-cli php7.0-curl php7.0-gmp php7.0-mbstring php7.0-opcache php7.0-readline php7.0-xml php-cgi You need at least php7...
by Egregius
Friday 18 August 2017 22:33
Forum: Scripts [cleaning in progress]
Topic: Reading values from database
Replies: 10
Views: 213

Re: Reading values from database

You'll need a PHP enabled webserver like apache, lighttpd, nginx,...
Will post some code tomorrow as example.
by Egregius
Friday 18 August 2017 21:55
Forum: Scripts [cleaning in progress]
Topic: Reading values from database
Replies: 10
Views: 213

Re: Reading values from database

Use php to read the sqlite database. Once you have the data in a array you can do whatever you want with it.
Maybe even better for the future: let php store the raw data in a mysql database, at least that's what I do for some thermometers.
by Egregius
Thursday 17 August 2017 23:01
Forum: Bugs and Problems
Topic: Cant reach web interface (Raspberry PI)
Replies: 43
Views: 1477

Re: Cant reach web interface (Raspberry PI)

Do a sudo netstat -an to list the listening ports.
by Egregius
Thursday 17 August 2017 10:38
Forum: PHP and all others
Topic: extract values from array
Replies: 16
Views: 226

Re: extract values from array

That's weird, but hey, if it works it's OK :)
by Egregius
Wednesday 16 August 2017 19:52
Forum: PHP and all others
Topic: extract values from array
Replies: 16
Views: 226

Re: extract values from array

lg($result[3]['lat']); should do
by Egregius
Wednesday 16 August 2017 17:13
Forum: PHP and all others
Topic: extract values from array
Replies: 16
Views: 226

Re: extract values from array

You can't just print a array.
You could try it with (not tested):

lg(print_r($result,true));
by Egregius
Wednesday 16 August 2017 11:16
Forum: Bugs and Problems
Topic: Urgent Help to go back to Previous stable version, November 2016
Replies: 7
Views: 245

Re: Urgent Help to go back to Previous stable version, November 2016

Domoticz v3.5877 from November 10th 2016: https://1drv.ms/u/s!AnHAV1P6FLcrg_N6B84nh1DBvE3z6g
Full folder, only domoticz.db removed.

And please, make a automatic backup system with versioning...
by Egregius
Wednesday 16 August 2017 6:59
Forum: Forum feedback
Topic: Code blocks not styled anymore
Replies: 0
Views: 44

Code blocks not styled anymore

Before the forum update a code=php block received nice colours, now it doesn't anymore making the code a lot harder to read.
Can that be added again please?
by Egregius
Wednesday 16 August 2017 6:57
Forum: PHP and all others
Topic: extract values from array
Replies: 16
Views: 226

Re: extract values from array

//Get the data $bliksems=file_get_contents('http://data2.blitzortung.org/Data/Protected/last_strikes.php?number=10&west=-20&east=30&north=60&south=30&sig=0'); //Split the string at } and put it in an array $bliksems=explode('}',$bliksems); //remove the last item of the array because it's empty arra...
by Egregius
Tuesday 15 August 2017 22:13
Forum: PHP and all others
Topic: extract values from array
Replies: 16
Views: 226

Re: extract values from array

Why isn't that a comma separated list?
Let me look at it tomorrow, already did some crazy stuff with invalid json ;)
by Egregius
Tuesday 15 August 2017 22:11
Forum: PHP and all others
Topic: extract values from array
Replies: 16
Views: 226

Re: extract values from array

ropske wrote:
Tuesday 15 August 2017 22:07
Is there a 'way around' to inspect all received data?
Yes
$bliksems=file_get_contents...
echo $bliksems;
by Egregius
Tuesday 15 August 2017 22:09
Forum: PHP and all others
Topic: extract values from array
Replies: 16
Views: 226

Re: extract values from array

Can you post the complete urL?
@ropske: you should at least have a json_decode in your code.

Code: Select all

$bliksems=json_decode(file_get_contents('http://...'),true);
by Egregius
Sunday 13 August 2017 20:34
Forum: PHP and all others
Topic: SOLVED:- Help with PHP Script
Replies: 14
Views: 405

Re: Help with PHP Script

Hmmm, this script was intended to run withoit pass2php, so exactly the way how you used to run it.
by Egregius
Sunday 13 August 2017 13:29
Forum: PHP and all others
Topic: SOLVED:- Help with PHP Script
Replies: 14
Views: 405

Re: Help with PHP Script

Thinks this should do it: #!/usr/bin/php <?php $ctx = stream_context_create(array('http'=>array('timeout' => 3,))); $domoticzurl='http://127.0.0.1:8080/'; $denon_address = 'http://192.168.1.12'; $time=$_SERVER['REQUEST_TIME']; function Schakel($idx,$cmd) { global $domoticzurl; $reply=json_decode(fil...
by Egregius
Sunday 13 August 2017 13:23
Forum: PHP and all others
Topic: Pass2PHP
Replies: 448
Views: 26460

Re: Pass2PHP

It's indeed not so simple to get it running, but when it runs it's rock stable and lightning fast :D
Give me a few minutes to put some code together, I'll post that in your other topic.