BOOSTER CONDIZIONATO - 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: BOOSTER CONDIZIONATO (/showthread.php?tid=2503) Pages:
1
2
|
BOOSTER CONDIZIONATO - Hosutech - 06.03.2020 good morning everyone, I ask for help for this script that I have tagged for the control of two variables "setpoint" and "temp", the goal is to activate a booster when the condition occurs ("delta" <= "setpoint" - "temp" ), where the "delta" is chosen by the system manager. When changing the "setpoint", it is verified that the mathematical condition is active (sometimes for 1 pulse, other times for a few seconds) and then deactivates the two output groups. There is no perfect answer to the mathematical condition that I believe works perfectly by reading the impulse / temporary activation of the outgoing groups from the bus monitor. value_1 = grp.getvalue ('7/0/0') - summer / winter value_2 = grp.getvalue ('3/3/2') - set speed value_3 = grp.getvalue ('6/0/2') - maunal command temp = grp.getvalue ('2/2/7') setpoint = grp.getvalue ('2/2/17') delta = grp.getvalue ('3/1/202') if (delta <= (setpoint-temp)) and (value_1 == true) and (value_3 == false) then grp.write ('2/0/92', true) grp.write ('6/0/92', value_2) else grp.write ('2/0/92', false) grp.write ('6/0/92', 0) - byte to 0 end RE: BOOSTER CONDIZIONATO - admin - 06.03.2020 I don't fully understand your question. What exactly is not working for you? You can set poll interval for an object to send KNX read request periodically if data is not sent by a KNX device automatically. RE: BOOSTER CONDIZIONATO - Daniel - 06.03.2020 First correct your comments as they part of the code now. Code: value_1 = grp.getvalue ('7/0/0') -- summer / winter RE: BOOSTER CONDIZIONATO - Hosutech - 09.03.2020 (06.03.2020, 16:26)Daniel. Wrote: First correct your comments as they part of the code now. daniel, in the translation of the texts the second indent is missing, in fact in the script the text is correctly preceded by the double - - (06.03.2020, 15:28)admin Wrote: I don't fully understand your question. What exactly is not working for you? You can set poll interval for an object to send KNX read request periodically if data is not sent by a KNX device automatically.the script does not execute the command stable command on the outgoing objects of the condition, sometimes it works other not! sorry, having put the TAG on each object, just one of these changes to relaunch the script ?? if I put the TAG only to the three objects "delta" "setpoint" and "temp" the script is activated only when these 3 objects change ?? RE: BOOSTER CONDIZIONATO - Daniel - 09.03.2020 Add log for the conditions to see if the condition was meet RE: BOOSTER CONDIZIONATO - Hosutech - 09.03.2020 how do I send a video of what's going on? RE: BOOSTER CONDIZIONATO - Daniel - 09.03.2020 upload it somewhere and drop a link RE: BOOSTER CONDIZIONATO - Hosutech - 15.04.2020 (09.03.2020, 13:31)Daniel. Wrote: upload it somewhere and drop a linkgood evening daniel, whenever possible I need support to solve this small but incessant problem: value_1 = grp.getvalue('32/1/41') value_2 = grp.getvalue('3/3/1') if (value_1==true) then grp.write('2/0/91', true) grp.write('6/0/91', value_2) else os.sleep(60) grp.write('2/0/91', false) grp.write('6/0/91', 0) end from the bus monitor I keep having the addresses cyclically, to reduce the traffic I also put the "os.sleep (60)" but it doesn't work, every second it sends me on the bu sil value at 0 / off of these two addresses: grp.write ('2/0/91', false) grp.write ('6/0/91', 0) RE: BOOSTER CONDIZIONATO - Daniel - 16.04.2020 Send backup to PM RE: BOOSTER CONDIZIONATO - Hosutech - 17.04.2020 (16.04.2020, 07:22)Daniel. Wrote: Send backup to PMgood morning Daniel, let me know if you received it in the attachment, thanks. RE: BOOSTER CONDIZIONATO - Daniel - 17.04.2020 Where is this script? RE: BOOSTER CONDIZIONATO - Hosutech - 17.04.2020 (17.04.2020, 08:23)Daniel. Wrote: Where is this script?value_1 = event.getvalue() value_2 = grp.getvalue('3/3/1') value_3 = grp.getvalue('7/0/0') --estate / inverno if (value_1==true) and (value_3==true) then grp.write('2/0/91', true) grp.write('6/0/91', value_2) else grp.write('2/0/91', false) grp.write('6/0/91', 0) end [color=rgba(0, 0, 0, 0.87)]you can find it in the event scripts (3/0/206)[/color] RE: BOOSTER CONDIZIONATO - Hosutech - 20.04.2020 (06.03.2020, 15:28)admin Wrote: I don't fully understand your question. What exactly is not working for you? You can set poll interval for an object to send KNX read request periodically if data is not sent by a KNX device automatically. good morning Edgard, I ask for help for this script as it happens that the value 0 of the two group addresses 2/0/91 and 6/0/91 are sent to me on the bus value_1 = event.getvalue () value_2 = grp.getvalue ('3/3/1') value_3 = grp.getvalue ('7/0/0') - summer / winter if (value_1 == true) and (value_3 == true) then grp.write ('2/0/91', true) grp.write ('6/0/91', value_2) otherwise grp.write ('2/0/91', false) grp. write ('6/0/91', 0) end (20.04.2020, 05:49)Hosutech Wrote:(06.03.2020, 15:28)admin Wrote: I don't fully understand your question. What exactly is not working for you? You can set poll interval for an object to send KNX read request periodically if data is not sent by a KNX device automatically. (17.04.2020, 19:18)Hosutech Wrote:(17.04.2020, 08:23)Daniel. Wrote: Where is this script?value_1 = event.getvalue() RE: BOOSTER CONDIZIONATO - admin - 20.04.2020 You already have this in your script: Code: value_3 = grp.getvalue('7/0/0') RE: BOOSTER CONDIZIONATO - Hosutech - 20.04.2020 thanks Edgard, the scripts are 2 that answer on the same address, both are started by the comparison and generate two obviously contrary results, one rightly inhibits the other, if it were possible to activate the Winter in Winter script and the Summer in Summer script would be perfect. ESTATE value_1 = grp.getvalue('7/0/0') value_3 = grp.getvalue('6/0/1') temp = grp.getvalue('2/2/1') setpoint = grp.getvalue('2/2/11') delta = grp.getvalue('3/1/201') if (delta<=(temp-setpoint)) and (value_1==false) and (value_3==false) then grp.write('3/0/206', true) else grp.write('3/0/206', false) end INVERNO value_1 = grp.getvalue('7/0/0') value_3 = grp.getvalue('6/0/1') temp = grp.getvalue('2/2/1') setpoint = grp.getvalue('2/2/11') delta = grp.getvalue('3/1/201') if (delta<=(setpoint-temp)) and (value_1==true) and (value_3==false) then grp.write('3/0/206', true) else grp.write('3/0/206', false) end RE: BOOSTER CONDIZIONATO - admin - 20.04.2020 Try this: Code: value_1 = grp.getvalue('7/0/0') RE: BOOSTER CONDIZIONATO - Hosutech - 20.04.2020 (20.04.2020, 06:54)admin Wrote: Try this:Thanks Edgard, before inserting your new script for which I am grateful, I would like to better understand what the result will be as, with this formula, I seem to understand that the address 3/0/206 is sent only if the two conditions are verified in turn filtered from summer / winter. I must point out that the 3/0/206 triggers an additional event script: WINTER value_1 = event.getvalue () value_2 = grp.getvalue ('3/3/1') value_3 = grp.getvalue ('7/0/0') - summer / winter if (value_1 == true) and (value_3 == true) then grp.write ('2/0/91', true) grp.write ('6/0/91', value_2) else grp.write ('2/0/91', false) grp.write ('6/0/91', 0) end SUMMER value_1 = event.getvalue () value_2 = grp.getvalue ('3/3/1') value_3 = grp.getvalue ('7/0/0') - summer / winter if (value_1 == true) and (value_3 == false) then grp.write ('2/0/91', true) grp.write ('6/0/101', value_2) else grp.write ('2/0/91', false) grp.write ('6/0/101', 0) end RE: BOOSTER CONDIZIONATO - admin - 20.04.2020 Like this: Code: event_value = event.getvalue() Your current script will fail with an error because you have single "-" instead of double dash for a comment. This line will be evaluated an arithmetic expression "X = A - B / C" Code: value_3 = grp.getvalue ('7/0/0') - summer / winter RE: BOOSTER CONDIZIONATO - Hosutech - 20.04.2020 (20.04.2020, 11:17)admin Wrote: Like this:Thanks Edgard, I would never have been able to independently write a script of this type, unfortunately I never studied the programming code, I am self-taught and unfortunately I don't even know English. I notice that there is no need to write for example: if event_value = true then but what you wrote is enough: in event_value then this means that when 7/0/0 = 1 (= summer) else (= winter) ?? event_value = event.getvalue () summer = grp.getvalue ('7/0/0') - summer / winter if event_value then out_value = grp.getvalue ('3/3/1') else out_value = 0 end if summer then out_addr = '6/0/91' else out_addr = '6/0/101' end RE: BOOSTER CONDIZIONATO - admin - 20.04.2020 if value == true then and if value then work the same when value variable type is Boolean (true/false). If value for 7/0/0 is true then summer mode part is executed otherwise winter mode. |