OK now i’m confused. Without rule it’s look like this:
With one rule totally simple if a string is bar switch light off or on. It’s look like this:
Now next rule with time of day design pattern and some other things. Also without timer but check time now:
So that are only two blockly rules. And if i have more then 90 rules, for me it’s clear that the RAM is to less. Now the big question is, I’m wrong here? Did we have a RAM problem with Blockly rules or is this totally normal and i must buy me really a new Pi?
This are both rules:
configuration: {}
triggers:
- id: "1"
configuration:
itemName: AquarienTime
type: core.ItemStateChangeTrigger
conditions: []
actions:
- inputs: {}
id: "2"
configuration:
blockSource: <xml xmlns="https://developers.google.com/blockly/xml"><block
type="controls_if" id="TElJ.S=4u~z0M9CWbgyZ" x="314" y="139"><mutation
else="1"></mutation><value name="IF0"><block type="logic_compare"
id="2!Pk_UGZPwejfl:,SXqW"><field name="OP">EQ</field><value
name="A"><block type="oh_getitem_state" id="~$ty|i-/#pw~cd{a`acr"><value
name="itemName"><shadow type="oh_item"
id="q+x`vThw~SIkdrI8C@#}"><mutation itemName="AquarienTime"
itemLabel="AquarienTime"></mutation><field
name="itemName">AquarienTime</field></shadow></value></block></value><value
name="B"><block type="text" id="Qi+zNyR#xUV$S0mI$*7x"><field
name="TEXT">DAY</field></block></value></block></value><statement
name="DO0"><block type="oh_event" id="uKk1ZlA==^HS;+D(MyG?"><field
name="eventType">sendCommand</field><value name="value"><shadow
type="text" id="54XU35o-|t]VOj@0oRUf"><field
name="TEXT">ON</field></shadow></value><value name="itemName"><shadow
type="oh_item" id="WGzdOTmTmlv_RrEBn+Ui"><mutation itemName="AquaLights"
itemLabel="AquaLights"></mutation><field
name="itemName">AquaLights</field></shadow></value></block></statement><statement
name="ELSE"><block type="oh_event" id="#sk{K7-793`LbH6W|s:e"><field
name="eventType">sendCommand</field><value name="value"><shadow
type="text" id="QHF3m{j*`rLqy1Y=pu.I"><field
name="TEXT">OFF</field></shadow></value><value name="itemName"><shadow
type="oh_item" id="Z2pHbQn85wQxta6fG7Qt"><mutation itemName="AquaLights"
itemLabel="AquaLights"></mutation><field
name="itemName">AquaLights</field></shadow></value></block></statement></block></xml>
type: application/javascript
script: |
if (items.getItem('AquarienTime').state == 'DAY') {
items.getItem('AquaLights').sendCommand('ON');
} else {
items.getItem('AquaLights').sendCommand('OFF');
}
type: script.ScriptAction
configuration: {}
triggers:
- id: "1"
configuration:
thingUID: astro:sun:local
event: START
channelUID: astro:sun:local:rise#event
type: core.ChannelEventTrigger
- id: "2"
configuration:
thingUID: astro:sun:local
event: START
channelUID: astro:sun:local:set#event
type: core.ChannelEventTrigger
- id: "4"
configuration:
cronExpression: 0 0/55 * * * ? *
type: timer.GenericCronTrigger
conditions: []
actions:
- inputs: {}
id: "3"
configuration:
blockSource: <xml
xmlns="https://developers.google.com/blockly/xml"><variables><variable
id="ahcWmb?33vK44T3rEJnb">weekend</variable><variable
id="!WiKPFYO^,hhen_ef)AB">dayAqua</variable><variable
id="0@Yj|RJN]A[x{$f[TDEP">nightAqua</variable><variable
id="LC5fL$)/7wd[)qTcC}!l">premorning</variable><variable
id="A)H|1}[=EM_l)v$B975s">morning</variable><variable
id="q7mI9!s.5{Bt$7`Pi}n6">day</variable><variable
id="ucR5#`a*$i3Kn`L+y~WJ">prenight</variable><variable
id="6++x3!~GO6)sH)jhiX;_">night</variable></variables><block
type="variables_set" id="he(.v7`?FYL.CH@VwL+D" x="418" y="156"><field
name="VAR" id="ahcWmb?33vK44T3rEJnb">weekend</field><value
name="VALUE"><block type="oh_ephemeris_check"
id="(l+TLWgTtfXidiL{_L;;"><field name="checkType">weekend</field><value
name="dayInfo"><shadow type="oh_dayoffset_today"
id="QoTQGR%=J|O:21n]*{!w"></shadow></value></block></value><next><block
type="variables_set" id="%lf@=yE.C|F*fymF$Qj]"><field name="VAR"
id="!WiKPFYO^,hhen_ef)AB">dayAqua</field><value name="VALUE"><block
type="oh_zdt_amend" id="z?WDic%jF6HfOx!THKte"><mutation
items="3"></mutation><field name="operation">with</field><value
name="baseZdt"><shadow type="oh_zdt" id="SsP!J.U[H]DH(O:9t!=8"><field
name="day">2022-09-25</field></shadow><block type="oh_zdt_now"
id="qn(hxPI@U*g*6tfX3U1H"></block></value><value name="ADD0"><block
type="oh_zdt_temporal_unit" id="`/a}*.~MdZfvy48tu)6E"><mutation
blockType="3"></mutation><field
name="value">9</field></block></value><value name="ADD1"><block
type="oh_zdt_temporal_unit" id="4K]I+w;H/`%{MWn6uN|-"><mutation
blockType="4"></mutation><field
name="value">0</field></block></value><value name="ADD2"><block
type="oh_zdt_temporal_unit" id="vmzUh~ex02Kth*/}sVs|"><mutation
blockType="5"></mutation><field
name="value">0</field></block></value></block></value><next><block
type="variables_set" id="q?$dj$|e/IR!#u1jo;t("><field name="VAR"
id="0@Yj|RJN]A[x{$f[TDEP">nightAqua</field><value name="VALUE"><block
type="oh_zdt_amend" id="#I/v3]d:ik*inxu{*bd0"><mutation
items="3"></mutation><field name="operation">with</field><value
name="baseZdt"><shadow type="oh_zdt" id="xbR,*al]IG]tH^=!Zy]s"><field
name="day">2022-09-25</field></shadow><block type="oh_zdt_now"
id="lLfzVU,g(j+a3H96jRiz"></block></value><value name="ADD0"><block
type="oh_zdt_temporal_unit" id="d}?0_?qp1pOCd5o@g%1U"><mutation
blockType="3"></mutation><field
name="value">21</field></block></value><value name="ADD1"><block
type="oh_zdt_temporal_unit" id="=3[NA0vL?e(T74=*`R}@"><mutation
blockType="4"></mutation><field
name="value">0</field></block></value><value name="ADD2"><block
type="oh_zdt_temporal_unit" id="W3zO8EF4x:pJno/WOyq@"><mutation
blockType="5"></mutation><field
name="value">0</field></block></value></block></value><next><block
type="variables_set" id="(9.S8^@!D(0JHj7SrY~l"><field name="VAR"
id="LC5fL$)/7wd[)qTcC}!l">premorning</field><value name="VALUE"><block
type="oh_zdt_amend" id="gz7b}TCP0sh21DeQ`_j="><mutation
items="3"></mutation><field name="operation">with</field><value
name="baseZdt"><shadow type="oh_zdt" id=".9yfh(#9=bR0EZL?ssZ{"><field
name="day">2022-09-25</field></shadow><block type="oh_zdt_now"
id="9+[VnXkZK8,B,h3;*J)q"></block></value><value name="ADD0"><block
type="oh_zdt_temporal_unit" id="RnVzJy+}#8f?W.QLD4;V"><mutation
blockType="3"></mutation><field
name="value">5</field></block></value><value name="ADD1"><block
type="oh_zdt_temporal_unit" id="e^UcPU)YYqjrngh6-W]h"><mutation
blockType="4"></mutation><field
name="value">0</field></block></value><value name="ADD2"><block
type="oh_zdt_temporal_unit" id=";UTkO(*guB5-WCFNWTJ!"><mutation
blockType="5"></mutation><field
name="value">0</field></block></value></block></value><next><block
type="variables_set" id="MNg%r3C-r5t_r7JYe(I:"><field name="VAR"
id="A)H|1}[=EM_l)v$B975s">morning</field><value name="VALUE"><block
type="oh_zdt_amend" id="SS?pbJ@;0H#Ksc@+!snR"><mutation
items="3"></mutation><field name="operation">with</field><value
name="baseZdt"><shadow type="oh_zdt" id="B|kijg(v$8;][WUHyyT-"><field
name="day">2022-09-25</field></shadow><block type="oh_zdt_now"
id="QdweAp{+_p6)Y7x1m,{{"></block></value><value name="ADD0"><block
type="oh_zdt_temporal_unit" id="xwT]IteX`j){%83AQR5,"><mutation
blockType="3"></mutation><field
name="value">6</field></block></value><value name="ADD1"><block
type="oh_zdt_temporal_unit" id="-nRJ`%;Q@-V0YmPf#(GI"><mutation
blockType="4"></mutation><field
name="value">0</field></block></value><value name="ADD2"><block
type="oh_zdt_temporal_unit" id="}$XlodNbaT:aF/G-@hA6"><mutation
blockType="5"></mutation><field
name="value">0</field></block></value></block></value><next><block
type="variables_set" id="zl8`PXi@4?W:H:}V7_YU"><field name="VAR"
id="q7mI9!s.5{Bt$7`Pi}n6">day</field><value name="VALUE"><block
type="oh_zdt_amend" id="!+`UMWxQ_G?As}hxx0kL"><mutation
items="3"></mutation><field name="operation">with</field><value
name="baseZdt"><shadow type="oh_zdt" id="xkRJ7(k:p%@E3`h@|9hI"><field
name="day">2022-09-25</field></shadow><block type="oh_zdt_now"
id=":,O|^_-s8/(f(Jhx);9s"></block></value><value name="ADD0"><block
type="oh_zdt_temporal_unit" id="Wb?KF8FDGD?aWN[Rs%0A"><mutation
blockType="3"></mutation><field
name="value">8</field></block></value><value name="ADD1"><block
type="oh_zdt_temporal_unit" id="UWmQY3Jit`|l1Fh=j/(M"><mutation
blockType="4"></mutation><field
name="value">0</field></block></value><value name="ADD2"><block
type="oh_zdt_temporal_unit" id="a|2p8?~LXqV!:z#X)GaX"><mutation
blockType="5"></mutation><field
name="value">0</field></block></value></block></value><next><block
type="variables_set" id="-;RzL|Qn)95jSLcL+OjA"><field name="VAR"
id="ucR5#`a*$i3Kn`L+y~WJ">prenight</field><value name="VALUE"><block
type="oh_zdt_amend" id="2L8r933%!aJL9qo0liL+"><mutation
items="3"></mutation><field name="operation">with</field><value
name="baseZdt"><shadow type="oh_zdt" id="*7._TA[z%{.a6}h{MR$;"><field
name="day">2022-09-25</field></shadow><block type="oh_zdt_now"
id="!rS5?o^LuH9f?ZaQf^H1"></block></value><value name="ADD0"><block
type="oh_zdt_temporal_unit" id=",7u`l_xnEDUP!?oOTn/."><mutation
blockType="3"></mutation><field
name="value">20</field></block></value><value name="ADD1"><block
type="oh_zdt_temporal_unit" id="r[aSIVmj/=pATg~=fg(P"><mutation
blockType="4"></mutation><field
name="value">0</field></block></value><value name="ADD2"><block
type="oh_zdt_temporal_unit" id="Cw[^Raty1+Po@IMG(ZSZ"><mutation
blockType="5"></mutation><field
name="value">0</field></block></value></block></value><next><block
type="variables_set" id="qgAOSkw#j]D7:|#]?5)n"><field name="VAR"
id="6++x3!~GO6)sH)jhiX;_">night</field><value name="VALUE"><block
type="oh_zdt_amend" id="AprqB]B-imn-sD@y|I~4"><mutation
items="3"></mutation><field name="operation">with</field><value
name="baseZdt"><shadow type="oh_zdt" id="[~Xp!.71A-PQOQ$5c:q~"><field
name="day">2022-09-25</field></shadow><block type="oh_zdt_now"
id="i/@_tx$aQDo~#|qG#hlu"></block></value><value name="ADD0"><block
type="oh_zdt_temporal_unit" id="b1Hb:FzcS|AN0HE6[p6K"><mutation
blockType="3"></mutation><field
name="value">22</field></block></value><value name="ADD1"><block
type="oh_zdt_temporal_unit" id="HqpUvlIGmr*=#8E0_qSC"><mutation
blockType="4"></mutation><field
name="value">0</field></block></value><value name="ADD2"><block
type="oh_zdt_temporal_unit" id="g5H8Oqaqz3*-~Rr$p~80"><mutation
blockType="5"></mutation><field
name="value">0</field></block></value></block></value><next><block
type="controls_if" id="~!df)Sv9;Otr2?ZgKh{="><mutation
else="1"></mutation><value name="IF0"><block type="logic_compare"
id="vC3QVQn5jJzUt={o{8lu"><field name="OP">EQ</field><value
name="A"><block type="variables_get" id=";Ra]sv_[{*9P|}iIr,a]"><field
name="VAR"
id="ahcWmb?33vK44T3rEJnb">weekend</field></block></value><value
name="B"><block type="logic_boolean" id="RUh=(~Q(S!2;aOc.oPW#"><field
name="BOOL">TRUE</field></block></value></block></value><statement
name="DO0"><block type="oh_event" id="Su,Ng?CI)yn2FE9Q/pW,"><field
name="eventType">sendCommand</field><value name="value"><shadow
type="text" id="3{[XKcit?}^2YIMc@/IG"><field
name="TEXT">ON</field></shadow></value><value name="itemName"><shadow
type="oh_item" id="x*BXN;.mXGlf?F*L[H_m"><mutation
itemName="WeekendTime" itemLabel="WeekendTime"></mutation><field
name="itemName">WeekendTime</field></shadow></value></block></statement><statement
name="ELSE"><block type="oh_event" id="SJW}gsn)TWPqC0j=eJnC"><field
name="eventType">sendCommand</field><value name="value"><shadow
type="text" id="%.-#hku[q6JsknC3sui~"><field
name="TEXT">OFF</field></shadow></value><value name="itemName"><shadow
type="oh_item" id="tX_;%lwd,2!t4sbwd(s)"><mutation
itemName="WeekendTime" itemLabel="WeekendTime"></mutation><field
name="itemName">WeekendTime</field></shadow></value></block></statement><next><block
type="controls_if" id=";TWPG;azPGa(,0Zur2)R"><mutation
else="1"></mutation><value name="IF0"><block type="logic_operation"
id="~T6wkqbI}.I+8n,LAKp5"><field name="OP">AND</field><value
name="A"><block type="logic_compare" id="jEh()8)ee^A0nm;M]Y[B"><field
name="OP">GT</field><value name="A"><block type="oh_zdt_now"
id="(^kASSV~Y-[]?%;a,.zg"></block></value><value name="B"><block
type="oh_zdt_fromText" id="^g0l;2fv]aK~WG^Ln,Zj"><value
name="day"><shadow type="text" id="nYI?NgGS5sY%j|{f`+qa"><field
name="TEXT">2023-08-17</field></shadow><block type="oh_getitem_state"
id="GAzq^B%0A/Fo4PTz;mKc"><value name="itemName"><shadow type="oh_item"
id="valEc|0RuRWRSoG~F(sS"><mutation itemName="MyItem"
itemLabel="MyItem"></mutation><field
name="itemName">MyItem</field></shadow><block type="oh_item"
id="._CDW}l5exwzKiJu*=1e"><mutation itemName="SonnenaufgangStart"
itemLabel="SonnenaufgangStart"></mutation><field
name="itemName">SonnenaufgangStart</field></block></value></block></value></block></value></block></value><value
name="B"><block type="logic_compare" id="4XhGOY[_?5[@LMpfygNd"><field
name="OP">LT</field><value name="A"><block type="oh_zdt_now"
id="{@?F[y!yHyfkF65wR$yO"></block></value><value name="B"><block
type="oh_zdt_fromText" id="HY,rOtvG:7wKZHBE^Fpt"><value
name="day"><shadow type="text" id="L?|Ylj|Q3tp{W,@l)JqM"><field
name="TEXT">2023-08-17</field></shadow><block type="oh_getitem_state"
id="xDT[G!9$E3dxK%-B/EzW"><value name="itemName"><shadow type="oh_item"
id="gtmGh[7Q8m!ymOR9B~CA"><mutation itemName="MyItem"
itemLabel="MyItem"></mutation><field
name="itemName">MyItem</field></shadow><block type="oh_item"
id=".]Z0RGKJl8RE=#{dm.X/"><mutation itemName="SonnenuntergangStart"
itemLabel="SonnenuntergangStart"></mutation><field
name="itemName">SonnenuntergangStart</field></block></value></block></value></block></value></block></value></block></value><statement
name="DO0"><block type="oh_event" id="-BBSa/|;k;9^%V7GDhVE"><field
name="eventType">sendCommand</field><value name="value"><shadow
type="text" id="JD1+Hsy59|`APf~nsVFW"><field
name="TEXT">ON</field></shadow></value><value name="itemName"><shadow
type="oh_item" id="tJ`M)jg_6-wUg4[t:/V7"><mutation itemName="DayTime"
itemLabel="DayTime"></mutation><field
name="itemName">DayTime</field></shadow></value></block></statement><statement
name="ELSE"><block type="oh_event" id="gvSv`GPKd5j$lZ,IGytc"><field
name="eventType">sendCommand</field><value name="value"><shadow
type="text" id="*_p8A4}[L_$XCPv|C)}A"><field
name="TEXT">OFF</field></shadow></value><value name="itemName"><shadow
type="oh_item" id="S{*C+;.GY@op=45226|F"><mutation itemName="DayTime"
itemLabel="DayTime"></mutation><field
name="itemName">DayTime</field></shadow></value></block></statement><next><block
type="controls_if" id="etb;~xx/S`/KA]:A?{S%"><mutation
else="1"></mutation><value name="IF0"><block type="logic_operation"
id="^t1`]?Xi^}U#A9(jw=Oj"><field name="OP">AND</field><value
name="A"><block type="logic_compare" id="y/rYlI$,K}2P0aF^m#N|"><field
name="OP">GT</field><value name="A"><block type="oh_zdt_now"
id="{#yn~~H3C2(*M{E+`ain"></block></value><value name="B"><block
type="variables_get" id=":579jq#X)^`P{j#|:zO:"><field name="VAR"
id="!WiKPFYO^,hhen_ef)AB">dayAqua</field></block></value></block></value><value
name="B"><block type="logic_compare" id="masM5jnQ;gTWm^:g^;`C"><field
name="OP">LT</field><value name="A"><block type="oh_zdt_now"
id="~B73y])HOeEOp/B3CqMZ"></block></value><value name="B"><block
type="variables_get" id=".4)5)CR%RZOz5IU%x6N6"><field name="VAR"
id="0@Yj|RJN]A[x{$f[TDEP">nightAqua</field></block></value></block></value></block></value><statement
name="DO0"><block type="oh_event" id=",m;0iiLIz0#j$B$Cc~px"><field
name="eventType">sendCommand</field><value name="value"><shadow
type="text" id="a(w0hiQV]5~4ANg9({+m"><field
name="TEXT">DAY</field></shadow></value><value name="itemName"><shadow
type="oh_item" id="?@@[cgC1?XOn~*E)zA0/"><mutation
itemName="AquarienTime" itemLabel="AquarienTime"></mutation><field
name="itemName">AquarienTime</field></shadow></value></block></statement><statement
name="ELSE"><block type="oh_event" id="IMQ-z.v?|WwO_=EiqO[C"><field
name="eventType">sendCommand</field><value name="value"><shadow
type="text" id="Fj~:4]Zw@g,|=03uuMt("><field
name="TEXT">NIGHT</field></shadow></value><value name="itemName"><shadow
type="oh_item" id=")xp75:1I/]9q6Pj$d7n;"><mutation
itemName="AquarienTime" itemLabel="AquarienTime"></mutation><field
name="itemName">AquarienTime</field></shadow></value></block></statement><next><block
type="controls_if" id="w_uMQv0XuX9B[j;~vy;m"><value name="IF0"><block
type="logic_operation" id="rV1APvnV;P9)ldH3t|8o"><field
name="OP">AND</field><value name="A"><block type="logic_compare"
id="i~sytU=F98`0li]QGD/h"><field name="OP">GT</field><value
name="A"><block type="oh_zdt_now"
id="Lp}ZM*le-+GZ!$+d})a9"></block></value><value name="B"><block
type="variables_get" id="^36OCUQq@@p*g)X7iTht"><field name="VAR"
id="LC5fL$)/7wd[)qTcC}!l">premorning</field></block></value></block></value><value
name="B"><block type="logic_compare" id="Q{-0:yfw`v7%0PR),8@+"><field
name="OP">LT</field><value name="A"><block type="oh_zdt_now"
id="uY1$|Ya6d8fWx9Ik^Jn6"></block></value><value name="B"><block
type="variables_get" id="sdBdz*b%@K?id:?X+5hV"><field name="VAR"
id="A)H|1}[=EM_l)v$B975s">morning</field></block></value></block></value></block></value><statement
name="DO0"><block type="oh_event" id="M*qpk-E`nzh92y]K+6fE"><field
name="eventType">sendCommand</field><value name="value"><shadow
type="text" id="jM*MfRzb;0GEE:b}CjDQ"><field
name="TEXT">PREMORNING</field></shadow></value><value
name="itemName"><shadow type="oh_item"
id="~U+XzS],58,-~g+bT){+"><mutation itemName="TimeOfDay"
itemLabel="TimeOfDay"></mutation><field
name="itemName">TimeOfDay</field></shadow></value></block></statement><next><block
type="controls_if" id="/hn]B2kGYf{dwhrWg(I["><value name="IF0"><block
type="logic_operation" id="^B#.K-A2R0C8V-^u$7!G"><field
name="OP">AND</field><value name="A"><block type="logic_compare"
id="5`m0e`A=#5n5G%9dl/Yi"><field name="OP">GT</field><value
name="A"><block type="oh_zdt_now"
id="1|0Y=RR:WpVh5;oMNRLZ"></block></value><value name="B"><block
type="variables_get" id="$eFrx7mNK!-0UyTMm]ul"><field name="VAR"
id="A)H|1}[=EM_l)v$B975s">morning</field></block></value></block></value><value
name="B"><block type="logic_compare" id="GwPC(.C9mD:=Hgfr%9-r"><field
name="OP">LT</field><value name="A"><block type="oh_zdt_now"
id="pb8#eZcf;ziCk0HLg|s9"></block></value><value name="B"><block
type="variables_get" id="@c:[pz!!-apG2a@-wKG]"><field name="VAR"
id="q7mI9!s.5{Bt$7`Pi}n6">day</field></block></value></block></value></block></value><statement
name="DO0"><block type="oh_event" id="St7G3pm-bx{Um=L-lR64"><field
name="eventType">sendCommand</field><value name="value"><shadow
type="text" id="%d))B]LnwLj9Pls%2/(R"><field
name="TEXT">MORNING</field></shadow></value><value
name="itemName"><shadow type="oh_item"
id="7+CiQ5~6`6oX!M@OgL]-"><mutation itemName="TimeOfDay"
itemLabel="TimeOfDay"></mutation><field
name="itemName">TimeOfDay</field></shadow></value></block></statement><next><block
type="controls_if" id="Y:CUg1t5B`?RCy+R0g0d"><value name="IF0"><block
type="logic_operation" id="5GU6WV!)x;0c$T_E2[_l"><field
name="OP">AND</field><value name="A"><block type="logic_compare"
id="hM_)%vyF;o;[0~vi3n.m"><field name="OP">GT</field><value
name="A"><block type="oh_zdt_now"
id="Qrhdlf)$oy4DfS?++EPa"></block></value><value name="B"><block
type="variables_get" id="h/$-h0vX$l^n,3;sBSpw"><field name="VAR"
id="q7mI9!s.5{Bt$7`Pi}n6">day</field></block></value></block></value><value
name="B"><block type="logic_compare" id="K1brDcR$1d6=YG$c0ht6"><field
name="OP">LT</field><value name="A"><block type="oh_zdt_now"
id="F^cD^5Um8Lz!N4dI^yTB"></block></value><value name="B"><block
type="variables_get" id="?EySoBNTuB5r:@xps6kl"><field name="VAR"
id="ucR5#`a*$i3Kn`L+y~WJ">prenight</field></block></value></block></value></block></value><statement
name="DO0"><block type="oh_event" id="QCmdh^F:7`iLe30RrI!#"><field
name="eventType">sendCommand</field><value name="value"><shadow
type="text" id="i?Dp$D`ZN73Q5}zH|T/,"><field
name="TEXT">DAY</field></shadow></value><value name="itemName"><shadow
type="oh_item" id="a{8Y..Eo1{,wVL@_6+E9"><mutation itemName="TimeOfDay"
itemLabel="TimeOfDay"></mutation><field
name="itemName">TimeOfDay</field></shadow></value></block></statement><next><block
type="controls_if" id="peCpZD+xZ_K]Ni7m`!~5"><value name="IF0"><block
type="logic_operation" id="@nEFuMF/tW@p]?=./GWS"><field
name="OP">AND</field><value name="A"><block type="logic_compare"
id="#o?2YY-#[WkH@fT8d(QK"><field name="OP">GT</field><value
name="A"><block type="oh_zdt_now"
id="v*9ILp#G$Lpgc;[Ssk[V"></block></value><value name="B"><block
type="variables_get" id="ZvxL;8qABM~Kn/t1L3v9"><field name="VAR"
id="ucR5#`a*$i3Kn`L+y~WJ">prenight</field></block></value></block></value><value
name="B"><block type="logic_compare" id="jK{UkVO/H4C::s@]^(z6"><field
name="OP">LT</field><value name="A"><block type="oh_zdt_now"
id="zij^(jL+%%5bcGg@oU^U"></block></value><value name="B"><block
type="variables_get" id="G|8zC9nb)L}A9[;(K.^^"><field name="VAR"
id="6++x3!~GO6)sH)jhiX;_">night</field></block></value></block></value></block></value><statement
name="DO0"><block type="oh_event" id="raECR0DLl2UI*^(E#f+#"><field
name="eventType">sendCommand</field><value name="value"><shadow
type="text" id="l@^jUIZ@MOVLJZe4,w0{"><field
name="TEXT">PRENIGHT</field></shadow></value><value
name="itemName"><shadow type="oh_item"
id="(5OH[hsz}]_`E:byWO)t"><mutation itemName="TimeOfDay"
itemLabel="TimeOfDay"></mutation><field
name="itemName">TimeOfDay</field></shadow></value></block></statement><next><block
type="controls_if" id="B)mSl#]R;(ORHbJbs|`9"><value name="IF0"><block
type="logic_operation" id="rFA./:VTkq^3F3okoZhO"><field
name="OP">OR</field><value name="A"><block type="logic_compare"
id="EA,{H:wy5lN)_|ncE|0m"><field name="OP">GT</field><value
name="A"><block type="oh_zdt_now"
id="N,ExRy?K:e7Hzl)3vE1v"></block></value><value name="B"><block
type="variables_get" id="t/qsFnq.l%HzjVU(MJgA"><field name="VAR"
id="6++x3!~GO6)sH)jhiX;_">night</field></block></value></block></value><value
name="B"><block type="logic_compare" id=",.M4rG?gX?_,FwV26I*y"><field
name="OP">LT</field><value name="A"><block type="oh_zdt_now"
id="t_e#`6R{Cg64N9xoK,y["></block></value><value name="B"><block
type="variables_get" id="408fSxn?e+c!m%n)}L:F"><field name="VAR"
id="LC5fL$)/7wd[)qTcC}!l">premorning</field></block></value></block></value></block></value><statement
name="DO0"><block type="oh_event" id="P?ELH5k6E#y9q{p^0eyO"><field
name="eventType">sendCommand</field><value name="value"><shadow
type="text" id="}mmYPi_)Rs9n#;Arw#]@"><field
name="TEXT">NIGHT</field></shadow></value><value name="itemName"><shadow
type="oh_item" id="9*AW*WNo_Ruy6;2|8Y;="><mutation itemName="TimeOfDay"
itemLabel="TimeOfDay"></mutation><field
name="itemName">TimeOfDay</field></shadow></value></block></statement></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></xml>
type: application/javascript
script: >
var weekend, dayAqua, nightAqua, premorning, morning, day, prenight,
night;
weekend = actions.Ephemeris.isWeekend(0);
dayAqua = (time.ZonedDateTime.now()).withHour(9).withMinute(0).withSecond(0);
nightAqua = (time.ZonedDateTime.now()).withHour(21).withMinute(0).withSecond(0);
premorning = (time.ZonedDateTime.now()).withHour(5).withMinute(0).withSecond(0);
morning = (time.ZonedDateTime.now()).withHour(6).withMinute(0).withSecond(0);
day = (time.ZonedDateTime.now()).withHour(8).withMinute(0).withSecond(0);
prenight = (time.ZonedDateTime.now()).withHour(20).withMinute(0).withSecond(0);
night = (time.ZonedDateTime.now()).withHour(22).withMinute(0).withSecond(0);
if (weekend == true) {
items.getItem('WeekendTime').sendCommand('ON');
} else {
items.getItem('WeekendTime').sendCommand('OFF');
}
if ((time.ZonedDateTime.now()) > (time.toZDT(items.getItem('SonnenaufgangStart').state)) && (time.ZonedDateTime.now()) < (time.toZDT(items.getItem('SonnenuntergangStart').state))) {
items.getItem('DayTime').sendCommand('ON');
} else {
items.getItem('DayTime').sendCommand('OFF');
}
if ((time.ZonedDateTime.now()) > dayAqua && (time.ZonedDateTime.now()) < nightAqua) {
items.getItem('AquarienTime').sendCommand('DAY');
} else {
items.getItem('AquarienTime').sendCommand('NIGHT');
}
if ((time.ZonedDateTime.now()) > premorning && (time.ZonedDateTime.now()) < morning) {
items.getItem('TimeOfDay').sendCommand('PREMORNING');
}
if ((time.ZonedDateTime.now()) > morning && (time.ZonedDateTime.now()) < day) {
items.getItem('TimeOfDay').sendCommand('MORNING');
}
if ((time.ZonedDateTime.now()) > day && (time.ZonedDateTime.now()) < prenight) {
items.getItem('TimeOfDay').sendCommand('DAY');
}
if ((time.ZonedDateTime.now()) > prenight && (time.ZonedDateTime.now()) < night) {
items.getItem('TimeOfDay').sendCommand('PRENIGHT');
}
if ((time.ZonedDateTime.now()) > night || (time.ZonedDateTime.now()) < premorning) {
items.getItem('TimeOfDay').sendCommand('NIGHT');
}
type: script.ScriptAction
Another fakt, if i change something in WHEN part, RAM increase also.
Thanks.