Script for Open Window - thermostat protection mode - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Script for Open Window - thermostat protection mode (/showthread.php?tid=2115) |
Script for Open Window - thermostat protection mode - Josema - 09.06.2019 Good afternoon I have to make a script so that when the windows of the house are opened the thermostat is put in protection mode for this I have 1/1/1 heating mode true 1/1/2 window salon 1 or 1/1/3 window salon 2 o ..... then 1/1/8 protection mode thermostat salon true also when also the 1/1/1 heating mode true 1/2/1 kitchen window 1 or 1/2/2 kitchen window 2 o ... 1/2/8 cooking thermostat protection mode true I have an idea of how to do it but I can not make it work Can you help me? BR RE: Script for Open Window - thermostat protection mode - Erwin van der Zwart - 09.06.2019 Hi, Here is a sample of a scheduler + twilight + overrule button logic so you can see how to build it. The inputs 32/x/x are tagged and the script is event based attached to the same tag. Code: klok = '32/1/1' BR, Erwin RE: Script for Open Window - thermostat protection mode - josemabera - 10.06.2019 (09.06.2019, 22:09)Erwin van der Zwart Wrote: Hi, RE: Script for Open Window - thermostat protection mode - Erwin van der Zwart - 10.06.2019 Hi, Yes i know, Normally we don't create scripts on request (simply not possible to do that for everyone) and we give samples how to achieve something.. Here is the script you need: Code: heating_mode = grp.getvalue('1/1/1') You can do this the same for another floor with second script and different (unique) TAG's. BR, Erwin RE: Script for Open Window - thermostat protection mode - Josema - 10.06.2019 Hello Erwin Thank you very much for the Script, I am very grateful to you, this script is an event script or a resident script, I have a doubt because I have 2 thermostats to change to protection mode depending on the window that opens in the same room, so I have doubts. Thanks again BR Josema RE: Script for Open Window - thermostat protection mode - Erwin van der Zwart - 10.06.2019 Hi, Just like the image shows the script is attached to a TAG (in this case "Heating") so event based. All input objects are given this TAG "Heating" so if any window or heating is changing state, the scripts executes the logic. The windows are also given the TAG "Window" so the script can grab them all and check if any window is open. The output (protection object) should not have any TAG. (otherwise you create a permanent loop) You can do this twice, One script for thermostat 1 and one script for thermostat 2. Change the TAG's to Heating1 and Heating2 and Window1 and Window2 and you have twice this logic. Make sure to change the line grp.tag('Window') to grp.tag('Window1') and in the other script grp.tag('Window2') and change the grp adresses in both scripts to the correct ones. (1/1/1 and 1/1/8) BR, Erwin RE: Script for Open Window - thermostat protection mode - Josema - 10.06.2019 Hi , Erwin I see that I have a lot to learn Thank you BR Josema |