Ist zwar schon vorbei...
Ich brauchte diese Berechnung, da die Weihnachtsbeleuchtung ab 1. Advent leuchten sollte und da es (zumindest für mich) nicht so einfach war, hier mal für alle.
Vielleicht geht es eleganter, es funktioniert jedenfalls:
Spoiler
<xml xmlns="http://www.w3.org/1999/xhtml ">
<variables>
<variable type="" id="h#@yoh[f1Pz,BotHhhT4">25.Dezember</variable>
<variable type="" id="v9@J:+ywDiYh/WJT^y5H">1.Advent</variable>
</variables>
<block type="variables_set" id="NY6^GDJs#a^@fGxV_9$Q" x="-537" y="-862">
<field name="VAR" id="h#@yoh[f1Pz,BotHhhT4" variabletype="">25.Dezember</field>
<value name="VALUE">
<block type="convert_from_date" id="HJTp,F+=gs3HW$9B.#/"> <mutation format="false" language="false"></mutation> <field name="OPTION">object</field> <value name="VALUE"> <block type="text_join" id="AcIS0Y-tgB6%jATs^(]n" inline="true"> <mutation items="2"></mutation> <value name="ADD0"> <block type="time_get" id="{[Q,EmotO1UQ9AiSFFT-"> <mutation format="false" language="false"></mutation> <field name="OPTION">fy</field> </block> </value> <value name="ADD1"> <block type="text" id="*V:yEm-|V^~@.7oxngPM"> <field name="TEXT">-12-25</field> </block> </value> </block> </value> </block> </value> <next> <block type="variables_set" id="1=#+BSHb=Q8ftkK=fItB"> <field name="VAR" id="v9@J:+ywDiYh/WJT^y5H" variabletype="">1.Advent</field> <value name="VALUE"> <block type="math_arithmetic" id="V[qs.K.g7xbV@$/EZ1NH" inline="false"> <field name="OP">MINUS</field> <value name="A"> <shadow type="math_number" id="()M?ccWD9lo.6KoGkou?"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="HyKfVn$Y-sRHrz@^x@{!"> <field name="VAR" id="h#@yoh[f1Pz,BotHhhT4" variabletype="">25.Dezember</field> </block> </value> <value name="B"> <shadow type="math_number" id="Ytk)V9a1?P+%bl^l6n0D"> <field name="NUM">1</field> </shadow> <block type="math_arithmetic" id="vnIwCBAdDv4js;dJP!8_" inline="false"> <field name="OP">MULTIPLY</field> <value name="A"> <shadow type="math_number" id="N-tB+/4v+R#L.;_]I?T5"> <field name="NUM">86400000</field> </shadow> </value> <value name="B"> <shadow type="math_number" id="i5V,(*Q{Yph~r82+/{!">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="]Ob*;X*|+RD5AA?,?wEg" inline="false">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id="t}qS.[{{*~=8gnh-;PMe">
<field name="NUM">1</field>
</shadow>
<block type="convert_from_date" id="v$aLf?w1}1 P)7-}s}"> <mutation format="false" language="false"></mutation> <field name="OPTION">wd</field> <value name="VALUE"> <block type="variables_get" id="CNAcbM%=ywOaZHk~bk,;"> <field name="VAR" id="h#@yoh[f1Pz,BotHhhT4" variabletype="">25.Dezember</field> </block> </value> </block> </value> <value name="B"> <shadow type="math_number" id="wE8c;D$?!=/M~s19,:iO"> <field name="NUM">21</field> </shadow> </value> </block> </value> </block> </value> </block> </value> </block> </next> </block> <block type="debug" id=")E_wH59tJ}TW5l+m|O." x="-537" y="-613">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="bse51-93..ca]YlXfFzp">
<field name="TEXT">test</field>
</shadow>
<block type="convert_from_date" id="_;gl6G%es/_pIA?v5:=@">
<mutation format="false" language="false"></mutation>
<field name="OPTION">DD.MM.YYYY</field>
<value name="VALUE">
<block type="variables_get" id="#tKaiB%]e)QvU?m#S3z;">
<field name="VAR" id="v9@J:+ywDiYh/WJT^y5H" variabletype="">1.Advent</field>
</block>
</value>
</block>
</value>
</block>
</xml>
Ist zwar schon vorbei...
Ich brauchte diese Berechnung, da die Weihnachtsbeleuchtung ab 1. Advent leuchten sollte und da es (zumindest für mich) nicht so einfach war, hier mal für alle.
Vielleicht geht es eleganter, es funktioniert jedenfalls:
Spoiler
<xml xmlns="http://www.w3.org/1999/xhtml ">
<variables>
<variable type="" id="h#@yoh[f1Pz,BotHhhT4">25.Dezember</variable>
<variable type="" id="v9@J:+ywDiYh/WJT^y5H">1.Advent</variable>
</variables>
<block type="variables_set" id="NY6^GDJs#a^@fGxV_9$Q" x="-537" y="-862">
<field name="VAR" id="h#@yoh[f1Pz,BotHhhT4" variabletype="">25.Dezember</field>
<value name="VALUE">
<block type="convert_from_date" id="HJTp,F+=gs3HW$9B.#/"> <mutation format="false" language="false"></mutation> <field name="OPTION">object</field> <value name="VALUE"> <block type="text_join" id="AcIS0Y-tgB6%jATs^(]n" inline="true"> <mutation items="2"></mutation> <value name="ADD0"> <block type="time_get" id="{[Q,EmotO1UQ9AiSFFT-"> <mutation format="false" language="false"></mutation> <field name="OPTION">fy</field> </block> </value> <value name="ADD1"> <block type="text" id="*V:yEm-|V^~@.7oxngPM"> <field name="TEXT">-12-25</field> </block> </value> </block> </value> </block> </value> <next> <block type="variables_set" id="1=#+BSHb=Q8ftkK=fItB"> <field name="VAR" id="v9@J:+ywDiYh/WJT^y5H" variabletype="">1.Advent</field> <value name="VALUE"> <block type="math_arithmetic" id="V[qs.K.g7xbV@$/EZ1NH" inline="false"> <field name="OP">MINUS</field> <value name="A"> <shadow type="math_number" id="()M?ccWD9lo.6KoGkou?"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="HyKfVn$Y-sRHrz@^x@{!"> <field name="VAR" id="h#@yoh[f1Pz,BotHhhT4" variabletype="">25.Dezember</field> </block> </value> <value name="B"> <shadow type="math_number" id="Ytk)V9a1?P+%bl^l6n0D"> <field name="NUM">1</field> </shadow> <block type="math_arithmetic" id="vnIwCBAdDv4js;dJP!8_" inline="false"> <field name="OP">MULTIPLY</field> <value name="A"> <shadow type="math_number" id="N-tB+/4v+R#L.;_]I?T5"> <field name="NUM">86400000</field> </shadow> </value> <value name="B"> <shadow type="math_number" id="i5V,(*Q{Yph~r82+/{!">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="]Ob*;X*|+RD5AA?,?wEg" inline="false">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id="t}qS.[{{*~=8gnh-;PMe">
<field name="NUM">1</field>
</shadow>
<block type="convert_from_date" id="v$aLf?w1}1 P)7-}s}"> <mutation format="false" language="false"></mutation> <field name="OPTION">wd</field> <value name="VALUE"> <block type="variables_get" id="CNAcbM%=ywOaZHk~bk,;"> <field name="VAR" id="h#@yoh[f1Pz,BotHhhT4" variabletype="">25.Dezember</field> </block> </value> </block> </value> <value name="B"> <shadow type="math_number" id="wE8c;D$?!=/M~s19,:iO"> <field name="NUM">21</field> </shadow> </value> </block> </value> </block> </value> </block> </value> </block> </next> </block> <block type="debug" id=")E_wH59tJ}TW5l+m|O." x="-537" y="-613">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="bse51-93..ca]YlXfFzp">
<field name="TEXT">test</field>
</shadow>
<block type="convert_from_date" id="_;gl6G%es/_pIA?v5:=@">
<mutation format="false" language="false"></mutation>
<field name="OPTION">DD.MM.YYYY</field>
<value name="VALUE">
<block type="variables_get" id="#tKaiB%]e)QvU?m#S3z;">
<field name="VAR" id="v9@J:+ywDiYh/WJT^y5H" variabletype="">1.Advent</field>
</block>
</value>
</block>
</value>
</block>
</xml>
@fredf Auch wenn es schon paar Jährchen her ist, sage ich Danke. Genau sowas habe ich heute gesucht, Google hat das ausgespuckt und es funktioniert. Perfekt!
Gruss, Jürgen
Ist zwar schon vorbei...
Ich brauchte diese Berechnung, da die Weihnachtsbeleuchtung ab 1. Advent leuchten sollte und da es (zumindest für mich) nicht so einfach war, hier mal für alle.
Vielleicht geht es eleganter, es funktioniert jedenfalls:
Spoiler
<xml xmlns="http://www.w3.org/1999/xhtml ">
<variables>
<variable type="" id="h#@yoh[f1Pz,BotHhhT4">25.Dezember</variable>
<variable type="" id="v9@J:+ywDiYh/WJT^y5H">1.Advent</variable>
</variables>
<block type="variables_set" id="NY6^GDJs#a^@fGxV_9$Q" x="-537" y="-862">
<field name="VAR" id="h#@yoh[f1Pz,BotHhhT4" variabletype="">25.Dezember</field>
<value name="VALUE">
<block type="convert_from_date" id="HJTp,F+=gs3HW$9B.#/"> <mutation format="false" language="false"></mutation> <field name="OPTION">object</field> <value name="VALUE"> <block type="text_join" id="AcIS0Y-tgB6%jATs^(]n" inline="true"> <mutation items="2"></mutation> <value name="ADD0"> <block type="time_get" id="{[Q,EmotO1UQ9AiSFFT-"> <mutation format="false" language="false"></mutation> <field name="OPTION">fy</field> </block> </value> <value name="ADD1"> <block type="text" id="*V:yEm-|V^~@.7oxngPM"> <field name="TEXT">-12-25</field> </block> </value> </block> </value> </block> </value> <next> <block type="variables_set" id="1=#+BSHb=Q8ftkK=fItB"> <field name="VAR" id="v9@J:+ywDiYh/WJT^y5H" variabletype="">1.Advent</field> <value name="VALUE"> <block type="math_arithmetic" id="V[qs.K.g7xbV@$/EZ1NH" inline="false"> <field name="OP">MINUS</field> <value name="A"> <shadow type="math_number" id="()M?ccWD9lo.6KoGkou?"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="HyKfVn$Y-sRHrz@^x@{!"> <field name="VAR" id="h#@yoh[f1Pz,BotHhhT4" variabletype="">25.Dezember</field> </block> </value> <value name="B"> <shadow type="math_number" id="Ytk)V9a1?P+%bl^l6n0D"> <field name="NUM">1</field> </shadow> <block type="math_arithmetic" id="vnIwCBAdDv4js;dJP!8_" inline="false"> <field name="OP">MULTIPLY</field> <value name="A"> <shadow type="math_number" id="N-tB+/4v+R#L.;_]I?T5"> <field name="NUM">86400000</field> </shadow> </value> <value name="B"> <shadow type="math_number" id="i5V,(*Q{Yph~r82+/{!">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="]Ob*;X*|+RD5AA?,?wEg" inline="false">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id="t}qS.[{{*~=8gnh-;PMe">
<field name="NUM">1</field>
</shadow>
<block type="convert_from_date" id="v$aLf?w1}1 P)7-}s}"> <mutation format="false" language="false"></mutation> <field name="OPTION">wd</field> <value name="VALUE"> <block type="variables_get" id="CNAcbM%=ywOaZHk~bk,;"> <field name="VAR" id="h#@yoh[f1Pz,BotHhhT4" variabletype="">25.Dezember</field> </block> </value> </block> </value> <value name="B"> <shadow type="math_number" id="wE8c;D$?!=/M~s19,:iO"> <field name="NUM">21</field> </shadow> </value> </block> </value> </block> </value> </block> </value> </block> </next> </block> <block type="debug" id=")E_wH59tJ}TW5l+m|O." x="-537" y="-613">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="bse51-93..ca]YlXfFzp">
<field name="TEXT">test</field>
</shadow>
<block type="convert_from_date" id="_;gl6G%es/_pIA?v5:=@">
<mutation format="false" language="false"></mutation>
<field name="OPTION">DD.MM.YYYY</field>
<value name="VALUE">
<block type="variables_get" id="#tKaiB%]e)QvU?m#S3z;">
<field name="VAR" id="v9@J:+ywDiYh/WJT^y5H" variabletype="">1.Advent</field>
</block>
</value>
</block>
</value>
</block>
</xml>
@fredf Cool!
Leider verstehe ich es nicht.
Wo kommt denn die "86400000" her?
Was wird da warum addiert?
@fredf Cool!
Leider verstehe ich es nicht.
Wo kommt denn die "86400000" her?
Was wird da warum addiert?
@schnotzler sagte: Wo kommt denn die "86400000" her?
Ein Tag hat 86400000 ms.
@schnotzler sagte: Wo kommt denn die "86400000" her?
Ein Tag hat 86400000 ms.
@paul53 Da wäre ich jetzt nie darauf gekommen. :-)
Von Minuten bis Sekunden habe ich es schon Versucht aber auf die Idee mit ms bin ich leider nicht gekommen
Danke
Auch das Script von
https://forum.iobroker.net/post/1089798
ist nicht schlecht.
Gleich mit Anzahl der Kerzen für die Visu.
Mit leichter Anpassung gut nutzbar.
Hey! Du scheinst an dieser Unterhaltung interessiert zu sein, hast aber noch kein Konto.
Hast du es satt, bei jedem Besuch durch die gleichen Beiträge zu scrollen? Wenn du dich für ein Konto anmeldest, kommst du immer genau dorthin zurück, wo du zuvor warst, und kannst dich über neue Antworten benachrichtigen lassen (entweder per E-Mail oder Push-Benachrichtigung). Du kannst auch Lesezeichen speichern und Beiträge positiv bewerten, um anderen Community-Mitgliedern deine Wertschätzung zu zeigen.
Mit deinem Input könnte dieser Beitrag noch besser werden 💗
Registrieren
Anmelden