Page 1 of 1

SetPoint related script?

Posted: Friday 26 August 2016 22:06
by bxlouis
Hello Domoticz people!

I do not know a lot about scripts and I cannot create one which seems simple.

I would like to synchronize my thermostats SetPoints with my Nest Set Point.
I tried to create a Blockly script which said:

If "NestAwayMode" = on
Set "SetPoint1" = 15
Set "SetPoint2" = 15
...
Else If "NestAwayMode" = off
Set "SetPoint1" = "NestSetPoint"
Set "SetPoint2" = "NestSetPoint"
....

But it seems that the Set Points are not switches but "utilities", which can only be used in "If" and not "Set"

How may I use Lua or blockly scripts to achieve such a thing?

Thank you very much for your help!

Re: SetPoint related script?

Posted: Saturday 27 August 2016 7:17
by Egregius
In my pass2php script this would look like:

Code: Select all

function NestAwayMode(){
    global $a,$s,$i;
    if($a=="On"){
        if($s['SetPoint1'] != 15) udevice($i['SetPoint1'],15);
        if($s['SetPoint2'] != 15) udevice($i['SetPoint2'],15);
    }else{
        if($s['SetPoint1'] != $s['NestSetPoint']) udevice($i['SetPoint1'],$s['NestSetPoint']);
        if($s['SetPoint2'] != $s['NestSetPoint']) udevice($i['SetPoint2'],$s['NestSetPoint']);
    }
}
 

Re: SetPoint related script?

Posted: Saturday 27 August 2016 10:59
by bxlouis
Hi Egregius,

Indeed, I understand PHP better, I see what it does.
I own a RPi, how can I install Pass2PHP v2.0 using gizmocuz method?

And how should I setup the pass2php.php file? I see that a lot of functions are present but they do not fit my home. Should I just put the NestAwayMode function there?

Thanks.