NEWS
Licht Dimmer miteinander + Javascript Obkekt binden
-
Hi liebe Freunde, ich vermute das ist ein einfaches Problem und ich bin gerade nur zu doof.
Ich möchte im VIS einen Schalter anlegen, mit dem ich ALLE meine Lichter parallel dimmen oder ausschalten kann.
Gute geeignet scheint mir dafür dieser hier:
Nun ist die Frage wie kriege ich mit einem Schalter alle Lampen damit angesteuert?
Ich habe dafür eine globale Variable erstellt ("Licht Global") auf welchen die Werte der Leuchten reagieren sollen.
Das funktioniert auch, aber ich möchte auch umgekerht dass wenn die Leuchten auf z.B. 25% oder was auch immer eingestellt sind, dass der Globale Dimmer dann nicht mehr den Wert "aus" anzeigt.
Die Funktion "Binde Objekt 1 mit Objekt2" schien mir am logischsten, allerdings funktioniert diese nicht.
Und wenn ich alles gegenseitig steuere, dann befehlt er immer hin und her bis zum Absturz:
Hat jemand eine Idee?
-
Hat jemand eine Idee? ` Ja, habe ich.
1.) Erstmal mußt du im zweiten Block aus "anerkannt ist egal" ein "anerkannt ist Kommando" machen.
Das ist wichtig damit nicht jede Änderung von "Licht Global" dazu führt, daß ein Befehl an alle Lampen raus geht.
2.) Desweiteren mußt du im ersten Block die "steuere" Befehle durch "aktualisiere" Befehle ersetzen.
Das ist wichtig, weil "steuere" Befehl als Kommando den zweiten Block auslösen würde.
Mit dem "aktualisiere" Befehl wird der Wert von "Licht Global" aktualisiert, aber der zweite Block nicht ausgelöst, weil er auf ein Kommando wartet.
Gruß
Gürol
-
Danke für den Tip. Hab das mal so ausprobiert mit folgendem Ergebnis:
-
Die Fehlerschleife mitsamt Absturz tritt nicht mehr auf. Super
-
Der Wert der Variable "Licht Global" ändert sich korrekt wenn ich im VIS den entsprechenden Button drücke
-
Jedoch ändert sich nicht die Helligkeit der Lampen, sowie auch umgekehrt die Lampenhelligkeit keinen Einfluss auf "Licht Global" hat.
So sieht das ganze jetzt aus:
Hier mal als Export:
! ````
<xml xmlns="http://www.w3.org/1999/xhtml"><block type="on_ext" id="e)_pD;eIlAtAxv%QUNVb" x="-262" y="-162"><mutation items="4"></mutation>
<field name="CONDITION">ne</field><value name="OID0"><shadow type="field_oid" id="1a?qac]M{QUc**h;zC(4"><field name="oid">hm-rpc.0.LEQ0186830.1.LEVEL</field></shadow></value> <value name="OID1"><shadow type="field_oid" id="#=fna3BIO~AQ2G9Xj,DY"><field name="oid">hm-rpc.2.KEQ0016423.3.LEVEL</field></shadow></value> <value name="OID2"><shadow type="field_oid" id="cIB`,]pzL{:1=xxuf!=t"><field name="oid">hm-rpc.2.KEQ0016425.3.LEVEL</field></shadow></value> <value name="OID3"><shadow type="field_oid" id=";Gg{f[{,5=(/fWF7JI!~"><field name="oid">hm-rpc.2.KEQ0016429.3.LEVEL</field></shadow></value> <statement name="STATEMENT"><block type="update" id="]}!AMAegWC`ok{J|S;.s"><mutation delay_input="false"></mutation> <field name="OID">javascript.0.Licht_Global</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="get_value" id="~28llD12@xrt(_O{lPYP"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.LEQ0186830.1.LEVEL</field></block></value> <next><block type="update" id="ZcE%zx67]TI#Meqk1D.l"><mutation delay_input="false"></mutation> <field name="OID">javascript.0.Licht_Global</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="get_value" id="sf^u)nE}S_bvB/JIspR+"><field name="ATTR">val</field> <field name="OID">hm-rpc.2.KEQ0016423.3.LEVEL</field></block></value> <next><block type="update" id="u##!l,10nI3Qm0z~nB{+"><mutation delay_input="false"></mutation> <field name="OID">javascript.0.Licht_Global</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="get_value" id="al61-kP5Uwu.,M%??y/*"><field name="ATTR">val</field> <field name="OID">hm-rpc.2.KEQ0016425.3.LEVEL</field></block></value> <next><block type="update" id=",jxDN@35QAt_t-%jf,R;"><mutation delay_input="false"></mutation> <field name="OID">javascript.0.Licht_Global</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="get_value" id="M-)v/RxLr83TKN!7Ps?X"><field name="ATTR">val</field> <field name="OID">hm-rpc.2.KEQ0016429.3.LEVEL</field></block></value></block></next></block></next></block></next></block></statement> <next><block type="on" id="73XlEflq(UNA+|ecP0Cx"><field name="OID">javascript.0.Licht_Global</field> <field name="CONDITION">ne</field> <field name="ACK_CONDITION">false</field> <statement name="STATEMENT"><block type="control" id="`ci!lo|mSWam7#jpX/]:"><mutation delay_input="false"></mutation> <field name="OID">hm-rpc.0.LEQ0186830.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="get_value" id="pW}PC)[(/3Aloxs3KF7K"><field name="ATTR">val</field> <field name="OID">javascript.0.Licht_Global</field></block></value> <next><block type="control" id="~G0w(o5I(xAoU7Rly7#A"><mutation delay_input="false"></mutation> <field name="OID">hm-rpc.2.KEQ0016423.3.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="get_value" id="[jOCr^I?`qe=%t/pHlb]"><field name="ATTR">val</field> <field name="OID">javascript.0.Licht_Global</field></block></value> <next><block type="control" id="dr!=/wb)]FX=z@]+:[+n"><mutation delay_input="false"></mutation> <field name="OID">hm-rpc.2.KEQ0016425.3.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="get_value" id="xMOuTm.7V~;c;cEU/bHe"><field name="ATTR">val</field> <field name="OID">javascript.0.Licht_Global</field></block></value> <next><block type="control" id="D=hU5z]p7/zi:D]CO8d3"><mutation delay_input="false"></mutation> <field name="OID">hm-rpc.2.KEQ0016429.3.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="get_value" id="!!X?ce^(@MCdFU]}tJYB"><field name="ATTR">val</field> <field name="OID">javascript.0.Licht_Global</field></block></value></block></next></block></next></block></next></block></statement></block></next></block>
<block type="control" id="xT#v=wE`eprTdsEIPut2" x="-487" y="537"><mutation delay_input="false"></mutation>
<field name="OID">javascript.0.Licht_Global</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE"><block type="get_value" id="^4[@%Rz70|xDLF1WC]3k"><field name="ATTR">val</field>
<field name="OID">hm-rpc.0.LEQ0186830.1.LEVEL</field></block></value>
<next><block type="control" id="1[2Me!mZN[FNBsb3,QZo"><mutation delay_input="false"></mutation>
<field name="OID">javascript.0.Licht_Global</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE"><block type="get_value" id="lwm/4WcAqaaMd~um!%^6"><field name="ATTR">val</field>
<field name="OID">hm-rpc.2.KEQ0016423.3.LEVEL</field></block></value>
<next><block type="control" id="Tg-^NOe{^xCJi_4qj.zb"><mutation delay_input="false"></mutation>
<field name="OID">javascript.0.Licht_Global</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE"><block type="get_value" id="3liiy{pTP5GN-np.?%i5"><field name="ATTR">val</field>
<field name="OID">hm-rpc.2.KEQ0016425.3.LEVEL</field></block></value>
<next><block type="control" id="vYXl{6oo3|[R4^RMc--@"><mutation delay_input="false"></mutation>
<field name="OID">javascript.0.Licht_Global</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE"><block type="get_value" id="?9Is6G[C3buuSk(XDVS%"><field name="ATTR">val</field>
<field name="OID">hm-rpc.2.KEQ0016429.3.LEVEL</field></block></value></block></next></block></next></block></next></block></xml> -
-
Ich habe die Sache mal kurz bei mir nachgebaut.
(Ich mußte den blockly script aber umschreiben, weil ich keine Dimmerlampen habe und daher mit einer Lampe, den man nur ein und ausschalten kann, vorlieb nehmen musste.)
Ich kann nur sagen, daß die Sache bei mir ohne Probleme funktioniert. (Mit anderen Worten, das Problem ist nicht im script)
Gruß
Gürol
-
Hmm sehr merkwürdig.
Ich habe das ganze jetzt nochmal mit etwas anderem getestet, simpler Gedanke:
–> Verknüpfung einer Systemvariable auf der Homematic (Beschattungsautomatik = wahr/falsch) mit einem Script in io.broker (scriptenabled = wahr/falsch)
! ````
<xml xmlns="http://www.w3.org/1999/xhtml"><block type="on_ext" id="`04oM6(o%bNeVq@/#zB{" x="-537" y="-237"><mutation items="1"></mutation>
<field name="CONDITION">ne</field><value name="OID0"><shadow type="field_oid" id="I?QRr,;BEMk~/g~9!P5#"><field name="oid">javascript.0.scriptEnabled.Beschattungen.Beschattung_Schlaf_Auto_Sonne</field></shadow></value> <statement name="STATEMENT"><block type="update" id="iIdy2c%:Q}-6p=rTU}Lu"><mutation delay_input="false"></mutation> <field name="OID">hm-rega.0.10602</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="get_value" id="~T,trarZ#uumgbZut:bb"><field name="ATTR">val</field> <field name="OID">javascript.0.scriptEnabled.Beschattungen.Beschattung_Auto_Sonne</field></block></value></block></statement> <next><block type="on_ext" id="ArbHcj(O]Ecd5KzOyxpw"><mutation items="1"></mutation> <field name="CONDITION">ne</field> <field name="ACK_CONDITION">false</field> <value name="OID0"><shadow type="field_oid" id="^LRAnfnJzKLHL4KC54dW"><field name="oid">hm-rega.0.10602</field></shadow></value> <statement name="STATEMENT"><block type="control" id="I,p%:gKl@b7c?,tCKPL3"><mutation delay_input="false"></mutation> <field name="OID">javascript.0.scriptEnabled.Beschattungen.Beschattung_Auto_Switch</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="get_value" id="Q^KMIXVJ!R{kNlZm*lz)"><field name="ATTR">val</field> <field name="OID">hm-rega.0.10602</field></block></value></block></statement></block></next></block></xml>
Leider tut sich in beiden Fällen garnichts, also weder wenn auf der Homematic die Variable geändert wird, noch wenn ich in io.broker das Script manuell Starte/beende. Es kann doch eigentlich nicht so schwer / umständlich sein Zustände untereinander zu synchronisieren?