- ioBroker Community Home
- Deutsch
- Skripten / Logik
- Blockly
- kleines [HowTo] um installierte Adapter auszulesen
NEWS
kleines [HowTo] um installierte Adapter auszulesen
-
Tag,
dank der Hilfe von @paul53 habe ich mein heutiges Projekt um installierte Adapter auszulesen erfolgreich abgeschlossen und möchte mein Blockly gerne teilen - für Interessenten ;)
Anzeigen lasse ich mir das in VIS in einer JSON-Tabelle.
Was wird benötigt ?
Ein einziger DP im JSON-Format - und natürlich das Blockly, welches über Attribute und Variablen super erweiterbar ist.
In meinem Beispiel habe ich nur die Namen, Versionen und Icons der Instanzen eingepflegt :

<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="hjs+eE77tk-5^qay0g/w">id</variable> <variable id="rCtm]jE2W!moedi|=W3.">adapter</variable> <variable id="(*::2jCq%uiY8L|{OGi`">alleAdapter</variable> <variable id=";`(f=8YI46baTkysEaUD">i</variable> <variable id="V^158!|1pdw{kBn@~Z6Q">res</variable> <variable id="xjsL)$Y^,6%B?goB_(J#">name</variable> <variable id="v,aT(v#A~i@`*eE*VJ^#">version</variable> <variable id="|}%^RFe]0V*ksK*E$TYo">icon</variable> <variable id="lnzSp^hiM|m[#_^nBr0m">json</variable> </variables> <block type="schedule" id="-P5Yzp35YkWe(LwiQ?aP" x="263" y="-287"> <field name="SCHEDULE">* * * * *</field> <statement name="STATEMENT"> <block type="variables_set" id="`*(pC@X8;`HgeD=m?5uc"> <field name="VAR" id="rCtm]jE2W!moedi|=W3.">adapter</field> <value name="VALUE"> <block type="selector" id="ehr.{zS4T8j19JCBtE5|"> <field name="TEXT">system.adapter.*.0.alive</field> </block> </value> <next> <block type="variables_set" id="$J/5`9]QBDd_0==y:=14"> <field name="VAR" id="(*::2jCq%uiY8L|{OGi`">alleAdapter</field> <value name="VALUE"> <block type="lists_create_with" id="/0WJjRH]=?i(%l_omK(s"> <mutation items="0"></mutation> </block> </value> <next> <block type="controls_forEach" id="]cHJJO%t:gh?WhlAY*{+"> <field name="VAR" id=";`(f=8YI46baTkysEaUD">i</field> <value name="LIST"> <block type="variables_get" id="0gHdBQY=bpv{dl#tyCls"> <field name="VAR" id="rCtm]jE2W!moedi|=W3.">adapter</field> </block> </value> <statement name="DO"> <block type="variables_set" id="lsv)2Y0nmD3InwFJ}T:V"> <field name="VAR" id="V^158!|1pdw{kBn@~Z6Q">res</field> <value name="VALUE"> <block type="procedures_callcustomreturn" id="Fu0^A]JA+mks{w,|0F8n"> <mutation name="adapternamen"> <arg name="id"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="jIiHr%p6tnW~+)[6,WKH"> <field name="VAR" id=";`(f=8YI46baTkysEaUD">i</field> </block> </value> </block> </value> <next> <block type="variables_set" id="pAfwm?l/SE3f5AF]Y1I7"> <field name="VAR" id="xjsL)$Y^,6%B?goB_(J#">name</field> <value name="VALUE"> <block type="get_attr" id="+h0g|5gUr|}JpT!zX|]2"> <value name="PATH"> <shadow type="text" id="v,4Q!=~Djhiq!92/V-W="> <field name="TEXT">common.name</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="(VOz$T,)5.[x+6Dt`i5s"> <field name="VAR" id="V^158!|1pdw{kBn@~Z6Q">res</field> </block> </value> </block> </value> <next> <block type="variables_set" id="$B`J;8[l!#(!+A`T8K8="> <field name="VAR" id="v,aT(v#A~i@`*eE*VJ^#">version</field> <value name="VALUE"> <block type="get_attr" id="Rr6L*J_rS]*0%lE~@+Q|"> <value name="PATH"> <shadow type="text" id="s/axJ?m].8{t?BRO2LZd"> <field name="TEXT">common.version</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="7U%T*cGdr`?#n9rC1-B#"> <field name="VAR" id="V^158!|1pdw{kBn@~Z6Q">res</field> </block> </value> </block> </value> <next> <block type="variables_set" id="!SwrPwH?$0AKVd;J!}gB"> <field name="VAR" id="|}%^RFe]0V*ksK*E$TYo">icon</field> <value name="VALUE"> <block type="get_attr" id="[Nq;tHd(n=U*OJ4V%5|I"> <value name="PATH"> <shadow type="text" id="SdCcW}0v`DeOs/0PV(XW"> <field name="TEXT">common.extIcon</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="tzLRE7V[54VXTNR^[uYi"> <field name="VAR" id="V^158!|1pdw{kBn@~Z6Q">res</field> </block> </value> </block> </value> <next> <block type="variables_set" id="}zQQw1ov/4s;G-*17jv~"> <field name="VAR" id="lnzSp^hiM|m[#_^nBr0m">json</field> <value name="VALUE"> <block type="text_join" id="Zr$NX1h96-eV,??$;#*("> <mutation items="7"></mutation> <value name="ADD0"> <block type="text" id="gJ!vMuYwB$P%o3CW9r/@"> <field name="TEXT">{"name":"</field> </block> </value> <value name="ADD1"> <block type="variables_get" id="SVk`+oWd!mLx7uNpM^%{"> <field name="VAR" id="xjsL)$Y^,6%B?goB_(J#">name</field> </block> </value> <value name="ADD2"> <block type="text" id="i,GJMCC`Z0KTpB/JVOuU"> <field name="TEXT">","version":"</field> </block> </value> <value name="ADD3"> <block type="variables_get" id="zl5`09I8K+tV-.O#;/e)"> <field name="VAR" id="v,aT(v#A~i@`*eE*VJ^#">version</field> </block> </value> <value name="ADD4"> <block type="text" id="!j=/8D;rU2/|r}rL;^zB"> <field name="TEXT">","icon":"</field> </block> </value> <value name="ADD5"> <block type="variables_get" id="v(Z)9*1sdbL_q`wKKe6C"> <field name="VAR" id="|}%^RFe]0V*ksK*E$TYo">icon</field> </block> </value> <value name="ADD6"> <block type="text" id="7,Bh,V9jk6F0WY2.jN(n"> <field name="TEXT">"}</field> </block> </value> </block> </value> <next> <block type="lists_setIndex" id="I7T.$UjAgA)f.%84Cuq."> <mutation at="false"></mutation> <field name="MODE">INSERT</field> <field name="WHERE">LAST</field> <value name="LIST"> <block type="variables_get" id="-HQgIG#=;r6i5SAIDQM*"> <field name="VAR" id="(*::2jCq%uiY8L|{OGi`">alleAdapter</field> </block> </value> <value name="TO"> <block type="variables_get" id="?NM:4LV}+a`EMqCV~Sk="> <field name="VAR" id="lnzSp^hiM|m[#_^nBr0m">json</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> <next> <block type="update" id="bCc7dxA#6i={R,LU#5a$"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.System.Abfragen.AdapterInstalliert</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text_join" id="0q5O~r6A)dE=.+`SsoL2"> <mutation items="3"></mutation> <value name="ADD0"> <block type="text" id="46(nbN^w4u11N?ZkS,:["> <field name="TEXT">[</field> </block> </value> <value name="ADD1"> <block type="variables_get" id="9mLPKx,yPzLl}P.EfzBQ"> <field name="VAR" id="(*::2jCq%uiY8L|{OGi`">alleAdapter</field> </block> </value> <value name="ADD2"> <block type="text" id="%,Cs)xk)srkjWHD(NN[A"> <field name="TEXT">]</field> </block> </value> </block> </value> </block> </next> </block> </next> </block> </next> </block> </statement> </block> <block type="procedures_defcustomreturn" id="FZsuHEl)0-SimtQ1_%*e" x="363" y="-287"> <mutation statements="false"> <arg name="id" varid="hjs+eE77tk-5^qay0g/w"></arg> </mutation> <field name="NAME">adapternamen</field> <field name="SCRIPT">aWQgPSBpZC5zdWJzdHJpbmcoMCwgaWQubGFzdEluZGV4T2YoJy4nKSk7DQppZCA9IGlkLnN1YnN0cmluZygwLCBpZC5sYXN0SW5kZXhPZignLicpKTsNCmlmKGV4aXN0c09iamVjdChpZCkpIHJldHVybiBnZXRPYmplY3QoaWQpOw0K</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> </block> </xml>Anzupassen ist eigentlich nur der eigene DP (wie geschrieben im JSON-Format)
Bei mir sieht das dann in VIS so aus:

Greets
Lehrling seit 1975 !!!
Beitrag geholfen ? dann gerne ein upvote rechts unten im Beitrag klicken ;)
https://forum.iobroker.net/topic/51555/hinweise-f%C3%BCr-gute-forenbeitr%C3%A4ge -
Tag,
dank der Hilfe von @paul53 habe ich mein heutiges Projekt um installierte Adapter auszulesen erfolgreich abgeschlossen und möchte mein Blockly gerne teilen - für Interessenten ;)
Anzeigen lasse ich mir das in VIS in einer JSON-Tabelle.
Was wird benötigt ?
Ein einziger DP im JSON-Format - und natürlich das Blockly, welches über Attribute und Variablen super erweiterbar ist.
In meinem Beispiel habe ich nur die Namen, Versionen und Icons der Instanzen eingepflegt :

<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="hjs+eE77tk-5^qay0g/w">id</variable> <variable id="rCtm]jE2W!moedi|=W3.">adapter</variable> <variable id="(*::2jCq%uiY8L|{OGi`">alleAdapter</variable> <variable id=";`(f=8YI46baTkysEaUD">i</variable> <variable id="V^158!|1pdw{kBn@~Z6Q">res</variable> <variable id="xjsL)$Y^,6%B?goB_(J#">name</variable> <variable id="v,aT(v#A~i@`*eE*VJ^#">version</variable> <variable id="|}%^RFe]0V*ksK*E$TYo">icon</variable> <variable id="lnzSp^hiM|m[#_^nBr0m">json</variable> </variables> <block type="schedule" id="-P5Yzp35YkWe(LwiQ?aP" x="263" y="-287"> <field name="SCHEDULE">* * * * *</field> <statement name="STATEMENT"> <block type="variables_set" id="`*(pC@X8;`HgeD=m?5uc"> <field name="VAR" id="rCtm]jE2W!moedi|=W3.">adapter</field> <value name="VALUE"> <block type="selector" id="ehr.{zS4T8j19JCBtE5|"> <field name="TEXT">system.adapter.*.0.alive</field> </block> </value> <next> <block type="variables_set" id="$J/5`9]QBDd_0==y:=14"> <field name="VAR" id="(*::2jCq%uiY8L|{OGi`">alleAdapter</field> <value name="VALUE"> <block type="lists_create_with" id="/0WJjRH]=?i(%l_omK(s"> <mutation items="0"></mutation> </block> </value> <next> <block type="controls_forEach" id="]cHJJO%t:gh?WhlAY*{+"> <field name="VAR" id=";`(f=8YI46baTkysEaUD">i</field> <value name="LIST"> <block type="variables_get" id="0gHdBQY=bpv{dl#tyCls"> <field name="VAR" id="rCtm]jE2W!moedi|=W3.">adapter</field> </block> </value> <statement name="DO"> <block type="variables_set" id="lsv)2Y0nmD3InwFJ}T:V"> <field name="VAR" id="V^158!|1pdw{kBn@~Z6Q">res</field> <value name="VALUE"> <block type="procedures_callcustomreturn" id="Fu0^A]JA+mks{w,|0F8n"> <mutation name="adapternamen"> <arg name="id"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="jIiHr%p6tnW~+)[6,WKH"> <field name="VAR" id=";`(f=8YI46baTkysEaUD">i</field> </block> </value> </block> </value> <next> <block type="variables_set" id="pAfwm?l/SE3f5AF]Y1I7"> <field name="VAR" id="xjsL)$Y^,6%B?goB_(J#">name</field> <value name="VALUE"> <block type="get_attr" id="+h0g|5gUr|}JpT!zX|]2"> <value name="PATH"> <shadow type="text" id="v,4Q!=~Djhiq!92/V-W="> <field name="TEXT">common.name</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="(VOz$T,)5.[x+6Dt`i5s"> <field name="VAR" id="V^158!|1pdw{kBn@~Z6Q">res</field> </block> </value> </block> </value> <next> <block type="variables_set" id="$B`J;8[l!#(!+A`T8K8="> <field name="VAR" id="v,aT(v#A~i@`*eE*VJ^#">version</field> <value name="VALUE"> <block type="get_attr" id="Rr6L*J_rS]*0%lE~@+Q|"> <value name="PATH"> <shadow type="text" id="s/axJ?m].8{t?BRO2LZd"> <field name="TEXT">common.version</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="7U%T*cGdr`?#n9rC1-B#"> <field name="VAR" id="V^158!|1pdw{kBn@~Z6Q">res</field> </block> </value> </block> </value> <next> <block type="variables_set" id="!SwrPwH?$0AKVd;J!}gB"> <field name="VAR" id="|}%^RFe]0V*ksK*E$TYo">icon</field> <value name="VALUE"> <block type="get_attr" id="[Nq;tHd(n=U*OJ4V%5|I"> <value name="PATH"> <shadow type="text" id="SdCcW}0v`DeOs/0PV(XW"> <field name="TEXT">common.extIcon</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="tzLRE7V[54VXTNR^[uYi"> <field name="VAR" id="V^158!|1pdw{kBn@~Z6Q">res</field> </block> </value> </block> </value> <next> <block type="variables_set" id="}zQQw1ov/4s;G-*17jv~"> <field name="VAR" id="lnzSp^hiM|m[#_^nBr0m">json</field> <value name="VALUE"> <block type="text_join" id="Zr$NX1h96-eV,??$;#*("> <mutation items="7"></mutation> <value name="ADD0"> <block type="text" id="gJ!vMuYwB$P%o3CW9r/@"> <field name="TEXT">{"name":"</field> </block> </value> <value name="ADD1"> <block type="variables_get" id="SVk`+oWd!mLx7uNpM^%{"> <field name="VAR" id="xjsL)$Y^,6%B?goB_(J#">name</field> </block> </value> <value name="ADD2"> <block type="text" id="i,GJMCC`Z0KTpB/JVOuU"> <field name="TEXT">","version":"</field> </block> </value> <value name="ADD3"> <block type="variables_get" id="zl5`09I8K+tV-.O#;/e)"> <field name="VAR" id="v,aT(v#A~i@`*eE*VJ^#">version</field> </block> </value> <value name="ADD4"> <block type="text" id="!j=/8D;rU2/|r}rL;^zB"> <field name="TEXT">","icon":"</field> </block> </value> <value name="ADD5"> <block type="variables_get" id="v(Z)9*1sdbL_q`wKKe6C"> <field name="VAR" id="|}%^RFe]0V*ksK*E$TYo">icon</field> </block> </value> <value name="ADD6"> <block type="text" id="7,Bh,V9jk6F0WY2.jN(n"> <field name="TEXT">"}</field> </block> </value> </block> </value> <next> <block type="lists_setIndex" id="I7T.$UjAgA)f.%84Cuq."> <mutation at="false"></mutation> <field name="MODE">INSERT</field> <field name="WHERE">LAST</field> <value name="LIST"> <block type="variables_get" id="-HQgIG#=;r6i5SAIDQM*"> <field name="VAR" id="(*::2jCq%uiY8L|{OGi`">alleAdapter</field> </block> </value> <value name="TO"> <block type="variables_get" id="?NM:4LV}+a`EMqCV~Sk="> <field name="VAR" id="lnzSp^hiM|m[#_^nBr0m">json</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> <next> <block type="update" id="bCc7dxA#6i={R,LU#5a$"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.System.Abfragen.AdapterInstalliert</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text_join" id="0q5O~r6A)dE=.+`SsoL2"> <mutation items="3"></mutation> <value name="ADD0"> <block type="text" id="46(nbN^w4u11N?ZkS,:["> <field name="TEXT">[</field> </block> </value> <value name="ADD1"> <block type="variables_get" id="9mLPKx,yPzLl}P.EfzBQ"> <field name="VAR" id="(*::2jCq%uiY8L|{OGi`">alleAdapter</field> </block> </value> <value name="ADD2"> <block type="text" id="%,Cs)xk)srkjWHD(NN[A"> <field name="TEXT">]</field> </block> </value> </block> </value> </block> </next> </block> </next> </block> </next> </block> </statement> </block> <block type="procedures_defcustomreturn" id="FZsuHEl)0-SimtQ1_%*e" x="363" y="-287"> <mutation statements="false"> <arg name="id" varid="hjs+eE77tk-5^qay0g/w"></arg> </mutation> <field name="NAME">adapternamen</field> <field name="SCRIPT">aWQgPSBpZC5zdWJzdHJpbmcoMCwgaWQubGFzdEluZGV4T2YoJy4nKSk7DQppZCA9IGlkLnN1YnN0cmluZygwLCBpZC5sYXN0SW5kZXhPZignLicpKTsNCmlmKGV4aXN0c09iamVjdChpZCkpIHJldHVybiBnZXRPYmplY3QoaWQpOw0K</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> </block> </xml>Anzupassen ist eigentlich nur der eigene DP (wie geschrieben im JSON-Format)
Bei mir sieht das dann in VIS so aus:

Greets
@djmarc75 Super!
Warum muss das Blockly minütlich laufen?kein Support per PN! - Fragen im Forum stellen - es gibt fast nichts, was nicht auch für andere interessant ist.
Benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat.
der Installationsfixer: curl -fsL https://iobroker.net/fix.sh | bash -
-
@homoran sagte in kleines [HowTo] um installierte Adapter auszulesen:
Warum muss das Blockly minütlich laufen?
Man kann das natürlich auch anders machen:

Dann wird die Liste nur aktualisiert wenn ein Adapter installiert oder entfernt wurde (oder den alive Status ändert ;) )
edit:
hier noch der Code dazu :)
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="hjs+eE77tk-5^qay0g/w">id</variable> <variable id="rCtm]jE2W!moedi|=W3.">adapter</variable> <variable id="(*::2jCq%uiY8L|{OGi`">alleAdapter</variable> <variable id=";`(f=8YI46baTkysEaUD">i</variable> <variable id="V^158!|1pdw{kBn@~Z6Q">res</variable> <variable id="xjsL)$Y^,6%B?goB_(J#">name</variable> <variable id="v,aT(v#A~i@`*eE*VJ^#">version</variable> <variable id="|}%^RFe]0V*ksK*E$TYo">icon</variable> <variable id="lnzSp^hiM|m[#_^nBr0m">json</variable> </variables> <block type="variables_set" id="L=wqY7Piwm]u7C+n{d:L" x="888" y="-312"> <field name="VAR" id="rCtm]jE2W!moedi|=W3.">adapter</field> <value name="VALUE"> <block type="selector" id="bq,,b0tz/,-PEk!g)pf-"> <field name="TEXT">system.adapter.*.0.alive</field> </block> </value> <next> <block type="on_ext" id="O6y`vh2!In?@aNCENmS5"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="`br@k*#VYWIN}Advc7uq"> <field name="oid">default</field> </shadow> <block type="variables_get" id="0ls`R*g}Xb.uS[dgTWml"> <field name="VAR" id="rCtm]jE2W!moedi|=W3.">adapter</field> </block> </value> <statement name="STATEMENT"> <block type="variables_set" id="$J/5`9]QBDd_0==y:=14"> <field name="VAR" id="(*::2jCq%uiY8L|{OGi`">alleAdapter</field> <value name="VALUE"> <block type="lists_create_with" id="/0WJjRH]=?i(%l_omK(s"> <mutation items="0"></mutation> </block> </value> <next> <block type="controls_forEach" id="]cHJJO%t:gh?WhlAY*{+"> <field name="VAR" id=";`(f=8YI46baTkysEaUD">i</field> <value name="LIST"> <block type="variables_get" id="0gHdBQY=bpv{dl#tyCls"> <field name="VAR" id="rCtm]jE2W!moedi|=W3.">adapter</field> </block> </value> <statement name="DO"> <block type="variables_set" id="lsv)2Y0nmD3InwFJ}T:V"> <field name="VAR" id="V^158!|1pdw{kBn@~Z6Q">res</field> <value name="VALUE"> <block type="procedures_callcustomreturn" id="Fu0^A]JA+mks{w,|0F8n"> <mutation name="adapternamen"> <arg name="id"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="jIiHr%p6tnW~+)[6,WKH"> <field name="VAR" id=";`(f=8YI46baTkysEaUD">i</field> </block> </value> </block> </value> <next> <block type="variables_set" id="pAfwm?l/SE3f5AF]Y1I7"> <field name="VAR" id="xjsL)$Y^,6%B?goB_(J#">name</field> <value name="VALUE"> <block type="get_attr" id="+h0g|5gUr|}JpT!zX|]2"> <value name="PATH"> <shadow type="text" id="v,4Q!=~Djhiq!92/V-W="> <field name="TEXT">common.name</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="(VOz$T,)5.[x+6Dt`i5s"> <field name="VAR" id="V^158!|1pdw{kBn@~Z6Q">res</field> </block> </value> </block> </value> <next> <block type="variables_set" id="$B`J;8[l!#(!+A`T8K8="> <field name="VAR" id="v,aT(v#A~i@`*eE*VJ^#">version</field> <value name="VALUE"> <block type="get_attr" id="Rr6L*J_rS]*0%lE~@+Q|"> <value name="PATH"> <shadow type="text" id="s/axJ?m].8{t?BRO2LZd"> <field name="TEXT">common.version</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="7U%T*cGdr`?#n9rC1-B#"> <field name="VAR" id="V^158!|1pdw{kBn@~Z6Q">res</field> </block> </value> </block> </value> <next> <block type="variables_set" id="!SwrPwH?$0AKVd;J!}gB"> <field name="VAR" id="|}%^RFe]0V*ksK*E$TYo">icon</field> <value name="VALUE"> <block type="get_attr" id="[Nq;tHd(n=U*OJ4V%5|I"> <value name="PATH"> <shadow type="text" id="SdCcW}0v`DeOs/0PV(XW"> <field name="TEXT">common.extIcon</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="tzLRE7V[54VXTNR^[uYi"> <field name="VAR" id="V^158!|1pdw{kBn@~Z6Q">res</field> </block> </value> </block> </value> <next> <block type="variables_set" id="}zQQw1ov/4s;G-*17jv~"> <field name="VAR" id="lnzSp^hiM|m[#_^nBr0m">json</field> <value name="VALUE"> <block type="text_join" id="Zr$NX1h96-eV,??$;#*("> <mutation items="7"></mutation> <value name="ADD0"> <block type="text" id="gJ!vMuYwB$P%o3CW9r/@"> <field name="TEXT">{"name":"</field> </block> </value> <value name="ADD1"> <block type="variables_get" id="SVk`+oWd!mLx7uNpM^%{"> <field name="VAR" id="xjsL)$Y^,6%B?goB_(J#">name</field> </block> </value> <value name="ADD2"> <block type="text" id="i,GJMCC`Z0KTpB/JVOuU"> <field name="TEXT">","version":"</field> </block> </value> <value name="ADD3"> <block type="variables_get" id="zl5`09I8K+tV-.O#;/e)"> <field name="VAR" id="v,aT(v#A~i@`*eE*VJ^#">version</field> </block> </value> <value name="ADD4"> <block type="text" id="!j=/8D;rU2/|r}rL;^zB"> <field name="TEXT">","icon":"</field> </block> </value> <value name="ADD5"> <block type="variables_get" id="v(Z)9*1sdbL_q`wKKe6C"> <field name="VAR" id="|}%^RFe]0V*ksK*E$TYo">icon</field> </block> </value> <value name="ADD6"> <block type="text" id="7,Bh,V9jk6F0WY2.jN(n"> <field name="TEXT">"}</field> </block> </value> </block> </value> <next> <block type="lists_setIndex" id="I7T.$UjAgA)f.%84Cuq."> <mutation at="false"></mutation> <field name="MODE">INSERT</field> <field name="WHERE">LAST</field> <value name="LIST"> <block type="variables_get" id="-HQgIG#=;r6i5SAIDQM*"> <field name="VAR" id="(*::2jCq%uiY8L|{OGi`">alleAdapter</field> </block> </value> <value name="TO"> <block type="variables_get" id="?NM:4LV}+a`EMqCV~Sk="> <field name="VAR" id="lnzSp^hiM|m[#_^nBr0m">json</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> <next> <block type="update" id="bCc7dxA#6i={R,LU#5a$"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.System.Abfragen.AdapterInstalliert</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text_join" id="0q5O~r6A)dE=.+`SsoL2"> <mutation items="3"></mutation> <value name="ADD0"> <block type="text" id="46(nbN^w4u11N?ZkS,:["> <field name="TEXT">[</field> </block> </value> <value name="ADD1"> <block type="variables_get" id="9mLPKx,yPzLl}P.EfzBQ"> <field name="VAR" id="(*::2jCq%uiY8L|{OGi`">alleAdapter</field> </block> </value> <value name="ADD2"> <block type="text" id="%,Cs)xk)srkjWHD(NN[A"> <field name="TEXT">]</field> </block> </value> </block> </value> </block> </next> </block> </next> </block> </statement> </block> </next> </block> <block type="procedures_defcustomreturn" id="FZsuHEl)0-SimtQ1_%*e" x="1238" y="-262"> <mutation statements="false"> <arg name="id" varid="hjs+eE77tk-5^qay0g/w"></arg> </mutation> <field name="NAME">adapternamen</field> <field name="SCRIPT">aWQgPSBpZC5zdWJzdHJpbmcoMCwgaWQubGFzdEluZGV4T2YoJy4nKSk7DQppZCA9IGlkLnN1YnN0cmluZygwLCBpZC5sYXN0SW5kZXhPZignLicpKTsNCmlmKGV4aXN0c09iamVjdChpZCkpIHJldHVybiBnZXRPYmplY3QoaWQpOw0K</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> </block> </xml>Lehrling seit 1975 !!!
Beitrag geholfen ? dann gerne ein upvote rechts unten im Beitrag klicken ;)
https://forum.iobroker.net/topic/51555/hinweise-f%C3%BCr-gute-forenbeitr%C3%A4ge -
@homoran sagte in kleines [HowTo] um installierte Adapter auszulesen:
Warum muss das Blockly minütlich laufen?
Man kann das natürlich auch anders machen:

Dann wird die Liste nur aktualisiert wenn ein Adapter installiert oder entfernt wurde (oder den alive Status ändert ;) )
edit:
hier noch der Code dazu :)
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="hjs+eE77tk-5^qay0g/w">id</variable> <variable id="rCtm]jE2W!moedi|=W3.">adapter</variable> <variable id="(*::2jCq%uiY8L|{OGi`">alleAdapter</variable> <variable id=";`(f=8YI46baTkysEaUD">i</variable> <variable id="V^158!|1pdw{kBn@~Z6Q">res</variable> <variable id="xjsL)$Y^,6%B?goB_(J#">name</variable> <variable id="v,aT(v#A~i@`*eE*VJ^#">version</variable> <variable id="|}%^RFe]0V*ksK*E$TYo">icon</variable> <variable id="lnzSp^hiM|m[#_^nBr0m">json</variable> </variables> <block type="variables_set" id="L=wqY7Piwm]u7C+n{d:L" x="888" y="-312"> <field name="VAR" id="rCtm]jE2W!moedi|=W3.">adapter</field> <value name="VALUE"> <block type="selector" id="bq,,b0tz/,-PEk!g)pf-"> <field name="TEXT">system.adapter.*.0.alive</field> </block> </value> <next> <block type="on_ext" id="O6y`vh2!In?@aNCENmS5"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="`br@k*#VYWIN}Advc7uq"> <field name="oid">default</field> </shadow> <block type="variables_get" id="0ls`R*g}Xb.uS[dgTWml"> <field name="VAR" id="rCtm]jE2W!moedi|=W3.">adapter</field> </block> </value> <statement name="STATEMENT"> <block type="variables_set" id="$J/5`9]QBDd_0==y:=14"> <field name="VAR" id="(*::2jCq%uiY8L|{OGi`">alleAdapter</field> <value name="VALUE"> <block type="lists_create_with" id="/0WJjRH]=?i(%l_omK(s"> <mutation items="0"></mutation> </block> </value> <next> <block type="controls_forEach" id="]cHJJO%t:gh?WhlAY*{+"> <field name="VAR" id=";`(f=8YI46baTkysEaUD">i</field> <value name="LIST"> <block type="variables_get" id="0gHdBQY=bpv{dl#tyCls"> <field name="VAR" id="rCtm]jE2W!moedi|=W3.">adapter</field> </block> </value> <statement name="DO"> <block type="variables_set" id="lsv)2Y0nmD3InwFJ}T:V"> <field name="VAR" id="V^158!|1pdw{kBn@~Z6Q">res</field> <value name="VALUE"> <block type="procedures_callcustomreturn" id="Fu0^A]JA+mks{w,|0F8n"> <mutation name="adapternamen"> <arg name="id"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="jIiHr%p6tnW~+)[6,WKH"> <field name="VAR" id=";`(f=8YI46baTkysEaUD">i</field> </block> </value> </block> </value> <next> <block type="variables_set" id="pAfwm?l/SE3f5AF]Y1I7"> <field name="VAR" id="xjsL)$Y^,6%B?goB_(J#">name</field> <value name="VALUE"> <block type="get_attr" id="+h0g|5gUr|}JpT!zX|]2"> <value name="PATH"> <shadow type="text" id="v,4Q!=~Djhiq!92/V-W="> <field name="TEXT">common.name</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="(VOz$T,)5.[x+6Dt`i5s"> <field name="VAR" id="V^158!|1pdw{kBn@~Z6Q">res</field> </block> </value> </block> </value> <next> <block type="variables_set" id="$B`J;8[l!#(!+A`T8K8="> <field name="VAR" id="v,aT(v#A~i@`*eE*VJ^#">version</field> <value name="VALUE"> <block type="get_attr" id="Rr6L*J_rS]*0%lE~@+Q|"> <value name="PATH"> <shadow type="text" id="s/axJ?m].8{t?BRO2LZd"> <field name="TEXT">common.version</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="7U%T*cGdr`?#n9rC1-B#"> <field name="VAR" id="V^158!|1pdw{kBn@~Z6Q">res</field> </block> </value> </block> </value> <next> <block type="variables_set" id="!SwrPwH?$0AKVd;J!}gB"> <field name="VAR" id="|}%^RFe]0V*ksK*E$TYo">icon</field> <value name="VALUE"> <block type="get_attr" id="[Nq;tHd(n=U*OJ4V%5|I"> <value name="PATH"> <shadow type="text" id="SdCcW}0v`DeOs/0PV(XW"> <field name="TEXT">common.extIcon</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="tzLRE7V[54VXTNR^[uYi"> <field name="VAR" id="V^158!|1pdw{kBn@~Z6Q">res</field> </block> </value> </block> </value> <next> <block type="variables_set" id="}zQQw1ov/4s;G-*17jv~"> <field name="VAR" id="lnzSp^hiM|m[#_^nBr0m">json</field> <value name="VALUE"> <block type="text_join" id="Zr$NX1h96-eV,??$;#*("> <mutation items="7"></mutation> <value name="ADD0"> <block type="text" id="gJ!vMuYwB$P%o3CW9r/@"> <field name="TEXT">{"name":"</field> </block> </value> <value name="ADD1"> <block type="variables_get" id="SVk`+oWd!mLx7uNpM^%{"> <field name="VAR" id="xjsL)$Y^,6%B?goB_(J#">name</field> </block> </value> <value name="ADD2"> <block type="text" id="i,GJMCC`Z0KTpB/JVOuU"> <field name="TEXT">","version":"</field> </block> </value> <value name="ADD3"> <block type="variables_get" id="zl5`09I8K+tV-.O#;/e)"> <field name="VAR" id="v,aT(v#A~i@`*eE*VJ^#">version</field> </block> </value> <value name="ADD4"> <block type="text" id="!j=/8D;rU2/|r}rL;^zB"> <field name="TEXT">","icon":"</field> </block> </value> <value name="ADD5"> <block type="variables_get" id="v(Z)9*1sdbL_q`wKKe6C"> <field name="VAR" id="|}%^RFe]0V*ksK*E$TYo">icon</field> </block> </value> <value name="ADD6"> <block type="text" id="7,Bh,V9jk6F0WY2.jN(n"> <field name="TEXT">"}</field> </block> </value> </block> </value> <next> <block type="lists_setIndex" id="I7T.$UjAgA)f.%84Cuq."> <mutation at="false"></mutation> <field name="MODE">INSERT</field> <field name="WHERE">LAST</field> <value name="LIST"> <block type="variables_get" id="-HQgIG#=;r6i5SAIDQM*"> <field name="VAR" id="(*::2jCq%uiY8L|{OGi`">alleAdapter</field> </block> </value> <value name="TO"> <block type="variables_get" id="?NM:4LV}+a`EMqCV~Sk="> <field name="VAR" id="lnzSp^hiM|m[#_^nBr0m">json</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> <next> <block type="update" id="bCc7dxA#6i={R,LU#5a$"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.System.Abfragen.AdapterInstalliert</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text_join" id="0q5O~r6A)dE=.+`SsoL2"> <mutation items="3"></mutation> <value name="ADD0"> <block type="text" id="46(nbN^w4u11N?ZkS,:["> <field name="TEXT">[</field> </block> </value> <value name="ADD1"> <block type="variables_get" id="9mLPKx,yPzLl}P.EfzBQ"> <field name="VAR" id="(*::2jCq%uiY8L|{OGi`">alleAdapter</field> </block> </value> <value name="ADD2"> <block type="text" id="%,Cs)xk)srkjWHD(NN[A"> <field name="TEXT">]</field> </block> </value> </block> </value> </block> </next> </block> </next> </block> </statement> </block> </next> </block> <block type="procedures_defcustomreturn" id="FZsuHEl)0-SimtQ1_%*e" x="1238" y="-262"> <mutation statements="false"> <arg name="id" varid="hjs+eE77tk-5^qay0g/w"></arg> </mutation> <field name="NAME">adapternamen</field> <field name="SCRIPT">aWQgPSBpZC5zdWJzdHJpbmcoMCwgaWQubGFzdEluZGV4T2YoJy4nKSk7DQppZCA9IGlkLnN1YnN0cmluZygwLCBpZC5sYXN0SW5kZXhPZignLicpKTsNCmlmKGV4aXN0c09iamVjdChpZCkpIHJldHVybiBnZXRPYmplY3QoaWQpOw0K</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> </block> </xml>@djmarc75 sagte: aktualisiert wenn ein Adapter installiert oder entfernt wurde
Das bekommt das Skript nicht mit.
Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs -
@djmarc75 sagte: aktualisiert wenn ein Adapter installiert oder entfernt wurde
Das bekommt das Skript nicht mit.
@paul53 sagte in kleines [HowTo] um installierte Adapter auszulesen:
Das bekommt das Skript nicht mit
Da hast Du wohl recht, aber wenn installierte Adapter auf Zeitplanung reagieren, schon.
Muss ja auch nicht immer alles Sekundengenau ausgewertet werden.Ich nutze mein erstes Skript mit Zeitplan.
Lehrling seit 1975 !!!
Beitrag geholfen ? dann gerne ein upvote rechts unten im Beitrag klicken ;)
https://forum.iobroker.net/topic/51555/hinweise-f%C3%BCr-gute-forenbeitr%C3%A4ge -
@paul53 sagte in kleines [HowTo] um installierte Adapter auszulesen:
Das bekommt das Skript nicht mit
Da hast Du wohl recht, aber wenn installierte Adapter auf Zeitplanung reagieren, schon.
Muss ja auch nicht immer alles Sekundengenau ausgewertet werden.Ich nutze mein erstes Skript mit Zeitplan.
@djmarc75 sagte: Ich nutze mein erstes Skript mit Zeitplan.
Du solltest mal testen, ob das Skript die Installation und das Entfernen eines Adapters mitbekommt. Es kann gut sein, dass erst durch einen Neustart der Javascript-Instanz deren Puffer synchronisiert werden muss.
Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs -
@djmarc75 sagte: Ich nutze mein erstes Skript mit Zeitplan.
Du solltest mal testen, ob das Skript die Installation und das Entfernen eines Adapters mitbekommt. Es kann gut sein, dass erst durch einen Neustart der Javascript-Instanz deren Puffer synchronisiert werden muss.
@paul53 sagte in kleines [HowTo] um installierte Adapter auszulesen:
ob das Skript die Installation und das Entfernen eines Adapters mitbekommt
Die Installation und Deinstallation eines Adapters wird perfekt erkannt. Nur wenn man den Adapter nicht deinstalliert sondern nur die Instanz dann nicht, aber das ist ja auch so gewollt, damit man sieht was man da so noch rumschleppt.
Lehrling seit 1975 !!!
Beitrag geholfen ? dann gerne ein upvote rechts unten im Beitrag klicken ;)
https://forum.iobroker.net/topic/51555/hinweise-f%C3%BCr-gute-forenbeitr%C3%A4ge -
@paul53 sagte in kleines [HowTo] um installierte Adapter auszulesen:
ob das Skript die Installation und das Entfernen eines Adapters mitbekommt
Die Installation und Deinstallation eines Adapters wird perfekt erkannt. Nur wenn man den Adapter nicht deinstalliert sondern nur die Instanz dann nicht, aber das ist ja auch so gewollt, damit man sieht was man da so noch rumschleppt.
@djmarc75 sagte in kleines [HowTo] um installierte Adapter auszulesen:
@paul53 sagte in kleines [HowTo] um installierte Adapter auszulesen:
ob das Skript die Installation und das Entfernen eines Adapters mitbekommt
Die Installation und Deinstallation eines Adapters wird perfekt erkannt. Nur wenn man den Adapter nicht deinstalliert sondern nur die Instanz dann nicht, aber das ist ja auch so gewollt, damit man sieht was man da so noch rumschleppt.
So habe ich es auch in Erinnerung.
Vom System her ist meine Tabelle (aus meiner Signatur) ja ähnlich aufgebaut.
Nur eben html anstatt json.