- Home
- Deutsch
- Skripten / Logik
- Blockly
- Luft-Messdaten von OpenSenseMap auslesen
Luft-Messdaten von OpenSenseMap auslesen
-
Das Skript läuft soweit ganz gut - nochmals Danke für die Weiterbildung!
leider werden die Datenpunkte bei einer neuen Station (Skript kopiert und Station-ID geändert) bis auf Station-ID und Name der Station nicht beim ersten Durchlauf gefüllt.
Ich denke das liegt nach wie vor an der asynchronen Abarbeitung, auch wenn es jetzt keine Errors mehr gibt.
Bei dem Anlegen des Channel-DP habe ich anschließend einen Timeout, damit die weiteren DPs den fertigen Channel vorfinden.
Die Sensor DPs werden abr mit Wert 0 angelegt, was IMHO durch die Funktion bedingt ist.
function ( id, Name, unit )
if(existsState(id)) return true; createState(id, 0, {type:'number', name: Name, unit:unit, read:true, write:false, role:'value'});
Kann/darf man hier den default-Wert (=0) durch eine weitere Variable ersetzen, die direkt den Wert enthält?
-
@Homoran sagte:
Kann/darf man hier den default-Wert (=0) durch eine weitere Variable ersetzen, die direkt den Wert enthält?
Ja.
if(existsState(id)) return true; createState(id, init, {type:'number', name: Name, unit:unit, read:true, write:false, role:'value'});
-
@paul53
Danke, genau so hatte ich es mir vorgestellt -
Hier ist jetzt die vorläufig letzte Version 0.3.3
<xml xmlns="http://www.w3.org/1999/xhtml"> <variables> <variable type="" id="F8FJH2:MYg!TEng|{`cX">id</variable> <variable type="" id="kNmwW)zuGsFpRPSr%tI4">Name</variable> <variable type="" id="=:T.5x=N7D*5*g`@lmVQ">str</variable> <variable type="" id="/Ob+6.k{E5c@No}z%#Fu">unit</variable> <variable type="" id="=bcQw^A:n468+FbJP#dy">init</variable> <variable type="" id="(OS6)At}0sRw3rBe4]ua">sensor</variable> <variable type="" id="P}P_1?s%S89=9|ppf`Nx">Station</variable> <variable type="" id="I@-[Cj^I1}(-7m+VQ8Dj">idSensor</variable> <variable type="" id="Z{~*0luN#Qp/IUr;|BmX">Unterverzeichnis</variable> <variable type="" id="%arR9:8r$Bg^H++?QiSv">URL</variable> <variable type="" id="9k8j[#@42,2VE~mdj%7,">obj</variable> <variable type="" id="mfFi6HkOgN+sro=x^sXu">result</variable> <variable type="" id="%VO!Ye}Fho*S1ssX{uog">sensors</variable> <variable type="undefined" id="timeout">timeout</variable> <variable type="" id="rn64I/AwPbPo#;6x;zx$">i</variable> </variables> <block type="comment" id="rRh=WVq[e{*QAmGaL_{b" x="-687" y="-537"> <field name="COMMENT">Skript zum Auslesen von Messstationen bei opensensemap.info</field> <next> <block type="comment" id="O,?[OJ_U*rX)*]R}`4LR"> <field name="COMMENT">von Homoran mit ganz viel Hilfe von paul53</field> <next> <block type="comment" id="j,L%{C[e.u@`d)6[f(r="> <field name="COMMENT">Version 0.3.3</field> </block> </next> </block> </next> </block> <block type="procedures_defcustomnoreturn" id="%Ym[H;wPCw14-F~+qd!a" x="-688" y="-438"> <mutation statements="false"> <arg name="id" varid="F8FJH2:MYg!TEng|{`cX"></arg> <arg name="Name" varid="kNmwW)zuGsFpRPSr%tI4"></arg> </mutation> <field name="NAME">Stations-Channel anlegen</field> <field name="SCRIPT">aWQgPSAnamF2YXNjcmlwdC4nICsgaW5zdGFuY2UgKyAnLicgKyBpZDsKaWYoIWV4aXN0c09iamVjdChpZCkpIHsKICAgdmFyIG9iaiA9IHt9OwogICBvYmoudHlwZSA9ICdjaGFubmVsJzsKICAgb2JqLmNvbW1vbiA9IHt9OwogICBvYmouY29tbW9uLm5hbWUgPSBOYW1lOwogICBzZXRPYmplY3QoaWQsIG9iaik7Cn0=</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> </block> <block type="procedures_defcustomreturn" id="|@dUe3W|[VZ`uP~L8^L." x="-687" y="-413"> <mutation statements="false"> <arg name="str" varid="=:T.5x=N7D*5*g`@lmVQ"></arg> </mutation> <field name="NAME">Punktkiller</field> <field name="SCRIPT">cmV0dXJuIHN0ci5yZXBsYWNlKC9bXC5cc1wtXS9nLCAiXyIp</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> </block> <block type="procedures_defcustomreturn" id="[a^U9+`y_=]GesO0(kJv" x="-688" y="-387"> <mutation statements="false"> <arg name="id" varid="F8FJH2:MYg!TEng|{`cX"></arg> <arg name="Name" varid="kNmwW)zuGsFpRPSr%tI4"></arg> <arg name="unit" varid="/Ob+6.k{E5c@No}z%#Fu"></arg> <arg name="init" varid="=bcQw^A:n468+FbJP#dy"></arg> </mutation> <field name="NAME">erzeugeZahlDP</field> <field name="SCRIPT">aWYoZXhpc3RzU3RhdGUoaWQpKSByZXR1cm4gdHJ1ZTsNCmNyZWF0ZVN0YXRlKGlkLCBpbml0LCB7dHlwZTonbnVtYmVyJywgbmFtZTogTmFtZSwgdW5pdDp1bml0LCByZWFkOnRydWUsIHdyaXRlOmZhbHNlLCByb2xlOid2YWx1ZSd9KTs=</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> </block> <block type="comment" id="r,^tOsf=lIoMh,tZCb+t" x="-687" y="-337"> <field name="COMMENT">Hier die Stations-Id eingeben</field> <next> <block type="variables_set" id="{Z@]+Tsgj`9a~63Nx/9t"> <field name="VAR" id="P}P_1?s%S89=9|ppf`Nx" variabletype="">Station</field> <value name="VALUE"> <block type="text" id="IjLVT[-@mv7%lCJ-(38r"> <field name="TEXT">5da1ad6925683a001aa87245</field> </block> </value> <next> <block type="comment" id="lLJ!@]nJgIF8`2n{ptBs"> <field name="COMMENT">Hier Unterverzeichnis im js-Verzeichnis eingeben</field> <next> <block type="comment" id="aluc5:I^O*I~:1N,i$9{"> <field name="COMMENT">Punkt am Ende als Datensatztrenner nicht vergessen</field> <next> <block type="variables_set" id="4*=Fh?9d0ZF{Azz$i~o;"> <field name="VAR" id="Z{~*0luN#Qp/IUr;|BmX" variabletype="">Unterverzeichnis</field> <value name="VALUE"> <block type="text" id="b37|)*c1@OiX,,:!b^V@"> <field name="TEXT">Luftdaten.</field> </block> </value> <next> <block type="variables_set" id=".Id#{.SiATpaCI[t9/Pb"> <field name="VAR" id="%arR9:8r$Bg^H++?QiSv" variabletype="">URL</field> <value name="VALUE"> <block type="text_join" id="3,2Nmjr=CqF+.8mgNjMu"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="W:|(T7`gJv3jBjE[W=a~"> <field name="TEXT">https://api.opensensemap.org/boxes/</field> </block> </value> <value name="ADD1"> <block type="variables_get" id="$7jo45G0xdQ!;81^B|?t"> <field name="VAR" id="P}P_1?s%S89=9|ppf`Nx" variabletype="">Station</field> </block> </value> </block> </value> <next> <block type="schedule" id="~)SXp/emf@Z[*]}h(P*3"> <field name="SCHEDULE">*/10 * * * *</field> <statement name="STATEMENT"> <block type="request" id="JYZ7{U|l##aK4-YGHzlF"> <mutation with_statement="true"></mutation> <field name="WITH_STATEMENT">TRUE</field> <field name="LOG"></field> <value name="URL"> <shadow type="text" id="}Zb=fi2klg+*{JjH1}Da"> <field name="TEXT">text</field> </shadow> <block type="variables_get" id="eOg]UB./1-Xdqt!9xGJh"> <field name="VAR" id="%arR9:8r$Bg^H++?QiSv" variabletype="">URL</field> </block> </value> <statement name="STATEMENT"> <block type="variables_set" id="[!uzwo(w1oVkQ~F(?A)m"> <field name="VAR" id="9k8j[#@42,2VE~mdj%7," variabletype="">obj</field> <value name="VALUE"> <block type="convert_json2object" id="!/v!.Gs6SM-([dBZeGkv"> <value name="VALUE"> <block type="variables_get" id="!]zXu89Uby~HDzHiuIPK"> <field name="VAR" id="mfFi6HkOgN+sro=x^sXu" variabletype="">result</field> </block> </value> </block> </value> <next> <block type="procedures_callcustomnoreturn" id="-Q=6Xhv-^1EO,@~X-Kpi"> <mutation name="Stations-Channel anlegen"> <arg name="id"></arg> <arg name="Name"></arg> </mutation> <value name="ARG0"> <block type="text_join" id="/]nFjJ*V?,1L}+ikLidn"> <mutation items="2"></mutation> <value name="ADD0"> <block type="variables_get" id="DVQ(]$VQWMa3!,ctO|@F"> <field name="VAR" id="Z{~*0luN#Qp/IUr;|BmX" variabletype="">Unterverzeichnis</field> </block> </value> <value name="ADD1"> <block type="variables_get" id="PKi7wPxc{rqKb6TPkp]T"> <field name="VAR" id="P}P_1?s%S89=9|ppf`Nx" variabletype="">Station</field> </block> </value> </block> </value> <value name="ARG1"> <block type="get_attr" id="[~%j%o--Nt|NFV@qEKqh"> <value name="PATH"> <shadow type="text" id="jxgr+n+8z3FUw)#lEB]V"> <field name="TEXT">name</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="^0*;qw)@bh9Y1A9p$?:*"> <field name="VAR" id="9k8j[#@42,2VE~mdj%7," variabletype="">obj</field> </block> </value> </block> </value> <next> <block type="variables_set" id="UqPDAi3CC{PQ+5oJiX7F"> <field name="VAR" id="%VO!Ye}Fho*S1ssX{uog" variabletype="">sensors</field> <value name="VALUE"> <block type="get_attr" id="k.R(q@m(G%T3m]:3/-$%"> <value name="PATH"> <shadow type="text" id="v3C!U:sJgWJC.%RK*ubN"> <field name="TEXT">sensors</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="2b4dq3po@?YS8+M=)*Y,"> <field name="VAR" id="9k8j[#@42,2VE~mdj%7," variabletype="">obj</field> </block> </value> </block> </value> <next> <block type="timeouts_settimeout" id="3NS1-CM^#*QWXC+vVM[T"> <field name="NAME">timeout</field> <field name="DELAY">500</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="controls_for" id="tj[*c^1-8U9Q:GJ?ErBG"> <field name="VAR" id="rn64I/AwPbPo#;6x;zx$" variabletype="">i</field> <value name="FROM"> <shadow type="math_number" id="gf_Y7J$2ww(]9~i4BD|I"> <field name="NUM">1</field> </shadow> </value> <value name="TO"> <shadow type="math_number" id="(M`)O/FN7c2d_#=ba0@l"> <field name="NUM">10</field> </shadow> <block type="lists_length" id="/AY%TvY!+^95Nnz)9uUS"> <value name="VALUE"> <block type="variables_get" id="ynt:^S)7},aLfA}tLrz5"> <field name="VAR" id="%VO!Ye}Fho*S1ssX{uog" variabletype="">sensors</field> </block> </value> </block> </value> <value name="BY"> <shadow type="math_number" id="MUBmM!QpFpwUSOLGoIWX"> <field name="NUM">1</field> </shadow> </value> <statement name="DO"> <block type="procedures_callnoreturn" id="v!l/^Y~lO,1U}^]L8lce"> <mutation name="Sensorwerte_auslesen"> <arg name="sensor"></arg> </mutation> <value name="ARG0"> <block type="lists_getIndex" id="C2FF;yAA@6_C1S76U7C^"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="p8m7.WuO[PRw@XT$eFoO"> <field name="VAR" id="%VO!Ye}Fho*S1ssX{uog" variabletype="">sensors</field> </block> </value> <value name="AT"> <block type="variables_get" id="U!)nYCJ71|QZKK_18r_`"> <field name="VAR" id="rn64I/AwPbPo#;6x;zx$" variabletype="">i</field> </block> </value> </block> </value> </block> </statement> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> <block type="procedures_defnoreturn" id="=x|n[F+0Ffd=3R25^)BO" x="138" y="-237"> <mutation> <arg name="sensor" varid="(OS6)At}0sRw3rBe4]ua"></arg> </mutation> <field name="NAME">Sensorwerte_auslesen</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="variables_set" id="u*oWBI50DRa@5Jq2ix11"> <field name="VAR" id="I@-[Cj^I1}(-7m+VQ8Dj" variabletype="">idSensor</field> <value name="VALUE"> <block type="text_join" id="xT@ken$pI)`7jm?z}3{W"> <mutation items="6"></mutation> <value name="ADD0"> <block type="variables_get" id="]b;M+`Nh`:~xD,EO{c)u"> <field name="VAR" id="Z{~*0luN#Qp/IUr;|BmX" variabletype="">Unterverzeichnis</field> </block> </value> <value name="ADD1"> <block type="variables_get" id="-hrKM3^f7j|T9rpuV4G#"> <field name="VAR" id="P}P_1?s%S89=9|ppf`Nx" variabletype="">Station</field> </block> </value> <value name="ADD2"> <block type="text" id="1LTqt!PGPEJAiFGPPP?r"> <field name="TEXT">.</field> </block> </value> <value name="ADD3"> <block type="procedures_callcustomreturn" id="M!nMAe^g4b,?)$@!fwkE"> <mutation name="Punktkiller"> <arg name="str"></arg> </mutation> <value name="ARG0"> <block type="get_attr" id="5}0nqRuX`7R08eW*^IBN"> <value name="PATH"> <shadow type="text" id="7G2x!o3c5)f=1eEWV(xI"> <field name="TEXT">sensorType</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="#%QmzLw(G1)rCN1RW`na"> <field name="VAR" id="(OS6)At}0sRw3rBe4]ua" variabletype="">sensor</field> </block> </value> </block> </value> </block> </value> <value name="ADD4"> <block type="text" id="aCH6aN^+-()+-Z,9P1qc"> <field name="TEXT">.</field> </block> </value> <value name="ADD5"> <block type="procedures_callcustomreturn" id="]h^ME#v5[vEHu6BDWAw-"> <mutation name="Punktkiller"> <arg name="str"></arg> </mutation> <value name="ARG0"> <block type="get_attr" id="H}#Wvog1o@QshcHnGp0,"> <value name="PATH"> <shadow type="text" id="7O3)Y`bBMZiJ;^`T9]7_"> <field name="TEXT">title</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="hA4Lmnk?4{w-?)|n~j/z"> <field name="VAR" id="(OS6)At}0sRw3rBe4]ua" variabletype="">sensor</field> </block> </value> </block> </value> </block> </value> </block> </value> <next> <block type="controls_if" id="s$NJk]uP]Y5yAOT8A=H1"> <value name="IF0"> <block type="procedures_callcustomreturn" id="72HYING-9uU7xm`yh[XK"> <mutation name="erzeugeZahlDP"> <arg name="id"></arg> <arg name="Name"></arg> <arg name="unit"></arg> <arg name="init"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="OOs?a?hS^FnAI.$Qb?dU"> <field name="VAR" id="I@-[Cj^I1}(-7m+VQ8Dj" variabletype="">idSensor</field> </block> </value> <value name="ARG1"> <block type="get_attr" id="IER[s^cq8PlHqpH):2;$"> <value name="PATH"> <shadow type="text" id="RE!1h_[z_~VP(`#c2G0="> <field name="TEXT">title</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="hosnIqKj=x~_(RraXuHa"> <field name="VAR" id="(OS6)At}0sRw3rBe4]ua" variabletype="">sensor</field> </block> </value> </block> </value> <value name="ARG2"> <block type="logic_ternary" id="X{yi6@j2x(r^X4d7wZwE"> <value name="IF"> <block type="logic_compare" id="}FE:$MU1AQN0j9zq=c!,"> <field name="OP">EQ</field> <value name="A"> <block type="get_attr" id=";Jq[h?XCY+^Z,9h.Vxr}"> <value name="PATH"> <shadow type="text" id="jvc0IqD$D$Z:e!f-PM.:"> <field name="TEXT">unit</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="-6S(Jk)|[#ICNem.NqD3"> <field name="VAR" id="(OS6)At}0sRw3rBe4]ua" variabletype="">sensor</field> </block> </value> </block> </value> <value name="B"> <block type="text" id="aD/3@.~;DBTfy^9%[76n"> <field name="TEXT">Pa</field> </block> </value> </block> </value> <value name="THEN"> <block type="text" id="Z6JADP_!`r`E(~n|9a9U"> <field name="TEXT">hPa</field> </block> </value> <value name="ELSE"> <block type="convert_tostring" id="tU]L2,(L9+[.?C9XGI3_"> <value name="VALUE"> <block type="get_attr" id="i~xMFt$R9!bt^Wm-d{BC"> <value name="PATH"> <shadow type="text" id="3;f9XPL?/VGf({2?U;Nc"> <field name="TEXT">unit</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="-Q04J]Rv}KKQHyT+Deuo"> <field name="VAR" id="(OS6)At}0sRw3rBe4]ua" variabletype="">sensor</field> </block> </value> </block> </value> </block> </value> </block> </value> <value name="ARG3"> <block type="logic_ternary" id="k;?J)oJ%`3ZRFrCC(}W$"> <value name="IF"> <block type="logic_compare" id="DTtaL]qqV=Ub{/ou@[f/"> <field name="OP">EQ</field> <value name="A"> <block type="get_attr" id="eZhy#[$[0RnwX_$q(z]/"> <value name="PATH"> <shadow type="text" id="Q?nIT*BSA($yWx8,hizs"> <field name="TEXT">unit</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="|n-M+c.C|jEabCb[^I!5"> <field name="VAR" id="(OS6)At}0sRw3rBe4]ua" variabletype="">sensor</field> </block> </value> </block> </value> <value name="B"> <block type="text" id="i`S=`k`l(NTfM@B`p:m^"> <field name="TEXT">Pa</field> </block> </value> </block> </value> <value name="THEN"> <block type="math_rndfixed" id="$XMq1#!Ia(xs#7gkNXps" inline="false"> <field name="n">1</field> <value name="x"> <shadow type="math_number" id="1yA`y-}#_r{O,eT`b;^u"> <field name="NUM">3.1234</field> </shadow> <block type="math_arithmetic" id="y^jH.dm*67o9fVxJU5@H" inline="false"> <field name="OP">DIVIDE</field> <value name="A"> <shadow type="math_number" id="(KD!_QMa_d{ENxR]A{@m"> <field name="NUM">1</field> </shadow> <block type="convert_tonumber" id="4,K%a9OH0W?Iy;L0NBU("> <value name="VALUE"> <block type="get_attr" id="4hf;_n]ay}NcbCK$pj(F" inline="false"> <value name="PATH"> <shadow type="text" id="2:mlq(Yt*3qv.GB=7V{a"> <field name="TEXT">lastMeasurement.value</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="(u4qHCP_X)uDj5KV/H!k"> <field name="VAR" id="(OS6)At}0sRw3rBe4]ua" variabletype="">sensor</field> </block> </value> </block> </value> </block> </value> <value name="B"> <shadow type="math_number" id="E4flj~g+cc,^AnP!3Y.Z"> <field name="NUM">100</field> </shadow> </value> </block> </value> </block> </value> <value name="ELSE"> <block type="math_rndfixed" id="6h!?D+j!.pcXVcp_8@C;" inline="false"> <field name="n">1</field> <value name="x"> <shadow type="math_number" id="1yA`y-}#_r{O,eT`b;^u"> <field name="NUM">3.1234</field> </shadow> <block type="convert_tonumber" id="LD]VJ;8OO)))WVv_S2?="> <value name="VALUE"> <block type="get_attr" id="XWtSG4Seu_[SUN@7?m(-" inline="false"> <value name="PATH"> <shadow type="text" id="4hwHA|{yYYA}S=^k~g3O"> <field name="TEXT">lastMeasurement.value</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="2yY`7x*L{ynpIy{[a9fL"> <field name="VAR" id="(OS6)At}0sRw3rBe4]ua" variabletype="">sensor</field> </block> </value> </block> </value> </block> </value> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="control_ex" id="ND8z?hF|iwiOE9Z$|eE`"> <field name="TYPE">true</field> <field name="CLEAR_RUNNING">FALSE</field> <value name="OID"> <shadow type="field_oid" id="v(.[s!{pa`7H$cGZ;#p|"> <field name="oid">Object ID</field> </shadow> <block type="variables_get" id="BrQ|?@hXv_fV)?E?hOgM"> <field name="VAR" id="I@-[Cj^I1}(-7m+VQ8Dj" variabletype="">idSensor</field> </block> </value> <value name="VALUE"> <shadow type="logic_boolean" id="|a{Y{[:aCSj^Q?yicY#*"> <field name="BOOL">TRUE</field> </shadow> <block type="logic_ternary" id="6E3V~CdJFy%8!wy##*a#"> <value name="IF"> <block type="logic_compare" id="O6q%{@!cHYh8`$x`2fA$"> <field name="OP">EQ</field> <value name="A"> <block type="get_attr" id="{~=Y.%P~2,|4*2^JbZ*p"> <value name="PATH"> <shadow type="text" id="t7FkP$/$emT%_4N_S_5Q"> <field name="TEXT">unit</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="CsZwX)34~VBzZfFKp=We"> <field name="VAR" id="(OS6)At}0sRw3rBe4]ua" variabletype="">sensor</field> </block> </value> </block> </value> <value name="B"> <block type="text" id="=8my%:z:_p1Zp20qC1+-"> <field name="TEXT">Pa</field> </block> </value> </block> </value> <value name="THEN"> <block type="math_rndfixed" id="ZwEqt=.:zM7Fh,FCupUh" inline="false"> <field name="n">1</field> <value name="x"> <shadow type="math_number" id="1yA`y-}#_r{O,eT`b;^u"> <field name="NUM">3.1234</field> </shadow> <block type="math_arithmetic" id="p^(k%B8L:beLF.bXnCO:" inline="false"> <field name="OP">DIVIDE</field> <value name="A"> <shadow type="math_number" id="(KD!_QMa_d{ENxR]A{@m"> <field name="NUM">1</field> </shadow> <block type="convert_tonumber" id="gu42,QA@%Qk)DjR9RZX)"> <value name="VALUE"> <block type="get_attr" id="K{~1z(MlY3F,z);71z;x" inline="false"> <value name="PATH"> <shadow type="text" id="GPEuFL5ucLoy?N!k?ET!"> <field name="TEXT">lastMeasurement.value</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="/G;!H$X7CX}]`widv=x8"> <field name="VAR" id="(OS6)At}0sRw3rBe4]ua" variabletype="">sensor</field> </block> </value> </block> </value> </block> </value> <value name="B"> <shadow type="math_number" id=",I;tb_;FA6U!PB{C}/=O"> <field name="NUM">100</field> </shadow> </value> </block> </value> </block> </value> <value name="ELSE"> <block type="math_rndfixed" id="u#Pps!@-djj#52`#53{U" inline="false"> <field name="n">1</field> <value name="x"> <shadow type="math_number" id="1yA`y-}#_r{O,eT`b;^u"> <field name="NUM">3.1234</field> </shadow> <block type="convert_tonumber" id="P(=Kapc@m7(gRg:kcCja"> <value name="VALUE"> <block type="get_attr" id=":rY)@z|S1LEqFV-F]t}8" inline="false"> <value name="PATH"> <shadow type="text" id="[U?(%i@42IJ|zv%`/hK5"> <field name="TEXT">lastMeasurement.value</field> </shadow> </value> <value name="OBJECT"> <block type="variables_get" id="7xFK#y#`r/HIa{g:)0)E"> <field name="VAR" id="(OS6)At}0sRw3rBe4]ua" variabletype="">sensor</field> </block> </value> </block> </value> </block> </value> </block> </value> </block> </value> <value name="DELAY_MS"> <shadow type="math_number" id="NXOOrA8-^iM:{:I/L?|-"> <field name="NUM">0</field> </shadow> </value> </block> </statement> </block> </next> </block> </statement> </block> </xml>
Änderungen
- Abfangen von Werten in Pa, werden in hPa umgerechnet
- Datenpunkte werden beim Anlegen direkt mit Werten erstellt.
-
@Homoran Also muss man für jeden Sensor auf der 'Map ein eigenes Script anlegen, soweit klar und Funktioniert auch, aber der Stationsname wird jetzt nirgendwo verwendet bei mir. Ist das so richtig? Ich fänd es schon gut wenn der Irgendwo in den Datenpunkten auftauchen würde.
-
@Beliar_666 sagte in Luft-Messdaten von OpenSenseMap auslesen:
aber der Stationsname wird jetzt nirgendwo verwendet bei mir. Ist das so richtig?
Nope, ist es nicht!
So sollte es aussehen:
Hier "MAP1" (inzwischen auch CHANNEL und nicht mehr STATE)
Sollte der Datenpunkt der Station-ID bereits vor der Versionsänderung angelegt worden sien, muss er einmalig gelöscht werden, damit ID und Name beim nächsten Aufruf erscheint
-
@Homoran sagte in Luft-Messdaten von OpenSenseMap auslesen:
Nope, ist es nicht!
So schaut es bei mir aus.... angelegt ca. 15.00 Uhr.
-
@Beliar_666 sagte:
So schaut es bei mir aus
Ich vermute mal, Du hast setObject in der Konfiguration der JS-Instanz nicht freigegeben ?
-
@paul53 sagte in Luft-Messdaten von OpenSenseMap auslesen:
Ich vermute mal, Du hast setObject in der Konfiguration der JS-Instanz nicht freigegeben ?
Nein das war es nicht, aber das Script macht irgendwo einen Fehler:
Er legt mit quasi in Java 0 ein neues Java0 an ??? Aber die eigentlichen Daten schreibt er genau dahin wo ich sie haben will....
-
@Beliar_666 sagte in Luft-Messdaten von OpenSenseMap auslesen:
Er legt mit quasi in Java 0 ein neues Java0 an ???
ok!
Da soll auch nur das UNTERVERZEICHNIS von javascript.0 rein nicht der gesamte BaumDeswegen steht da:
Hier Unterverzeichnis im js-Verzeichnis eingeben
-
@Beliar_666
Die Variable Unterverzeichnis darf nicht "javascript.0." am Anfang enthalten ! -
-
Gestern habe ich 2 Stationen einprogrammiert. Die laufen sauber durch. Vielen Dank!