So das Gerät ist bis auf eine Dosierpumpe zusammengebaut und im Betrieb.
var clock, Dauer, Uhrzeit, schedule, Intervall;
/**
* Beschreibe diese Funktion …
*/
function L_C3_B6sung_1() {
Dauer = parseFloat(getState("Aqua_Control.0.Triton.Lösung_1.Faktoren.Lösung_1_Faktor_3").val);
setState("sonoff.0.Aqua_Dosierer.POWER1"/*Aqua_Dosierer_Pumpe_1*/, true);
// Intervalldauer = Faktor
Intervall = setInterval(function () {
Dauer = (typeof Dauer == 'number' ? Dauer : 0) + -1;
if (Dauer <= 0) {
(function () {if (Intervall) {clearInterval(Intervall); Intervall = null;}})();
setState("sonoff.0.Aqua_Dosierer.POWER1"/*Aqua_Dosierer_Pumpe_1*/, false);
sendTo("telegram.0", "send", {
text: (['Triton Lösung 1 ','\n',getState("Aqua_Control.0.Triton.Lösung_1.Faktoren.Lösung_1_Faktor_3").val,' ml dosiert'].join(''))
});
}
}, 806);
}
/**
* Beschreibe diese Funktion …
*/
function setUhr(clock) {
Uhrzeit = clock.split(':');
schedule = schedule((Uhrzeit[1]).trim() + ' ' + (Uhrzeit[0]).trim() + ' ' + '*'.trim() + ' ' + '*'.trim() + ' ' + '*'.trim(), function () {
L_C3_B6sung_1();
});
}
setUhr(getState("Aqua_Control.0.Triton.Lösung_1.Uhrzeiten.Lösung_1_Uhrzeit_1").val);
on({id: 'Aqua_Control.0.Triton.Lösung_1.Uhrzeiten.Lösung_1_Uhrzeit_1', change: "ne"}, function (obj) {
var value = obj.state.val;
var oldValue = obj.oldState.val;
(function () {if (schedule) {clearSchedule(schedule); schedule = null;}})();
setUhr((obj.state ? obj.state.val : ""));
});
<xml xmlns="http://www.w3.org/1999/xhtml">
<variables>
<variable type="" id="snfLpaddd`4/)Uy^kLsW">clock</variable>
<variable type="" id=")bAD/?%{s?q44~ZGe7{B">Dauer</variable>
<variable type="" id="iQ`n%m6-[L_B242P|7rW">Uhrzeit</variable>
<variable type="undefined" id="schedule">schedule</variable>
<variable type="undefined" id="Intervall">Intervall</variable>
</variables>
<block type="procedures_callnoreturn" id="3a)9A+{U=BTerQFdk^7e" x="-3287" y="-1587">
<mutation name="setUhr">
<arg name="clock"></arg>
</mutation>
<value name="ARG0">
<block type="get_value" id="Rmv(=Tg+:6/}8B(?~nI#">
<field name="ATTR">val</field>
<field name="OID">Aqua_Control.0.Triton.Lösung_1.Uhrzeiten.Lösung_1_Uhrzeit_1</field>
</block>
</value>
<next>
<block type="on_ext" id="X}o|@dWx#6!BiHho8e)o">
<mutation items="1"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="dXPC7;GFYg(#~T78}@mB">
<field name="oid">Aqua_Control.0.Triton.Lösung_1.Uhrzeiten.Lösung_1_Uhrzeit_1</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="schedule_clear" id="nt-N]NBg?,fY%.)hYJ4D">
<field name="NAME">schedule</field>
<next>
<block type="procedures_callnoreturn" id="yvhs4uL6uUxnW!c$UF/{">
<mutation name="setUhr">
<arg name="clock"></arg>
</mutation>
<value name="ARG0">
<block type="on_source" id="SfI,}teG@`dg#_g%Zp#:">
<field name="ATTR">state.val</field>
</block>
</value>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
<block type="procedures_defnoreturn" id="jE$gVVpa7!Xtx{X@H^Fd" x="-3287" y="-1312">
<field name="NAME">Lösung_1</field>
<comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
<statement name="STACK">
<block type="variables_set" id="9kptcK|P^2:}bKZXyZ8f">
<field name="VAR" id=")bAD/?%{s?q44~ZGe7{B" variabletype="">Dauer</field>
<value name="VALUE">
<block type="convert_tonumber" id="Tj/%:}sl8v})GfkG,zO:">
<value name="VALUE">
<block type="get_value" id=".,XzJi)h(f$9$~(`H$I!">
<field name="ATTR">val</field>
<field name="OID">Aqua_Control.0.Triton.Lösung_1.Faktoren.Lösung_1_Faktor_3</field>
</block>
</value>
</block>
</value>
<next>
<block type="control" id="%}iPzHc5tUi.(P1_MvRo">
<mutation delay_input="false"></mutation>
<field name="OID">sonoff.0.Aqua_Dosierer.POWER1</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="SM.e~4#O=p?c/SXA|JX%">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="comment" id="KV;?nPX*TAluqR-qF9f+">
<field name="COMMENT">Intervalldauer = Faktor</field>
<next>
<block type="timeouts_setinterval" id="1+dIQ5^rJM?nkaI[6WN}">
<field name="NAME">Intervall</field>
<field name="INTERVAL">806</field>
<field name="UNIT">ms</field>
<statement name="STATEMENT">
<block type="math_change" id="!*zN$DgW0K=76_[.1*]X">
<field name="VAR" id=")bAD/?%{s?q44~ZGe7{B" variabletype="">Dauer</field>
<value name="DELTA">
<shadow type="math_number" id="e_D7=bSd65:`]Q{qWSZD">
<field name="NUM">-1</field>
</shadow>
</value>
<next>
<block type="controls_if" id="=/[;A-M~WF?KXEx~W0z?">
<value name="IF0">
<block type="logic_compare" id=";qY,PC)CB~{1#4iVHaj,">
<field name="OP">LTE</field>
<value name="A">
<block type="variables_get" id="2k;4KgTu$A3wF)@V`ulP">
<field name="VAR" id=")bAD/?%{s?q44~ZGe7{B" variabletype="">Dauer</field>
</block>
</value>
<value name="B">
<block type="math_number" id="?bnhw6qVm`$}~NCKlw2P">
<field name="NUM">0</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="timeouts_clearinterval" id=";dz/hf`o4]4(2pDSH)I3">
<field name="NAME">Intervall</field>
<next>
<block type="control" id="SeaFI}%xNdyzRbLV,6HN">
<mutation delay_input="false"></mutation>
<field name="OID">sonoff.0.Aqua_Dosierer.POWER1</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="1_[)-;0}n;LMH}tCmhi:">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="telegram" id="N)tO@5NbhTtUeW(4MtBo">
<field name="INSTANCE">.0</field>
<field name="LOG"></field>
<field name="SILENT">FALSE</field>
<field name="PARSEMODE">default</field>
<value name="MESSAGE">
<shadow type="text" id="R8/w|SSi{cj7,4lDKwe[">
<field name="TEXT">text</field>
</shadow>
<block type="text_join" id="Jm8OpAELrwceT@g35lf{">
<mutation items="4"></mutation>
<value name="ADD0">
<block type="text" id="CM1{{J8!7VItB4D8j3B8">
<field name="TEXT">Triton Lösung 1 </field>
</block>
</value>
<value name="ADD1">
<block type="text_newline" id="o]Q2(%iBw$/9I:?8IyZw">
<field name="Type">\n</field>
</block>
</value>
<value name="ADD2">
<block type="get_value" id="f]$r3U;[8ohFZ.8I[asH">
<field name="ATTR">val</field>
<field name="OID">Aqua_Control.0.Triton.Lösung_1.Faktoren.Lösung_1_Faktor_3</field>
</block>
</value>
<value name="ADD3">
<block type="text" id="Jxd~DTQ,y3LUt8En2!}Y">
<field name="TEXT"> ml dosiert</field>
</block>
</value>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="fK5kmsd)LwZ7|P2xa^9U" x="-3287" y="-762">
<mutation>
<arg name="clock" varid="snfLpaddd`4/)Uy^kLsW"></arg>
</mutation>
<field name="NAME">setUhr</field>
<comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
<statement name="STACK">
<block type="variables_set" id="aOx5`vU/=f;#)rmrW[|7">
<field name="VAR" id="iQ`n%m6-[L_B242P|7rW" variabletype="">Uhrzeit</field>
<value name="VALUE">
<block type="lists_split" id="XnqDHu5JM{#WIs8~S,M-">
<mutation mode="SPLIT"></mutation>
<field name="MODE">SPLIT</field>
<value name="INPUT">
<block type="variables_get" id="4`T;i0Hg@f?=Gq^,J6.~">
<field name="VAR" id="snfLpaddd`4/)Uy^kLsW" variabletype="">clock</field>
</block>
</value>
<value name="DELIM">
<shadow type="text" id="]v!xP8l3r?{D;(m_QyNL">
<field name="TEXT">:</field>
</shadow>
</value>
</block>
</value>
<next>
<block type="schedule_create" id="6x%+6G+PaD[w*{FuFm=K">
<field name="NAME">schedule</field>
<value name="SCHEDULE">
<shadow type="field_cron" id="m4F75|F$}NA}2;e/avWa">
<field name="CRON">* * * * *</field>
</shadow>
<block type="cron_builder" id="q6(U2T{7uu}mYF)9QMKr">
<mutation seconds="false" as_line="false"></mutation>
<field name="LINE">FALSE</field>
<field name="WITH_SECONDS">FALSE</field>
<value name="DOW">
<shadow type="text" id=")8oVcqHY5re?jv#0QsO8">
<field name="TEXT">*</field>
</shadow>
</value>
<value name="MONTHS">
<shadow type="text" id="GfQ!DoE|TZTliq*)8,@j">
<field name="TEXT">*</field>
</shadow>
</value>
<value name="DAYS">
<shadow type="text" id="S6hVuxIjcYJMlS^~:zE5">
<field name="TEXT">*</field>
</shadow>
</value>
<value name="HOURS">
<shadow type="text" id="NP{*G*@dWEP9M9mNlZFF">
<field name="TEXT">*</field>
</shadow>
<block type="lists_getIndex" id="-0gZ}|H=8/}~St}d%rl;">
<mutation statement="false" at="true"></mutation>
<field name="MODE">GET</field>
<field name="WHERE">FROM_START</field>
<value name="VALUE">
<block type="variables_get" id="8U#M]$`MHq(~A]~(v{2R">
<field name="VAR" id="iQ`n%m6-[L_B242P|7rW" variabletype="">Uhrzeit</field>
</block>
</value>
<value name="AT">
<block type="math_number" id=")zFTxG~Gpp`eZw8r2,8w">
<field name="NUM">1</field>
</block>
</value>
</block>
</value>
<value name="MINUTES">
<shadow type="text" id="I(LCmtz/NJ%:Tvp,*;JL">
<field name="TEXT">*</field>
</shadow>
<block type="lists_getIndex" id="0([.HRKLsVPA.X:jwVI@">
<mutation statement="false" at="true"></mutation>
<field name="MODE">GET</field>
<field name="WHERE">FROM_START</field>
<value name="VALUE">
<block type="variables_get" id="8#E0pY-UET(BcZH]~qB:">
<field name="VAR" id="iQ`n%m6-[L_B242P|7rW" variabletype="">Uhrzeit</field>
</block>
</value>
<value name="AT">
<block type="math_number" id=";UF-jK:^cV#hui?GDL/V">
<field name="NUM">2</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="STATEMENT">
<block type="procedures_callnoreturn" id="/6qq{?/)+*vm:UnA$x,0">
<mutation name="Lösung_1"></mutation>
</block>
</statement>
</block>
</next>
</block>
</statement>
</block>
</xml>
IMG_5133.jpg
IMG_5131.JPG
IMG_5126.JPG
IMG_5127.JPG