@haus-automatisierung
Hallo Matthias(?),
danke für dein Geburtstagsadapter. Auf jeden Fall eine gute Idee!
Für mich habe ich bereits eine Lösung gebastelt und werde deshalb deinen Adapter erstmal nur aus Interesse weiter im Auge behalten.
Ich beschreibe aber, was für mich bei meiner Lösung wichtig war und evtl. wirst du dann ein paar Sachen auch in dein Adapter übernehmen
Als Adapter benutze ich iCal. Für mich wichtig ist, dass ich mehrere iCal Kalender verwenden kann. Ich habe für die Verwandten mütterlicherseits und väterlicherseits eigene Kalender erstellt und auch geteilt. Das alles nochmal in 1x Kalender zu kopieren und zu pflegen wäre nicht gut.
Die Pflege der Kalender läuft über Google. Hier ist dein Lösung neue Einträge direkt im Adapter hinzuzufügen natürlich sehr elegant.
Die weitere "Logik" läuft bei mir über Blockly (zähle mich noch zu den Anfängern). Dort wird täglich um 9 Uhr der Inhalt des iCal Adapters geprüft. Bei Einträgen wird geschaut, um was genau es sich dabei handelt. Und nun kommt das, was ich bei deinem Adapter noch als Ergänzung sehr gut finden würde:
Ich speichere/werte aus nicht nur die Geburtstage, sondern auch die Hochzeitstage. Evtl. würde jemand noch weitere Kategorien sich wünschen? (Taufe, Todestag, ...).
Die Logik exportiert sich den Namen und das Jahr heraus und errechnet, wie viele Jahre seit dem Ereignis vergangen sind (so wie bei dir auch). Entsprechend der verwendeten Kategorie unterscheidet sich dann aber der Ausgabestring. Bei Geburtstagen wird bei mir ausgegeben: "Max Mustermann feiert heute seinen 35. Geburtstag". Bei Hochzeitstagen entsprechend "Erika & Max Mustermann feiern heute ihren 35. Hochzeitstag".
Der String wird mir dann per Whatsapp ans Handy geschickt.
Um die Werte aus dem Kalender richtig zu deuten, habe ich mir folgendes Muster definiert, der als Titel eines Termins eingetragen werden muss:
[Geburtstag] Vorname Nachname (Jahr)
[Hochzeit] Vorname & Vorname Nachname (Jahr)
Vollständigkeitshalber kurze Antworten auf deine Fragen:
1: Ereignisse des heutigen Tages reichen aus. Max. Ereignisse des nächsten Tages wären irgendwann nützlich
2: 1. Datenpunkt wäre ausreichend
3: nein, keine eigene Datenpunkte pro Kontakt
Blockly:
Spoiler
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable id="@?Xc):9iG:J/]=bM%`au">Termin</variable>
<variable id="SmxdBUcC@lmI5;!2L@Sd">inhalt</variable>
<variable id="wN_6?S]aB3*`~sntp!b1">ereignis</variable>
<variable id="wLB{|i]+{e-|AL3XFgWB">person</variable>
<variable id="0%D)uB5.HJ=rUU~$_0d2">jahr</variable>
<variable id="]9bf#tCn2o:A^e)kEbU[">nachricht</variable>
</variables>
<block type="schedule" id="l_u9v)i4)I7G%3TwYdJ~" x="88" y="14">
<field name="SCHEDULE">55 9 * * *</field>
<statement name="STATEMENT">
<block type="control" id="|zYa]3*PNG.${]^YhFD!">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">ical.0.trigger</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="text" id="Tg6(L=R:of2ue#G$I[GZ">
<field name="TEXT">read</field>
</block>
</value>
</block>
</statement>
<next>
<block type="schedule" id="Nvc@QfXlUzC/0tAQO[gT">
<field name="SCHEDULE">0 10 * * *</field>
<statement name="STATEMENT">
<block type="controls_if" id="1nHw0.=uY6UFm2CH24Hz">
<value name="IF0">
<block type="logic_compare" id="-5yV}Ft`heli##4`.#m{">
<field name="OP">GT</field>
<value name="A">
<block type="get_value" id="q/T8.G*eN%mG}S[zf#5Y">
<field name="ATTR">val</field>
<field name="OID">ical.0.data.count</field>
</block>
</value>
<value name="B">
<block type="math_number" id="5=}l/53$pH~s4YOkMV,D">
<field name="NUM">0</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="controls_forEach" id="=f^,ZE/~ps8ag^4W!a61">
<field name="VAR" id="@?Xc):9iG:J/]=bM%`au">Termin</field>
<value name="LIST">
<block type="get_value" id="|1v%GgBl/l{fpomYnHxF">
<field name="ATTR">val</field>
<field name="OID">ical.0.data.table</field>
</block>
</value>
<statement name="DO">
<block type="variables_set" id="/H5xgeb+7WpF]ojYw4$1">
<field name="VAR" id="SmxdBUcC@lmI5;!2L@Sd">inhalt</field>
<value name="VALUE">
<block type="get_attr" id="L|Q+L]A{1OlPo]#|(FFI">
<value name="PATH">
<shadow type="text" id="i0B$yHV1Gu|ZK|-0zlu#">
<field name="TEXT">event</field>
</shadow>
</value>
<value name="OBJECT">
<block type="variables_get" id="hdlc-2/U*I~7Ed0Ew*bE">
<field name="VAR" id="@?Xc):9iG:J/]=bM%`au">Termin</field>
</block>
</value>
</block>
</value>
<next>
<block type="variables_set" id="O]}_jGg`kWGE,/4Z6Cr-">
<field name="VAR" id="wN_6?S]aB3*`~sntp!b1">ereignis</field>
<value name="VALUE">
<block type="text_getSubstring" id="epYBlB?*W%1=4-4KmQUs" inline="false">
<mutation at1="true" at2="true"></mutation>
<field name="WHERE1">FROM_START</field>
<field name="WHERE2">FROM_START</field>
<value name="STRING">
<block type="variables_get" id="b8*vbT,y#]QR!cO]~XAZ">
<field name="VAR" id="SmxdBUcC@lmI5;!2L@Sd">inhalt</field>
</block>
</value>
<value name="AT1">
<block type="math_arithmetic" id="egV3}~MzT{-GDcY}8^^b">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id="AdPfX_8Mz5~B~:rvbETM">
<field name="NUM">1</field>
</shadow>
<block type="text_indexOf" id="i2M83I1vlF{ctPup=1eJ">
<field name="END">FIRST</field>
<value name="VALUE">
<block type="variables_get" id="pruW*.mM_J#B}SE7a8Jr">
<field name="VAR" id="SmxdBUcC@lmI5;!2L@Sd">inhalt</field>
</block>
</value>
<value name="FIND">
<shadow type="text" id="@PirB?rRU_s1*m0;ihSF">
<field name="TEXT">[</field>
</shadow>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="Kw-FQ].m-5w]IIU]aDVf">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</value>
<value name="AT2">
<block type="math_arithmetic" id="r*=d)1On/X?cg=).h[ed">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number" id="uB1wIwD}W{Vb@U;_fR}b">
<field name="NUM">1</field>
</shadow>
<block type="text_indexOf" id="Df(m4-Zh^rQF9H5@{}`u">
<field name="END">FIRST</field>
<value name="VALUE">
<block type="variables_get" id="?cOnlU;;OD]U2p^x|^R^">
<field name="VAR" id="SmxdBUcC@lmI5;!2L@Sd">inhalt</field>
</block>
</value>
<value name="FIND">
<shadow type="text" id="Q#}=O?LB!Vn#g2dR+Ao@">
<field name="TEXT">]</field>
</shadow>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="YMnC1}%sHtZGU2[([bt|">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
<next>
<block type="variables_set" id="8J4sy/*!Q^xb4cML[20Y">
<field name="VAR" id="wLB{|i]+{e-|AL3XFgWB">person</field>
<value name="VALUE">
<block type="text_getSubstring" id="(@e^[0o8P~1hpWt%*K!*" inline="false">
<mutation at1="true" at2="true"></mutation>
<field name="WHERE1">FROM_START</field>
<field name="WHERE2">FROM_START</field>
<value name="STRING">
<block type="variables_get" id="hzRcmE~~hcW7BDVp-6`~">
<field name="VAR" id="SmxdBUcC@lmI5;!2L@Sd">inhalt</field>
</block>
</value>
<value name="AT1">
<block type="math_arithmetic" id=",~5?^5$BCo@CesArK+_X">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id="!n(+DF,_;ugDxGHZ_MGk">
<field name="NUM">1</field>
</shadow>
<block type="text_indexOf" id="ZZ3sR.!ldc|XO,*,{sq2">
<field name="END">FIRST</field>
<value name="VALUE">
<block type="variables_get" id=".0B!(`o|@!f,MKFox0$[">
<field name="VAR" id="SmxdBUcC@lmI5;!2L@Sd">inhalt</field>
</block>
</value>
<value name="FIND">
<shadow type="text" id="BjABe*i02-l;!CxTP`x^">
<field name="TEXT">]</field>
</shadow>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="92@F01L_ZG?;ty_D{;b_">
<field name="NUM">2</field>
</shadow>
</value>
</block>
</value>
<value name="AT2">
<block type="math_arithmetic" id="wkrN/dAF2y;]?jg6w@N.">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number" id="$3QrG9@I^nk.$Td|%*cv">
<field name="NUM">1</field>
</shadow>
<block type="text_indexOf" id="R#1+C[CU5ssmB5BCXJ?g">
<field name="END">FIRST</field>
<value name="VALUE">
<block type="variables_get" id="Q}Hf}6`b0E:K6fZzk{?4">
<field name="VAR" id="SmxdBUcC@lmI5;!2L@Sd">inhalt</field>
</block>
</value>
<value name="FIND">
<shadow type="text" id="r[S%jTnE,+W-)a$T_%Kh">
<field name="TEXT">(</field>
</shadow>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="$!1;Q$Ht16GL2ECJY%?1">
<field name="NUM">2</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
<next>
<block type="variables_set" id="IA#UQ8{v{i)#COCL[Pz5">
<field name="VAR" id="0%D)uB5.HJ=rUU~$_0d2">jahr</field>
<value name="VALUE">
<block type="text_getSubstring" id="X5]gKMqYMJs(6$.pkjU_" inline="false">
<mutation at1="true" at2="true"></mutation>
<field name="WHERE1">FROM_START</field>
<field name="WHERE2">FROM_START</field>
<value name="STRING">
<block type="variables_get" id="[:8nde7B=}P`8sekg5MG">
<field name="VAR" id="SmxdBUcC@lmI5;!2L@Sd">inhalt</field>
</block>
</value>
<value name="AT1">
<block type="math_arithmetic" id="?m_i9=n:We{^/GK7v;{@">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id="1`-EnfdORO~*KlyEk#x|">
<field name="NUM">1</field>
</shadow>
<block type="text_indexOf" id="3KuSi?)$67_{TTRuEm*c">
<field name="END">FIRST</field>
<value name="VALUE">
<block type="variables_get" id="Lt]G/E+2X3#,IJ$%/VYm">
<field name="VAR" id="SmxdBUcC@lmI5;!2L@Sd">inhalt</field>
</block>
</value>
<value name="FIND">
<shadow type="text" id="-Z(/TKr~@`2BJ+od74B/">
<field name="TEXT">(</field>
</shadow>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="P0Vi~v-tOTM{p-lEQ9JJ">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</value>
<value name="AT2">
<block type="math_arithmetic" id=";)vC}[WZw@IO!l|R.pd;">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number" id="j$vrA_viX8mO^q[T_EcT">
<field name="NUM">1</field>
</shadow>
<block type="text_indexOf" id="|Kj-6{O:z{P5w$P/e7ex">
<field name="END">FIRST</field>
<value name="VALUE">
<block type="variables_get" id="Od%U$wXbO#T-l?3tg,Mw">
<field name="VAR" id="SmxdBUcC@lmI5;!2L@Sd">inhalt</field>
</block>
</value>
<value name="FIND">
<shadow type="text" id="`,ASuk,LCOV_g7nJXgxO">
<field name="TEXT">)</field>
</shadow>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="6EM/~+]e6qGHA^Zu7eMz">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
<next>
<block type="controls_if" id="w8$0(tSP/zMta]tT^DSn">
<mutation elseif="1"></mutation>
<value name="IF0">
<block type="logic_compare" id="SVH)),_Iuaw~/@DgYa*.">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="bB78wHvQj/nE,$e[72{n">
<field name="VAR" id="wN_6?S]aB3*`~sntp!b1">ereignis</field>
</block>
</value>
<value name="B">
<block type="text" id="ht83rL}Uf%~s~b5cY6Pz">
<field name="TEXT">Geburtstag</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="variables_set" id=":A9L#d(0nM2`w|uIzRmQ">
<field name="VAR" id="]9bf#tCn2o:A^e)kEbU[">nachricht</field>
<value name="VALUE">
<block type="text_join" id="+DT^#Ek8@5RbiZc(:)Gc">
<mutation items="5"></mutation>
<value name="ADD0">
<block type="text" id="j_;3ho8+a)PV~z#PHKol">
<field name="TEXT">🥳🎉 Heute feiert </field>
</block>
</value>
<value name="ADD1">
<block type="variables_get" id="F(DrZTt6D1l-6sgR,EnN">
<field name="VAR" id="wLB{|i]+{e-|AL3XFgWB">person</field>
</block>
</value>
<value name="ADD2">
<block type="text" id="?i|I+egI~dh)fNf[Yyia">
<field name="TEXT"> den </field>
</block>
</value>
<value name="ADD3">
<block type="math_arithmetic" id=":;?Sy|9HEU4A/H,eOC?P" inline="false">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number" id="C7E|RXa|q[?%=GgBbmKh">
<field name="NUM">1</field>
</shadow>
<block type="convert_tonumber" id="(gKTHpyk^c,kjAM_+@TH">
<value name="VALUE">
<block type="time_get" id="d}Ji3{w~*}M*Ksu|Cii|">
<mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
<field name="OPTION">fy</field>
</block>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="SZTzfHlwfm/}v9Zk/b!n">
<field name="NUM">1</field>
</shadow>
<block type="convert_tonumber" id="%:Pm-jOWmu?[Ww)s:hm%">
<value name="VALUE">
<block type="variables_get" id="lzskV2Ml^$L1k.#}Qu0O">
<field name="VAR" id="0%D)uB5.HJ=rUU~$_0d2">jahr</field>
</block>
</value>
</block>
</value>
</block>
</value>
<value name="ADD4">
<block type="text" id="1h5Z-Eyz{{YE[6uch$Tp">
<field name="TEXT">. Geburtstag</field>
</block>
</value>
</block>
</value>
</block>
</statement>
<value name="IF1">
<block type="logic_compare" id="OW7szAurUOG-l0FE^WgB">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="vFm,O?,xIx5(mIhwm`P6">
<field name="VAR" id="wN_6?S]aB3*`~sntp!b1">ereignis</field>
</block>
</value>
<value name="B">
<block type="text" id="%-jm/yhKNZ3jhIqDSMi1">
<field name="TEXT">Hochzeit</field>
</block>
</value>
</block>
</value>
<statement name="DO1">
<block type="variables_set" id="Te=ec9aJH2nTH@(E]*Ue">
<field name="VAR" id="]9bf#tCn2o:A^e)kEbU[">nachricht</field>
<value name="VALUE">
<block type="text_join" id="Gp)ycyj66ybhol@-~hgj">
<mutation items="5"></mutation>
<value name="ADD0">
<block type="text" id="x#8;TmDZMjzN/2%c{R*H">
<field name="TEXT">💑💍 Heute feiern </field>
</block>
</value>
<value name="ADD1">
<block type="variables_get" id="9/-?*bdLSpZoNi5!RWd7">
<field name="VAR" id="wLB{|i]+{e-|AL3XFgWB">person</field>
</block>
</value>
<value name="ADD2">
<block type="text" id="qHjL_[KS8968]Cs{`LE@">
<field name="TEXT"> ihren </field>
</block>
</value>
<value name="ADD3">
<block type="math_arithmetic" id="G$XNQ]q43anzw9[@*|iY" inline="false">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
<block type="convert_tonumber" id="qK@6NWKKj%];D:ze2V#(">
<value name="VALUE">
<block type="time_get" id="R[(Q0eY07A48#VS]EGx)">
<mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
<field name="OPTION">fy</field>
</block>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
<block type="convert_tonumber" id="iqTIy??yEBAvV?5?0]fi">
<value name="VALUE">
<block type="variables_get" id="0vH`N$Qsy.h},$/(Vb-#">
<field name="VAR" id="0%D)uB5.HJ=rUU~$_0d2">jahr</field>
</block>
</value>
</block>
</value>
</block>
</value>
<value name="ADD4">
<block type="text" id="ee.qN@OPw@3cOA/eW!t)">
<field name="TEXT">. Hochzeitstag</field>
</block>
</value>
</block>
</value>
</block>
</statement>
<next>
<block type="controls_if" id="Reu9SWAV.{g9W`015ym8">
<value name="IF0">
<block type="logic_compare" id="lKG(H#Q~hhe:WvlVaqCA">
<field name="OP">NEQ</field>
<value name="A">
<block type="variables_get" id="Xz!GVp=lm4o9Ze8,6^`k">
<field name="VAR" id="]9bf#tCn2o:A^e)kEbU[">nachricht</field>
</block>
</value>
<value name="B">
<block type="text" id="dk=YA;2U@1zjV2PJq_kp">
<field name="TEXT"></field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="control" id="hhE.U1tn^8jVb96d=-Rp">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.Nachricht_Handy</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="text_join" id="iYV}U2cu)r2{Mmanaw]?">
<mutation items="2"></mutation>
<value name="ADD0">
<block type="text" id="9=41qf%I5enfPNcSu~oR">
<field name="TEXT">Andreas|</field>
</block>
</value>
<value name="ADD1">
<block type="variables_get" id="H-?sht?Ip3JwYSkDv7#D">
<field name="VAR" id="]9bf#tCn2o:A^e)kEbU[">nachricht</field>
</block>
</value>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
</statement>
</block>
</next>
</block>
</xml>