Hi @phjr99 ,
you might also try
configuration: {}
triggers:
- id: "2"
configuration:
cronExpression: 0 * * * * ? *
type: timer.GenericCronTrigger
conditions: []
actions:
- inputs: {}
id: "1"
configuration:
blockSource: <xml
xmlns="https://developers.google.com/blockly/xml"><variables><variable
id="V05[fkbH(c#/1ZlMIqBg">commandscript</variable><variable
id=".G~kif+tZ09MK`0fZjEj">DeviceIDName</variable><variable
id="u?,MpklY8J),ODnLKwQX">commandForConsole</variable><variable
id="i`|XL,8A10e*=daT)ue|">ZigAddy</variable><variable
id=";u$Y0ajQSlejJNC~-*Qn">RetArr</variable></variables><block
type="variables_set" id="iYDc}R=_BbP%OqJ)*]C3" x="397" y="134"><field
name="VAR" id="V05[fkbH(c#/1ZlMIqBg">commandscript</field><value
name="VALUE"><block type="text" id="kql%I9HpZm)09HcT:HC4"><field
name="TEXT"></field></block></value><next><block type="controls_forEach"
id="(/d9,:T/mjNS={A``1.B"><field name="VAR"
id="i`|XL,8A10e*=daT)ue|">ZigAddy</field><value name="LIST"><block
type="procedures_callreturn" id="WJ=EelY`!(OnkT/j;4m["><mutation
name="ZigbeeNetworkAderesses"><arg
name="DeviceIDName"></arg></mutation><value name="ARG0"><block
type="text" id="2xxM=A,zD4{(#,:mH{ps"><field
name="TEXT">TS011F</field></block></value></block></value><statement
name="DO"><block type="variables_set" id="BXCTSJi^~M#~.Ry6]sD]"><field
name="VAR" id="V05[fkbH(c#/1ZlMIqBg">commandscript</field><value
name="VALUE"><block type="text_join" id="~.tvIt1/aU2JNZ{^hk2h"><mutation
items="5"></mutation><value name="ADD0"><block type="variables_get"
id="MAg87u,KK^=PS{7rk]Bv"><field name="VAR"
id="V05[fkbH(c#/1ZlMIqBg">commandscript</field></block></value><value
name="ADD1"><block type="text" id="el7W54z+ymS{*4H)#ca/"><field
name="TEXT">zigbee read </field></block></value><value
name="ADD2"><block type="variables_get" id="PW9$%+qbB4!TTyopuw83"><field
name="VAR"
id="i`|XL,8A10e*=daT)ue|">ZigAddy</field></block></value><value
name="ADD3"><block type="text" id="X!9^E7E$k34f/hT-8mi!"><field
name="TEXT">/1 0x0B04 1291</field></block></value><value
name="ADD4"><block type="oh_text_crlf"
id="[u2%@sscSk*URO+USNZU"></block></value></block></value><next><block
type="variables_set" id="T4J7-BcPaY8nXN6=@g1!"><field name="VAR"
id="V05[fkbH(c#/1ZlMIqBg">commandscript</field><value
name="VALUE"><block type="text_join" id="?yJmYw4zJ!}0A$}/=^Yy"><mutation
items="3"></mutation><value name="ADD0"><block type="variables_get"
id="h.7hZ,/8([*Nj5jMrtkD"><field name="VAR"
id="V05[fkbH(c#/1ZlMIqBg">commandscript</field></block></value><value
name="ADD1"><block type="text" id="Sh(~Z`ev^?2~%[ca/uGK"><field
name="TEXT">sleep 1</field></block></value><value name="ADD2"><block
type="oh_text_crlf"
id="^}+G8GS_iU}jH.Fj|HEE"></block></value></block></value><next><block
type="variables_set" id=",=T/1)~CeM{(Y84.Q9bN"><field name="VAR"
id="V05[fkbH(c#/1ZlMIqBg">commandscript</field><value
name="VALUE"><block type="text_join" id="I:^LG:i:[uz1I,2r6JJ*"><mutation
items="5"></mutation><value name="ADD0"><block type="variables_get"
id="U([RyKc6nQ;,D_EK6m]~"><field name="VAR"
id="V05[fkbH(c#/1ZlMIqBg">commandscript</field></block></value><value
name="ADD1"><block type="text" id="HBf5s*4{rD`EK{=5;g|_"><field
name="TEXT">zigbee read </field></block></value><value
name="ADD2"><block type="variables_get" id="FrGb4b;``0h)/{RgcS0O"><field
name="VAR"
id="i`|XL,8A10e*=daT)ue|">ZigAddy</field></block></value><value
name="ADD3"><block type="text" id="jikuGS8Blo{G-|Cew=a}"><field
name="TEXT">/1 0x0702 0</field></block></value><value name="ADD4"><block
type="oh_text_crlf"
id="![~P`NchYQ+8${_HHhuQ"></block></value></block></value><next><block
type="variables_set" id="oI,c:1H43Pb_xfrqE.;="><field name="VAR"
id="V05[fkbH(c#/1ZlMIqBg">commandscript</field><value
name="VALUE"><block type="text_join" id="ru|yOMOD,`(w$pXgsR.}"><mutation
items="3"></mutation><value name="ADD0"><block type="variables_get"
id="AX`F)*tI9dCwNU/P5D{:"><field name="VAR"
id="V05[fkbH(c#/1ZlMIqBg">commandscript</field></block></value><value
name="ADD1"><block type="text" id="WW#xDFxq_XOqFZgC@-ip"><field
name="TEXT">sleep 1</field></block></value><value name="ADD2"><block
type="oh_text_crlf"
id="Tf5@FAAj}Fe.YNDT`JxG"></block></value></block></value></block></next></block></next></block></next></block></statement><next><block
type="procedures_callnoreturn" id="3e0:,Uu}l[iqL}V|.vO_"><mutation
name="sendConsole"><arg name="commandForConsole"></arg></mutation><value
name="ARG0"><block type="variables_get" id="Y*+|V4ryv_Y}W+Q.pMwE"><field
name="VAR"
id="V05[fkbH(c#/1ZlMIqBg">commandscript</field></block></value><next><block
type="oh_log" id="Z[s8stwQ6ru^@-40:Z7q" disabled="true"><field
name="severity">info</field><value name="message"><shadow type="text"
id="^@@)1v},7:[ned0tP]7$"><field
name="TEXT">ende</field></shadow></value></block></next></block></next></block></next></block><block
type="procedures_defreturn" id="iAOc2(mmg~UEzf1/sR@M" x="389"
y="809"><mutation><arg name="DeviceIDName"
varid=".G~kif+tZ09MK`0fZjEj"></arg></mutation><field
name="NAME">ZigbeeNetworkAderesses</field><comment pinned="false" h="80"
w="160">Describe this function...</comment><statement
name="STACK"><block type="variables_set"
id="?KE5eun]go9[LSE]vS~v"><field name="VAR"
id=";u$Y0ajQSlejJNC~-*Qn">RetArr</field><value name="VALUE"><block
type="lists_create_with" id="U`WBlP%ruM1)d/nc6PV7"><mutation
items="0"></mutation></block></value><next><block
type="oh_script_inline" id="iEtBv*IwJ(.#e:hUr-22"><field
name="inlineScript">for each (var thing in
things.getAll())&#10;{&#10; if
(thing.UID.toString().split(":")[0] ==
"zigbee")&#10; {&#10; if (thing.properties.get("modelId") ==
DeviceIDName)&#10; {&#10; RetArr.push(thing.properties.get("zigbee_networkaddress"));&#10; }&#10; } &#10;}</field></block></next></block></statement><value
name="RETURN"><block type="variables_get"
id="RklJ}O.7Q|4Ngr6dW|]$"><field name="VAR"
id=";u$Y0ajQSlejJNC~-*Qn">RetArr</field></block></value></block><block
type="procedures_defnoreturn" id="LDsJYDUGFJA2KUke?@B:" x="392"
y="1178"><mutation><arg name="commandForConsole"
varid="u?,MpklY8J),ODnLKwQX"></arg></mutation><field
name="NAME">sendConsole</field><comment pinned="false" h="80"
w="160">Describe this function...</comment><statement
name="STACK"><block type="oh_log" id="+yQv]uG2P;dNN!rBnSXv"
disabled="true"><field name="severity">info</field><value
name="message"><shadow type="text" id="MkMV}F2d56)qZAFV-w9K"><field
name="TEXT">(commandForConsole</field></shadow><block
type="variables_get" id="q%+G,6?]%u.M=^)b$BHt"><field name="VAR"
id="u?,MpklY8J),ODnLKwQX">commandForConsole</field></block></value><next><block
type="oh_script_inline" id="N,z}TgOy:I,1lsaEPW0t"><field
name="inlineScript">var Exec =
Java.type('org.openhab.core.model.script.actions.Exec');&#10;return
results = Exec.executeCommandLine("/openhab/runtime/bin/client", "-p" ,
"habopen" ,
commandForConsole);</field></block></next></block></statement></block></xml>
type: application/javascript
script: >
var commandscript, DeviceIDName, commandForConsole, ZigAddy, RetArr;
// Describe this function...
function ZigbeeNetworkAderesses(DeviceIDName) {
RetArr = [];
for each (var thing in things.getAll())
{
if (thing.UID.toString().split(":")[0] == "zigbee")
{
if (thing.properties.get("modelId") == DeviceIDName)
{
RetArr.push(thing.properties.get("zigbee_networkaddress"));
}
}
}
return RetArr;
}
// Describe this function...
function sendConsole(commandForConsole) {
var Exec = Java.type('org.openhab.core.model.script.actions.Exec');
return results = Exec.executeCommandLine("/openhab/runtime/bin/client", "-p" , "habopen" , commandForConsole);
}
commandscript = '';
var ZigAddy_list = ZigbeeNetworkAderesses('TS011F');
for (var ZigAddy_index in ZigAddy_list) {
ZigAddy = ZigAddy_list[ZigAddy_index];
commandscript = [commandscript,'zigbee read ',ZigAddy,'/1 0x0B04 1291','\r\n'].join('');
commandscript = [commandscript,'sleep 1','\r\n'].join('');
commandscript = [commandscript,'zigbee read ',ZigAddy,'/1 0x0702 0','\r\n'].join('');
commandscript = [commandscript,'sleep 1','\r\n'].join('');
}
sendConsole(commandscript);
type: script.ScriptAction