Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. JSON aus Liste erstellen

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    JSON aus Liste erstellen

    This topic has been deleted. Only users with topic management privileges can see it.
    • W
      wolfi913 last edited by

      Ich scheitere gerade kläglich dabei, aus einer Liste ein JSON aufzubauen.

      Mein Blockly schaut momentan wie folgt aus:
      Screenshot 2024-03-07 055022.png


      <xml xmlns="https://developers.google.com/blockly/xml">
      <variables>
      <variable id="/ph]KACKR5GIxeq?g7*">debug</variable>
      <variable id="y@LHBdI*[PTFw7JD!i=Y">objID</variable>
      <variable id="(qf#FA,Z@|Ui1Z65}/F">term</variable> <variable id="]^$.1R1z23@x;l}
      ,lX">folder</variable>
      <variable id="MJ+5$;:HtS@YgP6T6R.a">i</variable>
      <variable id="~X7xp0$hXK[I}#(ct%{^">j</variable>
      <variable id="S~vcY8yD%:aZJ$6sP9{{">json</variable>
      <variable id="(k2sWvEpN6OQeLY-o(p]">main_list</variable>
      <variable id="bq6+/cjbf/~tY/JXMH@Q">room_list</variable>
      </variables>
      <block type="variables_set" id="Wti,Q|,eptxCS-cszZYG" x="193" y="-606">
      <field name="VAR" id="/ph]KACKR5GIxeq?g7*">debug</field>
      <value name="VALUE">
      <block type="logic_boolean" id="yE;40iHW*B@h?;h(:R^M">
      <field name="BOOL">TRUE</field>
      </block>
      </value>
      <next>
      <block type="comment" id="zMiz{]B=^ZbR.mwclf#(">
      <field name="COMMENT">Create DP</field>
      <next>
      <block type="variables_set" id="|!-M@(lPYmA(i@e50p">
      <field name="VAR" id="]^$.1R1z23@x;l}_,lX">folder</field> <value name="VALUE"> <block type="text" id="sa.Snh#QccVg3-vleG.X"> <field name="TEXT">0_userdata.0.fingerprint.</field> </block> </value> <next> <block type="procedures_callcustomnoreturn" id="giy5iL[Q%Kja0u*%L#Dh"> <mutation name="create_dp_json"> <arg name="objID"></arg> <arg name="term"></arg> </mutation> <value name="ARG0"> <block type="text_join" id="ObeZhN0%%#uu/@fzU|YQ"> <mutation items="2"></mutation> <value name="ADD0"> <block type="variables_get" id="~MrusN6dMgXS@{gnD,DC"> <field name="VAR" id="]^$.1R1z23@x;l}
      ,lX">folder</field>
      </block>
      </value>
      <value name="ADD1">
      <block type="text" id="m(Czzy!epRn4_E7h(FE"> <field name="TEXT">json</field> </block> </value> </block> </value> <value name="ARG1"> <block type="text" id="Y|Lxh544io$/aLO(#K;j"> <field name="TEXT">json</field> </block> </value> <next> <block type="procedures_callcustomnoreturn" id="lZmZQj+wM#yONjW)_1i2"> <mutation name="create_dp_string"> <arg name="objID"></arg> <arg name="term"></arg> </mutation> <value name="ARG0"> <block type="text_join" id="d6#u[BrS^MdOI?2:.,j">
      <mutation items="2"></mutation>
      <value name="ADD0">
      <block type="variables_get" id="/-#hUp*{O{)T9#fukH">
      <field name="VAR" id="]^$.1R1z23@x;l}_,lX">folder</field> </block> </value> <value name="ADD1"> <block type="text" id="B?s[]aLFuLkGdjA_Om"> <field name="TEXT">name</field> </block> </value> </block> </value> <value name="ARG1"> <block type="text" id="lvZD[:9S^#B%LAjuA7{9"> <field name="TEXT">name</field> </block> </value> <next> <block type="procedures_callcustomnoreturn" id="#v-%.9zb0?v55OaIROR7"> <mutation name="create_dp_boolean"> <arg name="objID"></arg> <arg name="term"></arg> </mutation> <value name="ARG0"> <block type="text_join" id=")x2K?[V/:IT4lvsu63Vw"> <mutation items="2"></mutation> <value name="ADD0"> <block type="variables_get" id="I$5dc%)R]kqo,xf/q-EU"> <field name="VAR" id="]^$.1R1z23@x;l},lX">folder</field>
      </block>
      </value>
      <value name="ADD1">
      <block type="text" id="EFqp=GC_KY7w;wr@fhD%">
      <field name="TEXT">main_auth</field>
      </block>
      </value>
      </block>
      </value>
      <value name="ARG1">
      <block type="text" id="U#)wWQICgly:LQjrCE^;">
      <field name="TEXT">main authorization</field>
      </block>
      </value>
      <next>
      <block type="procedures_callcustomnoreturn" id="=TPVOZCcS6%S5mZ;VIO1">
      <mutation name="create_dp_boolean">
      <arg name="objID"></arg>
      <arg name="term"></arg>
      </mutation>
      <value name="ARG0">
      <block type="text_join" id="MM]ghWfu5ml*Jy0XurQ"> <mutation items="2"></mutation> <value name="ADD0"> <block type="variables_get" id="LT6lsZ?P}KfG81%vY2yx"> <field name="VAR" id="]^$.1R1z23@x;l}
      ,lX">folder</field>
      </block>
      </value>
      <value name="ADD1">
      <block type="text" id="+ib*f_zrF1+s,q~nP#{">
      <field name="TEXT">save_changes</field>
      </block>
      </value>
      </block>
      </value>
      <value name="ARG1">
      <block type="text" id="}rBf2jr}fe.p3AmNUv5*">
      <field name="TEXT">save changes</field>
      </block>
      </value>
      <next>
      <block type="controls_for" id="3WT3rSJBh#~xw^BXB2!"> <field name="VAR" id="MJ+5$;:HtS@YgP6T6R.a">i</field> <value name="FROM"> <shadow type="math_number" id="dhe_l;-1~DG!T@jcC)z">
      <field name="NUM">1</field>
      </shadow>
      </value>
      <value name="TO">
      <shadow type="math_number" id="BM4NxO21B(FmTBCUf3+"> <field name="NUM">5</field> </shadow> </value> <value name="BY"> <shadow type="math_number" id="@^VZ@+cHh7)P,_SgEA?Y"> <field name="NUM">1</field> </shadow> </value> <statement name="DO"> <block type="procedures_callcustomnoreturn" id=".#Nm~TPRwN?+vdcMG2:e"> <mutation name="create_dp_boolean"> <arg name="objID"></arg> <arg name="term"></arg> </mutation> <value name="ARG0"> <block type="text_join" id="m^:20^BNJS#@.iY/{r+L"> <mutation items="4"></mutation> <value name="ADD0"> <block type="variables_get" id="{8hq=Ce=nC^jf8a@o3{l"> <field name="VAR" id="]^$.1R1z23@x;l}
      ,lX">folder</field>
      </block>
      </value>
      <value name="ADD1">
      <block type="text" id="sfVz+=Mod|jF}n0|?~1i">
      <field name="TEXT">room</field>
      </block>
      </value>
      <value name="ADD2">
      <block type="variables_get" id="fdQDpIa0_HBR1!+cT)~"> <field name="VAR" id="MJ+5$;:HtS@YgP6T6R.a">i</field> </block> </value> <value name="ADD3"> <block type="text" id="{P|c}SrdP.:So/65c$%8"> <field name="TEXT">.room_auth</field> </block> </value> </block> </value> <value name="ARG1"> <block type="text" id="ir;mGIHv+s#Rr=]+ghx0"> <field name="TEXT">room authorization</field> </block> </value> <next> <block type="procedures_callcustomnoreturn" id=")^geyJW+i08Ogtu{]2u4"> <mutation name="create_dp_string"> <arg name="objID"></arg> <arg name="term"></arg> </mutation> <value name="ARG0"> <block type="text_join" id="W)|Tt4;-IlTbU5Kw0U"> <mutation items="4"></mutation> <value name="ADD0"> <block type="variables_get" id="c4ETYIRV1t)KK*),]s_L"> <field name="VAR" id="]^$.1R1z23@x;l}_,lX">folder</field>
      </block>
      </value>
      <value name="ADD1">
      <block type="text" id="fB6Z!7a+RSl#aKir:U!X">
      <field name="TEXT">room</field>
      </block>
      </value>
      <value name="ADD2">
      <block type="variables_get" id="-y$DiK]XipT]AZzQ@v95">
      <field name="VAR" id="MJ+5$;:HtS@YgP6T6R.a">i</field>
      </block>
      </value>
      <value name="ADD3">
      <block type="text" id="yiLxJ7i?G]UQxsr*j;X">
      <field name="TEXT">.room_id</field>
      </block>
      </value>
      </block>
      </value>
      <value name="ARG1">
      <block type="text" id="v9mB![F3{s-M;7rypbVl">
      <field name="TEXT">room_id</field>
      </block>
      </value>
      <next>
      <block type="controls_for" id="5~qUsTi3;6bVBC*EH+R"> <field name="VAR" id="~X7xp0$hXK[I}#(ct%{^">j</field> <value name="FROM"> <shadow type="math_number" id="sv6^i)iwT%Pbc:)KEWe">
      <field name="NUM">1</field>
      </shadow>
      </value>
      <value name="TO">
      <shadow type="math_number" id="G8E{XNsLtTW$+gL:Uo.r">
      <field name="NUM">7</field>
      </shadow>
      </value>
      <value name="BY">
      <shadow type="math_number" id="w6dNZ4yzND9zHL-Lv;TD">
      <field name="NUM">1</field>
      </shadow>
      </value>
      <statement name="DO">
      <block type="procedures_callcustomnoreturn" id="!s0IkLVeF/sxm?R:0W^">
      <mutation name="create_dp_boolean">
      <arg name="objID"></arg>
      <arg name="term"></arg>
      </mutation>
      <value name="ARG0">
      <block type="text_join" id="iM?HRs_Q_7!+egQg7^">
      <mutation items="5"></mutation>
      <value name="ADD0">
      <block type="variables_get" id="7SyM]yF!I(4pT,wtMNuT">
      <field name="VAR" id="]^$.1R1z23@x;l}_,lX">folder</field> </block> </value> <value name="ADD1"> <block type="text" id="VPs,o~7UnOIru(i*X^)}"> <field name="TEXT">room</field> </block> </value> <value name="ADD2"> <block type="variables_get" id="FJ!.-}Cn+SE.DraCO!^a"> <field name="VAR" id="MJ+5$;:HtS@YgP6T6R.a">i</field> </block> </value> <value name="ADD3"> <block type="text" id="?dNeiTciaMf59MO^z?kG"> <field name="TEXT">.weekday_</field> </block> </value> <value name="ADD4"> <block type="variables_get" id="Rx@NKfc=4i=i;UCp]~W@"> <field name="VAR" id="~X7xp0$hXK[I}#(ct%{^">j</field> </block> </value> </block> </value> <value name="ARG1"> <block type="text_join" id="#$|}}l!xepwg9EF6PU)">
      <mutation items="2"></mutation>
      <value name="ADD0">
      <block type="text" id="xHM8@P$[ph5D?bn,Q/j"> <field name="TEXT">weekday authorization </field> </block> </value> <value name="ADD1"> <block type="variables_get" id="O[zwz[Z?G.conjv1Os+">
      <field name="VAR" id="~X7xp0$hXK[I}#(ct%{^">j</field>
      </block>
      </value>
      </block>
      </value>
      </block>
      </statement>
      </block>
      </next>
      </block>
      </next>
      </block>
      </statement>
      <next>
      <block type="comment" id="/?A/z$nTM{vt^dn(=~3X">
      <field name="COMMENT">Script</field>
      <next>
      <block type="on_ext" id="!2[(4?oQ8@9:u_f=^58%">
      <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
      <field name="CONDITION">gt</field>
      <field name="ACK_CONDITION"></field>
      <value name="OID0">
      <shadow type="field_oid" id="-AQ8.hI5#^5:KR7jVYcX">
      <field name="oid">default</field>
      </shadow>
      <block type="text_join" id="D,gML%llTYVl~oh7t}MA">
      <mutation items="2"></mutation>
      <value name="ADD0">
      <block type="variables_get" id="}E1~ik(JQi:g3Bc3%G+%">
      <field name="VAR" id="]^$.1R1z23@x;l}_,lX">folder</field> </block> </value> <value name="ADD1"> <block type="text" id="f14s#$3b}NF-uBqc#l0">
      <field name="TEXT">save_changes</field>
      </block>
      </value>
      </block>
      </value>
      <statement name="STATEMENT">
      <block type="variables_set" id="YQ94oM+H[*=Nh21[)~m}">
      <field name="VAR" id="S~vcY8yD%:aZJ$6sP9{{">json</field>
      <value name="VALUE">
      <block type="convert_json2object" id="fPk6^u(.p~PPZQy}f$C"> <value name="VALUE"> <block type="get_value_var" id="69ZzVQHeMx@v^oW$~a{7"> <field name="ATTR">val</field> <value name="OID"> <shadow type="field_oid" id="crbDl%O.;Zf9/c.z|CrH"> <field name="oid">Object ID</field> </shadow> <block type="text_join" id="Z%U={HY+W*mN-2:Z=c13"> <mutation items="2"></mutation> <value name="ADD0"> <block type="variables_get" id="fXehK/;24HDoJ;^1Ok6">
      <field name="VAR" id="]^$.1R1z23@x;l}_,lX">folder</field> </block> </value> <value name="ADD1"> <block type="text" id="-|:)KIL,8T$sCG*qq6x">
      <field name="TEXT">json</field>
      </block>
      </value>
      </block>
      </value>
      </block>
      </value>
      </block>
      </value>
      <next>
      <block type="variables_set" id="6c]},JgV6AsGKC+UnvJc">
      <field name="VAR" id="(k2sWvEpN6OQeLY-o(p]">main_list</field>
      <value name="VALUE">
      <block type="lists_create_with" id="@q}eW%5Se.GdnX1+NKOO">
      <mutation items="0"></mutation>
      </block>
      </value>
      <next>
      <block type="variables_set" id="uk83=qpq/):VPm8;Ch8q">
      <field name="VAR" id="(k2sWvEpN6OQeLY-o(p]">main_list</field>
      <value name="VALUE">
      <block type="lists_create_with" id="#WdYRd[2.7l~Iw.Jsq?c">
      <mutation items="2"></mutation>
      <value name="ADD0">
      <block type="get_value_var" id="JT5Ii[-(l4~E2~LKUOw"> <field name="ATTR">val</field> <value name="OID"> <shadow type="field_oid" id="-G#y1Q{ko7yD=B7Hb_I]"> <field name="oid">Object ID</field> </shadow> <block type="text_join" id="kKG93NCp^$|IDyw]j8h*"> <mutation items="2"></mutation> <value name="ADD0"> <block type="variables_get" id="}=I$Kt0!P}XtCfwAKe7H"> <field name="VAR" id="]^$.1R1z23@x;l}
      ,lX">folder</field>
      </block>
      </value>
      <value name="ADD1">
      <block type="text" id="tHRl6dJ,faK*%GUN7#,J">
      <field name="TEXT">name</field>
      </block>
      </value>
      </block>
      </value>
      </block>
      </value>
      <value name="ADD1">
      <block type="get_value_var" id="-qZLSan)j6cBWyt;;YR"> <field name="ATTR">val</field> <value name="OID"> <shadow type="field_oid" id="-G#y1Q{ko7yD=B7Hb_I]"> <field name="oid">Object ID</field> </shadow> <block type="text_join" id="4HePXljAt)~]K:e(q?[">
      <mutation items="2"></mutation>
      <value name="ADD0">
      <block type="variables_get" id="YdiQGGNOl6so.Mp~/iTh">
      <field name="VAR" id="]^$.1R1z23@x;l}_,lX">folder</field> </block> </value> <value name="ADD1"> <block type="text" id="WOQGucnWlU+hg8rnzld">
      <field name="TEXT">main_auth</field>
      </block>
      </value>
      </block>
      </value>
      </block>
      </value>
      </block>
      </value>
      <next>
      <block type="controls_if" id="#Gty{PaUo!|QZ3NmLV(U">
      <value name="IF0">
      <block type="variables_get" id="Z[Riu-go48a~g4M?8Z.Z">
      <field name="VAR" id="/ph]KACKR5GIxeq?g7*">debug</field>
      </block>
      </value>
      <statement name="DO0">
      <block type="debug" id="18,?dQf?}^3hv4-QQ!vc">
      <field name="Severity">log</field>
      <value name="TEXT">
      <shadow type="text" id="89!d#bCk]z1^.0#suU-L">
      <field name="TEXT">test</field>
      </shadow>
      <block type="variables_get" id="riqb{z?i,D92/(B,;-g"> <field name="VAR" id="(k2sWvEpN6OQeLY-o(p]">main_list</field> </block> </value> <next> <block type="lists_setIndex" id="1Ek{trQzlTkzM%w2h,0+"> <mutation at="false"></mutation> <field name="MODE">INSERT</field> <field name="WHERE">FIRST</field> <value name="LIST"> <block type="variables_get" id=",DY{@MSD@]T1[OlYDh0_"> <field name="VAR" id="S~vcY8yD%:aZJ$6sP9{{">json</field> </block> </value> <value name="TO"> <block type="convert_jsonata" id="Dtu%gpJ#yXcn=lV7)~9l"> <value name="EXPRESSION"> <shadow type="text" id="Oh7(K-zh=Da6ldlt!,5H"> <field name="TEXT">{"name": $[0], "main_auth": $[1]}</field> </shadow> </value> <value name="TARGET"> <block type="variables_get" id="1$9oMjP*b[saNUQ/c?{-"> <field name="VAR" id="(k2sWvEpN6OQeLY-o(p]">main_list</field> </block> </value> </block> </value> </block> </next> </block> </statement> <next> <block type="controls_for" id="jd$3{pC(sqJ64+#+M7;">
      <field name="VAR" id="MJ+5$;:HtS@YgP6T6R.a">i</field>
      <value name="FROM">
      <shadow type="math_number" id="WGmKg@BuSiorBh30?j1(">
      <field name="NUM">1</field>
      </shadow>
      </value>
      <value name="TO">
      <shadow type="math_number" id=")Klbc:pSKHtfEGH{Jz{q">
      <field name="NUM">5</field>
      </shadow>
      </value>
      <value name="BY">
      <shadow type="math_number" id="hE;hOG3w$E31HAIvm?p{">
      <field name="NUM">1</field>
      </shadow>
      </value>
      <statement name="DO">
      <block type="variables_set" id="2Y{l/0f{jrvW~cQTOfJj">
      <field name="VAR" id="bq6+/cjbf/~tY/JXMH@Q">room_list</field>
      <value name="VALUE">
      <block type="lists_create_with" id="Rb7=7gF)U2Lh0VaXsmwC">
      <mutation items="0"></mutation>
      </block>
      </value>
      <next>
      <block type="variables_set" id="oWjQ!iH[%m$h0aP6w09x">
      <field name="VAR" id="bq6+/cjbf/~tY/JXMH@Q">room_list</field>
      <value name="VALUE">
      <block type="lists_create_with" id="-=)dq?,+pN8(C#Jle(F$">
      <mutation items="3"></mutation>
      <value name="ADD0">
      <block type="get_value_var" id="i..*z,iuWAXI[N/pa0S">
      <field name="ATTR">val</field>
      <value name="OID">
      <shadow type="field_oid" id="-G#y1Q{ko7yD=B7Hb_I]">
      <field name="oid">Object ID</field>
      </shadow>
      <block type="text_join" id="!(jBRS=WcrZ_Q6UlIB0F">
      <mutation items="4"></mutation>
      <value name="ADD0">
      <block type="variables_get" id="K?YJuvmT!h)K9{Ge;1ek">
      <field name="VAR" id="]^$.1R1z23@x;l}_,lX">folder</field> </block> </value> <value name="ADD1"> <block type="text" id="qI4Hj1P20=@=o7e9fdyQ"> <field name="TEXT">room</field> </block> </value> <value name="ADD2"> <block type="variables_get" id="4i5rVJ^X-_jGqnI6Bz6;"> <field name="VAR" id="MJ+5$;:HtS@YgP6T6R.a">i</field> </block> </value> <value name="ADD3"> <block type="text" id="e]WjwXCIPcILpFws8Xp8"> <field name="TEXT">.room_id</field> </block> </value> </block> </value> </block> </value> <value name="ADD1"> <block type="get_value_var" id="-[,U)3{[aI;W4d=q1IX{"> <field name="ATTR">val</field> <value name="OID"> <shadow type="field_oid" id="{41?xS+rlG,S=5IQzWbj"> <field name="oid">Object ID</field> </shadow> <block type="text_join" id="|^?mx4oZVX1b-^FeFv)">
      <mutation items="4"></mutation>
      <value name="ADD0">
      <block type="variables_get" id="YtE%SHuB
      P(vUoz9G}L#">
      <field name="VAR" id="]^$.1R1z23@x;l}_,lX">folder</field> </block> </value> <value name="ADD1"> <block type="text" id="aPeor0LJ6Gr]m@2Ug="> <field name="TEXT">room</field> </block> </value> <value name="ADD2"> <block type="variables_get" id="Xqs8EA-W80u=6P67;Kf^"> <field name="VAR" id="MJ+5$;:HtS@YgP6T6R.a">i</field> </block> </value> <value name="ADD3"> <block type="text" id="73v}v/7PCA@Ju8[p2Ky:"> <field name="TEXT">.room_auth</field> </block> </value> </block> </value> </block> </value> </block> </value> <next> <block type="controls_for" id="c$RXf9q5~g8A1xS{yO7+"> <field name="VAR" id="~X7xp0$hXK[I}#(ct%{^">j</field> <value name="FROM"> <shadow type="math_number" id="N7T#/270kR5bUB!+T!F,"> <field name="NUM">1</field> </shadow> </value> <value name="TO"> <shadow type="math_number" id="sDS*DdD]05m6TMq*HL"> <field name="NUM">7</field> </shadow> </value> <value name="BY"> <shadow type="math_number" id="XNo$g*olRwJT70O!SsZ">
      <field name="NUM">1</field>
      </shadow>
      </value>
      <statement name="DO">
      <block type="lists_setIndex" id="n;]CEy;A=H/.J#I|Svjh">
      <mutation at="false"></mutation>
      <field name="MODE">INSERT</field>
      <field name="WHERE">LAST</field>
      <value name="LIST">
      <block type="variables_get" id="kmn[(Z[;hR^U9HN$yKW=">
      <field name="VAR" id="bq6+/cjbf/~tY/JXMH@Q">room_list</field>
      </block>
      </value>
      <value name="TO">
      <block type="get_value_var" id="IC7Q4SiZPIYdI6WVQ#Vf">
      <field name="ATTR">val</field>
      <value name="OID">
      <shadow type="field_oid" id="{41?xS+rlG,S=5IQzWbj">
      <field name="oid">Object ID</field>
      </shadow>
      <block type="text_join" id=";;U~t|ikIy6RjL$W/J]-">
      <mutation items="5"></mutation>
      <value name="ADD0">
      <block type="variables_get" id="MLPTzayL[]?)oDG[B+${">
      <field name="VAR" id="]^$.1R1z23@x;l}_,lX">folder</field> </block> </value> <value name="ADD1"> <block type="text" id="r(1^rDV9*_g;R;IZg390"> <field name="TEXT">room</field> </block> </value> <value name="ADD2"> <block type="variables_get" id="j(cj+avSR=7eb$4)KV#s"> <field name="VAR" id="MJ+5$;:HtS@YgP6T6R.a">i</field> </block> </value> <value name="ADD3"> <block type="text" id="X~K,kxoL_.|ga0Ifrne*"> <field name="TEXT">.weekday_</field> </block> </value> <value name="ADD4"> <block type="variables_get" id="86E3mTr{9[m?sG~l5R$Y"> <field name="VAR" id="~X7xp0$hXK[I}#(ct%{^">j</field> </block> </value> </block> </value> </block> </value> </block> </statement> </block> </next> </block> </next> </block> </statement> <next> <block type="control_ex" id="(sUI%N@ZiFNRG}$=ZYZ">
      <field name="TYPE">true</field>
      <field name="CLEAR_RUNNING">FALSE</field>
      <value name="OID">
      <shadow type="field_oid" id="X(rbNZ/U+EsaSQ_q?xL6">
      <field name="oid">Object ID</field>
      </shadow>
      <block type="text_join" id="2C5@ZTAoW.P[8q-K.^+o">
      <mutation items="2"></mutation>
      <value name="ADD0">
      <block type="variables_get" id=")QZht=+-/g-i%QeFwy^"> <field name="VAR" id="]^$.1R1z23@x;l}
      ,lX">folder</field>
      </block>
      </value>
      <value name="ADD1">
      <block type="text" id="HZ9jaQLJv%Vl)g#s?8B"> <field name="TEXT">json</field> </block> </value> </block> </value> <value name="VALUE"> <shadow type="logic_boolean" id="Vlj1i+oE$/JpLo(4L~Q">
      <field name="BOOL">FALSE</field>
      </shadow>
      <block type="convert_object2json" id=".ap-,CChh_GiO,UD%I(e">
      <field name="PRETTIFY">FALSE</field>
      <value name="VALUE">
      <block type="variables_get" id="%P5^DsjS5G86GFZIBsV"> <field name="VAR" id="S~vcY8yD%:aZJ$6sP9{{">json</field> </block> </value> </block> </value> <value name="DELAY_MS"> <shadow type="math_number" id="(U1j~fhc(Bb35Q#1?A:^"> <field name="NUM">0</field> </shadow> </value> <next> <block type="controls_if" id="|5IvE9qoqMcK)@b=m!3l"> <value name="IF0"> <block type="variables_get" id="TXsWCM|3X,hSiXnmui9j"> <field name="VAR" id="/ph]_KACKR5GIxeq?g7*">debug</field> </block> </value> <statement name="DO0"> <block type="debug" id="#+Kw6QuYfFCRH-6Bf65">
      <field name="Severity">log</field>
      <value name="TEXT">
      <shadow type="text" id="89!d#bCk]z1^.0#suU-L">
      <field name="TEXT">test</field>
      </shadow>
      <block type="variables_get" id="fG,3Ip^MC;7x3or}LJQp">
      <field name="VAR" id="S~vcY8yD%:aZJ$6sP9{{">json</field>
      </block>
      </value>
      <next>
      <block type="debug" id="w_cJ!dyy:;ZP}UXZc2J"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="0f$(JNnkq:Pf$UQy3^XR"> <field name="TEXT">Fingerprint_Save_Changes</field> </shadow> </value> </block> </next> </block> </statement> <next> <block type="control_ex" id="8f9TLxUMx7+L+Asr,@FJ"> <field name="TYPE">true</field> <field name="CLEAR_RUNNING">FALSE</field> <value name="OID"> <shadow type="field_oid" id="X(rbNZ/U+EsaSQ_q?xL6"> <field name="oid">Object ID</field> </shadow> <block type="text_join" id="j,mRQxo.WX?Fh0uq)*4/"> <mutation items="2"></mutation> <value name="ADD0"> <block type="variables_get" id="Nyy~t#x!Y3PcxDCT4Ne]"> <field name="VAR" id="]^$.1R1z23@x;l}
      ,lX">folder</field>
      </block>
      </value>
      <value name="ADD1">
      <block type="text" id="MHXY8ElpDq+wo#sw#0B-">
      <field name="TEXT">save_changes</field>
      </block>
      </value>
      </block>
      </value>
      <value name="VALUE">
      <shadow type="logic_boolean" id="1WDQ=VD[2l-SqL?3P/}"> <field name="BOOL">FALSE</field> </shadow> </value> <value name="DELAY_MS"> <shadow type="math_number" id="KavE:0wh/K,*O~Zx+zaN"> <field name="NUM">0</field> </shadow> </value> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> <block type="procedures_defcustomnoreturn" id="*RP[k|e@1eha)eYrn.Q" x="688" y="-587">
      <mutation statements="false">
      <arg name="objID" varid="y@LHBdI*[PTFw7JD!i=Y"></arg>
      <arg name="term" varid="(qf#FA,Z@|Ui1Z65}/F"></arg> </mutation> <field name="NAME">create_dp_boolean</field> <field name="SCRIPT">aWYgKCFleGlzdHNPYmplY3Qob2JqSUQpKSB7DQpjcmVhdGVTdGF0ZShvYmpJRCwgZmFsc2UsIHsNCiAgcmVhZDogdHJ1ZSwgDQogIHdyaXRlOiB0cnVlLCANCiAgbmFtZTogdGVybSwgDQogIHR5cGU6ICJib29sZWFuIiwgDQogIGRlZjogZmFsc2UNCn0pOw0KIGF3YWl0IHdhaXQoMTAwKTsNCn0=</field> <comment pinned="false" h="80" w="160">Erstelle DP bool</comment> </block> <block type="procedures_defcustomnoreturn" id="V;X_uO{1b2pGr#gEs+1H" x="688" y="-562"> <mutation statements="false"> <arg name="objID" varid="y@LHBdI*[PTFw7JD!i=Y"></arg> <arg name="term" varid="(qf#FA,Z@|Ui1Z65}/F"></arg>
      </mutation>
      <field name="NAME">create_dp_string</field>
      <field name="SCRIPT">aWYgKCFleGlzdHNPYmplY3Qob2JqSUQpKSB7DQpjcmVhdGVTdGF0ZShvYmpJRCwgMCwgew0KICAgIHR5cGU6ICdzdHJpbmcnLCANCiAgICByZWFkOiB0cnVlLCANCiAgICB3cml0ZTogdHJ1ZSwNCiAgICBuYW1lOiB0ZXJtDQp9KTsNCiBhd2FpdCB3YWl0KDEwMCk7DQp9</field>
      <comment pinned="false" h="80" w="160">Erstelle DP</comment>
      </block>
      <block type="procedures_defcustomnoreturn" id="D7f@-mAUV~p85BAHP" x="688" y="-537"> <mutation statements="false"> <arg name="objID" varid="y@LHBdI*[PTFw7JD!i=Y"></arg> <arg name="term" varid="(qf#FA,Z@|Ui1Z65}/F"></arg>
      </mutation>
      <field name="NAME">create_dp_json</field>
      <field name="SCRIPT">aWYgKCFleGlzdHNPYmplY3Qob2JqSUQpKSB7DQpjcmVhdGVTdGF0ZShvYmpJRCwgMCwgew0KICAgIHR5cGU6ICdqc29uJywgDQogICAgcmVhZDogdHJ1ZSwgDQogICAgd3JpdGU6IHRydWUsDQogICAgbmFtZTogdGVybQ0KfSk7DQogYXdhaXQgd2FpdCgxMDApOw0KfQ==</field>
      <comment pinned="false" h="80" w="160">Erstelle DP</comment>
      </block>
      </xml>

      Bekomme dann immer folgenden Fehler
      Screenshot 2024-03-07 055040.png
      Es müsste um folgenden Bereich gehen:
      Screenshot 2024-03-07 055104.png

      Was mach' ich da falsch?

      In einem späteren Schritt wäre eigentlich gedacht auch noch die Listen aus den nächsten Schleifen in das JSON aufzunehmen, aber ich scheitere ja schon auf der oberen Ebene.

      haus-automatisierung 1 Reply Last reply Reply Quote 0
      • haus-automatisierung
        haus-automatisierung Developer Most Active @wolfi913 last edited by haus-automatisierung

        @wolfi913 sagte in JSON aus Liste erstellen:

        Was mach' ich da falsch?

        So ziemlich alles. Trigger falsch definiert, "JSON nach Objekt" wird mit irgendwelchen Texten gefüttert (enthalten die sicher JSON?), ...

        Was genau hast Du denn vor? Oder steht in folder ein Prefix für eine ID? Dann bitte mal das komplette Script zeigen (und den Inhalt aller verwendeten Datenpunkte).

        Dass json.unshift nicht funktioniert liegt daran, dass es kein Array zurückgeliefert wurde.

        W 2 Replies Last reply Reply Quote 0
        • W
          wolfi913 @haus-automatisierung last edited by

          @haus-automatisierung sagte in JSON aus Liste erstellen:

          Was genau hast Du denn vor? Oder steht in folder ein Prefix für eine ID? Dann bitte mal das komplette Script zeigen (und den Inhalt aller verwendeten Datenpunkte).

          Leider hab ich erst heute Abend wieder Zugriff auf meinen ioBroker. Versuch's dann komplett einzustellen. Im Spoiler unter dem Blockly-Bildausschnitt wär das komplette Script aber ohnehin schon drin.

          Bis dahin kann ich's aber zumindest mal kurz beschreiben:

          Es handelt sich um eine VIS-Erfassungsmaske (so in etwa, schnell in Excel nachgebaut)
          Unbenannt.JPG
          die alle Daten sammelt und beim Speichern dann zu einem JSON zusammenbauen soll.

          Der Trigger ist auf den Speichern-Button gelegt. Die Erzeugung der Listen funktioniert grundsätzlich auch, nur das "Überführen" in ein JSON das dann schlussendlich etwa so ausschauen soll:

          [{"name": "xxx", "main_auth": true, {"room1": {"id":"123","room_auth":true,{"weekdays": {"weekday1":true,…,weekday7":false}}}}]
          

          (keine Gewähr für den richtigen Aufbau, nur schnell mal so zusammengetippt)
          scheitert, hier schon bei dem Aufbau [{"name":"Wolfi", "main_auth": true}]

          Im Blockly werden (nicht im Bild) die DP angelegt (teste das alles auf einem Zweitsystem und möchtet, wenn's klappt die ganzen Datenpunkte nicht von Hand nochmal anlegen müssen). Daher der Aufbau der ObjID über folder+Bezeichnung.

          Ich möchte damit die Berechtigungen von Fingerabdrucksensoren die an verschiedenen ESP's hängen und Türöffner steuern abchecken und anschließend dem ESP über MQTT die Erlaubnis bzw. Verweigerung der Öffnung zurückgeben.

          1 Reply Last reply Reply Quote 0
          • W
            wolfi913 @haus-automatisierung last edited by wolfi913

            @haus-automatisierung
            Funktioniert jetzt (ohne Änderungen am Script)
            Screenshot 2024-03-07 181313.png
            Hab jetzt im json-DP ein [] als "Startwert" eingetragen und jetzt funktionierts 😞
            Das kommt davon, wenn man mitten in der Nacht sowas zusammenbasteln will.

            Edit:
            Klappt jetzt bestens

            [
              {
                "name": "Wolfi",
                "main_auth": true,
                "room1": {
                  "id": "99",
                  "room_auth": false,
                  "weekday": {
                    "wd1": true,
                    "wd2": true,
                    "wd3": false,
                    "wd4": false,
                    "wd5": true,
                    "wd6": false,
                    "wd7": true
                  }
                },
                "room2": {
                  "id": 0,
                  "room_auth": false,
                  "weekday": {
                    "wd1": false,
                    "wd2": false,
                    "wd3": false,
                    "wd4": false,
                    "wd5": false,
                    "wd6": false,
                    "wd7": false
                  }
                },
                "room3": {
                  "id": 0,
                  "room_auth": false,
                  "weekday": {
                    "wd1": false,
                    "wd2": false,
                    "wd3": false,
                    "wd4": false,
                    "wd5": false,
                    "wd6": false,
                    "wd7": false
                  }
                },
                "room4": {
                  "id": 0,
                  "room_auth": false,
                  "weekday": {
                    "wd1": false,
                    "wd2": false,
                    "wd3": false,
                    "wd4": false,
                    "wd5": false,
                    "wd6": false,
                    "wd7": false
                  }
                },
                "room5": {
                  "id": 0,
                  "room_auth": false,
                  "weekday": {
                    "wd1": false,
                    "wd2": false,
                    "wd3": false,
                    "wd4": false,
                    "wd5": false,
                    "wd6": false,
                    "wd7": false
                  }
                }
              },
              {
                "name": "Wolfi2",
                "main_auth": true,
                "room1": {
                  "id": "99",
                  "room_auth": false,
                  "weekday": {
                    "wd1": true,
                    "wd2": true,
                    "wd3": false,
                    "wd4": false,
                    "wd5": true,
                    "wd6": false,
                    "wd7": true
                  }
                },
                "room2": {
                  "id": 0,
                  "room_auth": false,
                  "weekday": {
                    "wd1": false,
                    "wd2": false,
                    "wd3": false,
                    "wd4": false,
                    "wd5": false,
                    "wd6": false,
                    "wd7": false
                  }
                },
                "room3": {
                  "id": 0,
                  "room_auth": false,
                  "weekday": {
                    "wd1": false,
                    "wd2": false,
                    "wd3": false,
                    "wd4": false,
                    "wd5": false,
                    "wd6": false,
                    "wd7": false
                  }
                },
                "room4": {
                  "id": 0,
                  "room_auth": false,
                  "weekday": {
                    "wd1": false,
                    "wd2": false,
                    "wd3": false,
                    "wd4": false,
                    "wd5": false,
                    "wd6": false,
                    "wd7": false
                  }
                },
                "room5": {
                  "id": 0,
                  "room_auth": false,
                  "weekday": {
                    "wd1": false,
                    "wd2": false,
                    "wd3": false,
                    "wd4": false,
                    "wd5": false,
                    "wd6": false,
                    "wd7": false
                  }
                }
              },
              {
                "name": "Wolfi4",
                "main_auth": true,
                "room1": {
                  "id": "99",
                  "room_auth": false,
                  "weekday": {
                    "wd1": true,
                    "wd2": true,
                    "wd3": false,
                    "wd4": false,
                    "wd5": true,
                    "wd6": false,
                    "wd7": true
                  }
                },
                "room2": {
                  "id": 0,
                  "room_auth": false,
                  "weekday": {
                    "wd1": false,
                    "wd2": false,
                    "wd3": false,
                    "wd4": false,
                    "wd5": false,
                    "wd6": false,
                    "wd7": false
                  }
                },
                "room3": {
                  "id": 0,
                  "room_auth": false,
                  "weekday": {
                    "wd1": false,
                    "wd2": false,
                    "wd3": false,
                    "wd4": false,
                    "wd5": false,
                    "wd6": false,
                    "wd7": false
                  }
                },
                "room4": {
                  "id": 0,
                  "room_auth": false,
                  "weekday": {
                    "wd1": false,
                    "wd2": false,
                    "wd3": false,
                    "wd4": false,
                    "wd5": false,
                    "wd6": false,
                    "wd7": false
                  }
                },
                "room5": {
                  "id": 0,
                  "room_auth": false,
                  "weekday": {
                    "wd1": false,
                    "wd2": false,
                    "wd3": false,
                    "wd4": false,
                    "wd5": false,
                    "wd6": false,
                    "wd7": false
                  }
                }
              }
            ]
            
            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            Support us

            ioBroker
            Community Adapters
            Donate

            518
            Online

            32.0k
            Users

            80.4k
            Topics

            1.3m
            Posts

            2
            4
            234
            Loading More Posts
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes
            Reply
            • Reply as topic
            Log in to reply
            Community
            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
            The ioBroker Community 2014-2023
            logo