Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Lampen Status abfragen mit Alexa

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Lampen Status abfragen mit Alexa

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

      Ja das ist auch ein Problem 🙂

      1 Reply Last reply Reply Quote 0
      • F
        Flopsi last edited by

        So habe mal ein verzögerung eingebaut:

        2020-03-27 13_08_42-javascript - ioBroker.png

        Jetzt sagt Alexa Das Licht im Flur ist aus immer zwei mal hintereinander und dann Das Licht im Wohnzimmer ist aus.

        J dslraser 3 Replies Last reply Reply Quote 0
        • J
          Jan1 @Flopsi last edited by

          @Flopsi
          und ich weiter optimiert:

          <xml xmlns="http://www.w3.org/1999/xhtml">
           <variables>
             <variable type="" id="Ub0JCY+}+gEipvxi7S]+">Licht Flur</variable>
             <variable type="" id="^k8snTAHY:`d[+PAkwv}">Licht Wohnzimmer</variable>
           </variables>
           <block type="on" id="#bZkN$jIVqU+,OcI.7%j" x="-1437" y="-1137">
             <field name="OID">javascript.0.Eigene_Datenpunkte.Schalter</field>
             <field name="CONDITION">ne</field>
             <field name="ACK_CONDITION"></field>
             <statement name="STATEMENT">
               <block type="variables_set" id="F{.K[ks#p+G^IDp=-[}X">
                 <field name="VAR" id="Ub0JCY+}+gEipvxi7S]+" variabletype="">Licht Flur</field>
                 <value name="VALUE">
                   <block type="text" id="sx-iYppaNwRcqTNT|qEs">
                     <field name="TEXT"></field>
                   </block>
                 </value>
                 <next>
                   <block type="variables_set" id="!Nw%:`XJdr{c=j4o*x8d">
                     <field name="VAR" id="^k8snTAHY:`d[+PAkwv}" variabletype="">Licht Wohnzimmer</field>
                     <value name="VALUE">
                       <block type="text" id="5qPH[mpx=Y%eyXopBq{T">
                         <field name="TEXT"></field>
                       </block>
                     </value>
                     <next>
                       <block type="comment" id="}-YO3!vNiNVSl6_{:a~A">
                         <field name="COMMENT">Flurlicht</field>
                         <next>
                           <block type="controls_if" id="Lgw?iDvZtq[6KK/Bf2~r">
                             <mutation else="1"></mutation>
                             <value name="IF0">
                               <block type="get_value" id="jk83[/k.1_Kv7(KF]JCC">
                                 <field name="ATTR">val</field>
                                 <field name="OID">ham.0.Licht-Flur.Licht-Flur.On</field>
                               </block>
                             </value>
                             <statement name="DO0">
                               <block type="text_append" id="|I!-~UBMRru_2`]{X.d7">
                                 <field name="VAR" id="Ub0JCY+}+gEipvxi7S]+" variabletype="">Licht Flur</field>
                                 <value name="TEXT">
                                   <shadow type="text" id="Qk:F43_6fsp5-R$IvH6J">
                                     <field name="TEXT"></field>
                                   </shadow>
                                   <block type="text" id="7wz|G@]R$+SKM1|hf;~n">
                                     <field name="TEXT">Das Licht im Flur ist an;</field>
                                   </block>
                                 </value>
                               </block>
                             </statement>
                             <statement name="ELSE">
                               <block type="text_append" id="e,XXf%wA#lxav!yYBcH%">
                                 <field name="VAR" id="Ub0JCY+}+gEipvxi7S]+" variabletype="">Licht Flur</field>
                                 <value name="TEXT">
                                   <shadow type="text" id="Qk:F43_6fsp5-R$IvH6J">
                                     <field name="TEXT"></field>
                                   </shadow>
                                   <block type="text" id="]W)$a~oWqd9fFyS8OP4]">
                                     <field name="TEXT">Das Licht im Flur ist aus;</field>
                                   </block>
                                 </value>
                               </block>
                             </statement>
                             <next>
                               <block type="comment" id="wbPD`@:gy(9BpF$f-LkH">
                                 <field name="COMMENT">Schranklicht</field>
                                 <next>
                                   <block type="controls_if" id="8GA,AHD_NR%oxsRqkiBh">
                                     <mutation else="1"></mutation>
                                     <value name="IF0">
                                       <block type="get_value" id="g2^f.JcE;CiyK0s8p.DO">
                                         <field name="ATTR">val</field>
                                         <field name="OID">ham.0.Schrankbeleuchtung.Schrankbeleuchtung.On</field>
                                       </block>
                                     </value>
                                     <statement name="DO0">
                                       <block type="text_append" id="r!jjkNC,w$gwpJ:mtZ.a">
                                         <field name="VAR" id="^k8snTAHY:`d[+PAkwv}" variabletype="">Licht Wohnzimmer</field>
                                         <value name="TEXT">
                                           <shadow type="text" id="S0O/|l.Em*;XHH%XWl#?">
                                             <field name="TEXT"></field>
                                           </shadow>
                                           <block type="text" id="N7ZZW!)XHN`1Brm$nwmn">
                                             <field name="TEXT">Das Licht im Wohnzimmer ist an;</field>
                                           </block>
                                         </value>
                                       </block>
                                     </statement>
                                     <statement name="ELSE">
                                       <block type="text_append" id="N8A_cGfX!2L8{0SvH,zt">
                                         <field name="VAR" id="^k8snTAHY:`d[+PAkwv}" variabletype="">Licht Wohnzimmer</field>
                                         <value name="TEXT">
                                           <shadow type="text" id="kx;K:y?5)(qKuij.sdHP">
                                             <field name="TEXT"></field>
                                           </shadow>
                                           <block type="text" id="`-@KG;uM4f3jKNP!k9Mo">
                                             <field name="TEXT">Das Licht im Wohnzimmer ist aus;</field>
                                           </block>
                                         </value>
                                       </block>
                                     </statement>
                                     <next>
                                       <block type="control" id="1WB*/:yo!/jv;ad~uU[K">
                                         <mutation delay_input="true"></mutation>
                                         <field name="OID">alexa2.0.Echo-Devices.G090LF096512376R.Commands.speak</field>
                                         <field name="WITH_DELAY">TRUE</field>
                                         <field name="DELAY_MS">500</field>
                                         <field name="UNIT">ms</field>
                                         <field name="CLEAR_RUNNING">TRUE</field>
                                         <value name="VALUE">
                                           <block type="text_join" id="2NBd=,=.V]-)l]cB`[b)">
                                             <mutation items="3"></mutation>
                                             <value name="ADD0">
                                               <block type="variables_get" id="cy!q}a;!*k2BHXQ/4J@G">
                                                 <field name="VAR" id="Ub0JCY+}+gEipvxi7S]+" variabletype="">Licht Flur</field>
                                               </block>
                                             </value>
                                             <value name="ADD1">
                                               <block type="text" id="[GI`9lm%dg?4@7,xL/Qy">
                                                 <field name="TEXT">und </field>
                                               </block>
                                             </value>
                                             <value name="ADD2">
                                               <block type="variables_get" id="qgCzoTRhTpy#PUm_(y.#">
                                                 <field name="VAR" id="^k8snTAHY:`d[+PAkwv}" variabletype="">Licht Wohnzimmer</field>
                                               </block>
                                             </value>
                                           </block>
                                         </value>
                                         <next>
                                           <block type="control" id="tv@!%nW]5CE=HyMzRw#O">
                                             <mutation delay_input="true"></mutation>
                                             <field name="OID">javascript.0.Eigene_Datenpunkte.Schalter</field>
                                             <field name="WITH_DELAY">TRUE</field>
                                             <field name="DELAY_MS">2</field>
                                             <field name="UNIT">sec</field>
                                             <field name="CLEAR_RUNNING">FALSE</field>
                                             <value name="VALUE">
                                               <block type="logic_boolean" id="H^?)~EA+!NrG.AN4}Ex?">
                                                 <field name="BOOL">FALSE</field>
                                               </block>
                                             </value>
                                           </block>
                                         </next>
                                       </block>
                                     </next>
                                   </block>
                                 </next>
                               </block>
                             </next>
                           </block>
                         </next>
                       </block>
                     </next>
                   </block>
                 </next>
               </block>
             </statement>
           </block>
          </xml>
          

          Musst mal schauen ob das läuft. So werden Variablen gesetzt aus der ein Text generiert wird und der dann eben angesagt. Theortisch sollte das laufen 😉

          1 Reply Last reply Reply Quote 0
          • dslraser
            dslraser Forum Testing Most Active @Flopsi last edited by dslraser

            @Flopsi
            probiere mal...

            Bildschirmfoto 2020-03-27 um 13.21.48.png

            <xml xmlns="http://www.w3.org/1999/xhtml">
             <variables>
               <variable type="" id="4zKTWd7Lg(g)K%1*f34p">Ansage</variable>
             </variables>
             <block type="on" id="#bZkN$jIVqU+,OcI.7%j" x="-1338" y="-1012">
               <field name="OID">javascript.0.Eigene_Datenpunkte.Schalter</field>
               <field name="CONDITION">ne</field>
               <field name="ACK_CONDITION"></field>
               <statement name="STATEMENT">
                 <block type="controls_if" id="Zd6NtGx,f!0TLfTlImip">
                   <value name="IF0">
                     <block type="on_source" id="4gthyV9RP1{Pryl[@p(f">
                       <field name="ATTR">state.val</field>
                     </block>
                   </value>
                   <statement name="DO0">
                     <block type="variables_set" id="|IQSj]zc1V;iptR)Ft8]">
                       <field name="VAR" id="4zKTWd7Lg(g)K%1*f34p" variabletype="">Ansage</field>
                       <value name="VALUE">
                         <block type="text_join" id="0]=GpNyBkr3`FpbEencY">
                           <mutation items="3"></mutation>
                           <value name="ADD0">
                             <block type="text" id="IPKVJZ~3-MN:Bm,iD4_a">
                               <field name="TEXT">Aktuell ist,</field>
                             </block>
                           </value>
                           <value name="ADD1">
                             <block type="logic_ternary" id="Y)2)amO+z915uln.f[%:">
                               <value name="IF">
                                 <block type="get_value" id="jk83[/k.1_Kv7(KF]JCC">
                                   <field name="ATTR">val</field>
                                   <field name="OID">ham.0.Licht-Flur.Licht-Flur.On</field>
                                 </block>
                               </value>
                               <value name="THEN">
                                 <block type="text" id="7wz|G@]R$+SKM1|hf;~n">
                                   <field name="TEXT">Das Licht im Flur an, </field>
                                 </block>
                               </value>
                               <value name="ELSE">
                                 <block type="text" id="JZ/?]|HH%UvRBV~2n,NB">
                                   <field name="TEXT">Das Licht im Flur ist aus,</field>
                                 </block>
                               </value>
                             </block>
                           </value>
                           <value name="ADD2">
                             <block type="logic_ternary" id="U-]crf*fkM4tkpfTKm_1">
                               <value name="IF">
                                 <block type="get_value" id="g2^f.JcE;CiyK0s8p.DO">
                                   <field name="ATTR">val</field>
                                   <field name="OID">ham.0.Schrankbeleuchtung.Schrankbeleuchtung.On</field>
                                 </block>
                               </value>
                               <value name="THEN">
                                 <block type="text" id="#.gOVo:PtB6{YunIFdQ/">
                                   <field name="TEXT">Das Licht im Wohnzimmer an, </field>
                                 </block>
                               </value>
                               <value name="ELSE">
                                 <block type="text" id="UehjIi=0l%1_L{oXwLtf">
                                   <field name="TEXT">Das Licht im Wohnzimmer aus, </field>
                                 </block>
                               </value>
                             </block>
                           </value>
                         </block>
                       </value>
                       <next>
                         <block type="control" id="1WB*/:yo!/jv;ad~uU[K">
                           <mutation delay_input="false"></mutation>
                           <field name="OID">alexa2.0.Echo-Devices.G090LF096512376R.Commands.speak</field>
                           <field name="WITH_DELAY">FALSE</field>
                           <value name="VALUE">
                             <block type="variables_get" id="l+?WSi47:{QBU=(C]TP)">
                               <field name="VAR" id="4zKTWd7Lg(g)K%1*f34p" variabletype="">Ansage</field>
                             </block>
                           </value>
                         </block>
                       </next>
                     </block>
                   </statement>
                 </block>
               </statement>
             </block>
            </xml>
            

            1 Reply Last reply Reply Quote 0
            • J
              Jan1 @Flopsi last edited by

              @Flopsi
              Nimm das von @dslraser, ist der gleiche Gedanke wie meins, nur noch ne Runde optimaler.

              1 Reply Last reply Reply Quote 0
              • F
                Flopsi last edited by

                @dslraser
                genau das was ich wollte 🙂 wie immer super support von dir 🙂

                Jetzt aber nochmal zu deiner Variante ....

                https://forum.iobroker.net/post/346230

                die ist viel umfangreicher ..... vom Prinzip her ist doch diese Variante gleich...ich wüsste schon gar nicht wie ich diese ganzen gruppen anlegen soll etc....

                Gruss

                dslraser 1 Reply Last reply Reply Quote 0
                • dslraser
                  dslraser Forum Testing Most Active @Flopsi last edited by

                  @Flopsi sagte in Lampen Status abfragen mit Alexa:

                  ich wüsste schon gar nicht wie ich diese ganzen gruppen anlegen soll etc....

                  ? was für Gruppen meinst Du ?

                  die ist viel umfangreicher

                  ja, alles in einem Blockly.

                  1 Reply Last reply Reply Quote 0
                  • F
                    Flopsi last edited by

                    @dslraser
                    Diese Aufzählungen...

                    2020-03-27 17_04_38-1577486687970-screenshot-1063.png (PNG-Grafik, 1736 × 294 Pixel).png

                    Wo ist da der Vorteil kann man damit mehr machen .....

                    dslraser 1 Reply Last reply Reply Quote 0
                    • dslraser
                      dslraser Forum Testing Most Active @Flopsi last edited by

                      @Flopsi sagte in Lampen Status abfragen mit Alexa:

                      Wo ist da der Vorteil kann man damit mehr machen .....

                      Der Vorteil ist z.B. das man im Blockly selbst nichts mehr ändern muß, wenn Geräte dazu kommen oder weg fallen. Man muß dann nur die Aufzählungen pflegen. Um das "sinnvoll" zu nutzen, sollten aber "lesbare/sprechbare" Namen vergeben sein/werden, da ich diese Namen dann auch direkt in den Ansagen und iQontrol Listen verwende.

                      1 Reply Last reply Reply Quote 0
                      • F
                        Flopsi last edited by

                        Gibts irgendwo ne Anleitung wie man sich diese Aufzählungen erstellen kann so ein to DO ?? Will mir das dann auch mal gerne anschauen, ob ich das hinbekomme.

                        Gruss

                        dslraser 1 Reply Last reply Reply Quote 0
                        • dslraser
                          dslraser Forum Testing Most Active @Flopsi last edited by

                          @Flopsi
                          Die Aufzählungen erstellst Du selbst. Wo die Namen Deiner Geräte her kommen kannst nur Du wissen.
                          Ich habe z.B. sinnvolle Namen in meiner CCU oder HUE Bridge für meine Geräte vergeben.
                          Ob es eine Anleitung dafür gibt weiß ich nicht.

                          1 Reply Last reply Reply Quote 0
                          • F
                            Flopsi last edited by

                            Danke dir habe da schon was gefunden im iobroker bastel mich mal da durch 🙂

                            1 Reply Last reply Reply Quote 0
                            • F
                              Flopsi last edited by Flopsi

                              Ich habe noch eine Frage zu dem Blockly hier Alexa sagt mir ja jetzt welche Lichter an und welche aus sind.

                              Kann man da noch hinzufügen das wenn alle Lichter aus sind nur gesagt wird das alle Lichter aus sind ?

                              Es würde quasi geprüft ob alle Lichter aus sind und dann eine andere Sprachausgabe benutzt.

                              dslraser 1 Reply Last reply Reply Quote 0
                              • dslraser
                                dslraser Forum Testing Most Active @Flopsi last edited by dslraser

                                @Flopsi

                                vielleicht so...

                                Bildschirmfoto 2020-03-27 um 19.39.36.png

                                <xml xmlns="http://www.w3.org/1999/xhtml">
                                 <variables>
                                   <variable type="" id="4zKTWd7Lg(g)K%1*f34p">Ansage</variable>
                                 </variables>
                                 <block type="on" id="#bZkN$jIVqU+,OcI.7%j" x="13" y="638">
                                   <field name="OID">javascript.0.Eigene_Datenpunkte.Schalter</field>
                                   <field name="CONDITION">ne</field>
                                   <field name="ACK_CONDITION"></field>
                                   <statement name="STATEMENT">
                                     <block type="controls_if" id="Zd6NtGx,f!0TLfTlImip">
                                       <value name="IF0">
                                         <block type="on_source" id="4gthyV9RP1{Pryl[@p(f">
                                           <field name="ATTR">state.val</field>
                                         </block>
                                       </value>
                                       <statement name="DO0">
                                         <block type="variables_set" id="|IQSj]zc1V;iptR)Ft8]">
                                           <field name="VAR" id="4zKTWd7Lg(g)K%1*f34p" variabletype="">Ansage</field>
                                           <value name="VALUE">
                                             <block type="text_join" id="0]=GpNyBkr3`FpbEencY">
                                               <mutation items="4"></mutation>
                                               <value name="ADD0">
                                                 <block type="text" id="IPKVJZ~3-MN:Bm,iD4_a">
                                                   <field name="TEXT">Aktuell ist,</field>
                                                 </block>
                                               </value>
                                               <value name="ADD1">
                                                 <block type="logic_ternary" id="Y)2)amO+z915uln.f[%:">
                                                   <value name="IF">
                                                     <block type="get_value" id="jk83[/k.1_Kv7(KF]JCC">
                                                       <field name="ATTR">val</field>
                                                       <field name="OID">ham.0.Licht-Flur.Licht-Flur.On</field>
                                                     </block>
                                                   </value>
                                                   <value name="THEN">
                                                     <block type="text" id="7wz|G@]R$+SKM1|hf;~n">
                                                       <field name="TEXT">Das Licht im Flur an, </field>
                                                     </block>
                                                   </value>
                                                   <value name="ELSE">
                                                     <block type="text" id="fHTq3XWC?kj:vSDv7Yu2">
                                                       <field name="TEXT"></field>
                                                     </block>
                                                   </value>
                                                 </block>
                                               </value>
                                               <value name="ADD2">
                                                 <block type="logic_ternary" id="U-]crf*fkM4tkpfTKm_1">
                                                   <value name="IF">
                                                     <block type="get_value" id="g2^f.JcE;CiyK0s8p.DO">
                                                       <field name="ATTR">val</field>
                                                       <field name="OID">ham.0.Schrankbeleuchtung.Schrankbeleuchtung.On</field>
                                                     </block>
                                                   </value>
                                                   <value name="THEN">
                                                     <block type="text" id="#.gOVo:PtB6{YunIFdQ/">
                                                       <field name="TEXT">Das Licht im Wohnzimmer an, </field>
                                                     </block>
                                                   </value>
                                                   <value name="ELSE">
                                                     <block type="text" id="2Uu0m]*7U[(ma:V/f;e0">
                                                       <field name="TEXT"></field>
                                                     </block>
                                                   </value>
                                                 </block>
                                               </value>
                                               <value name="ADD3">
                                                 <block type="logic_ternary" id="Z5Kk^1qft%y3~dQXt{?D">
                                                   <value name="IF">
                                                     <block type="logic_operation" id="34Z?=2U;LL),i83+~th2" inline="false">
                                                       <field name="OP">AND</field>
                                                       <value name="A">
                                                         <block type="get_value" id="UT]S-8DGxzT,e)zZ*ZM8">
                                                           <field name="ATTR">val</field>
                                                           <field name="OID">ham.0.Licht-Flur.Licht-Flur.On</field>
                                                         </block>
                                                       </value>
                                                       <value name="B">
                                                         <block type="get_value" id="3EYqkIkEP?diH,OgV;P:">
                                                           <field name="ATTR">val</field>
                                                           <field name="OID">ham.0.Schrankbeleuchtung.Schrankbeleuchtung.On</field>
                                                         </block>
                                                       </value>
                                                     </block>
                                                   </value>
                                                   <value name="THEN">
                                                     <block type="text" id="I`HbT[.)mmUyBbsZG;Z7">
                                                       <field name="TEXT"></field>
                                                     </block>
                                                   </value>
                                                   <value name="ELSE">
                                                     <block type="text" id="RP~-9sUn-]korH9tKR!G">
                                                       <field name="TEXT"> das Licht überall ausgeschaltet.</field>
                                                     </block>
                                                   </value>
                                                 </block>
                                               </value>
                                             </block>
                                           </value>
                                           <next>
                                             <block type="control" id="1WB*/:yo!/jv;ad~uU[K">
                                               <mutation delay_input="false"></mutation>
                                               <field name="OID">alexa2.0.Echo-Devices.G090LF096512376R.Commands.speak</field>
                                               <field name="WITH_DELAY">FALSE</field>
                                               <value name="VALUE">
                                                 <block type="variables_get" id="l+?WSi47:{QBU=(C]TP)">
                                                   <field name="VAR" id="4zKTWd7Lg(g)K%1*f34p" variabletype="">Ansage</field>
                                                 </block>
                                               </value>
                                             </block>
                                           </next>
                                         </block>
                                       </statement>
                                     </block>
                                   </statement>
                                 </block>
                                </xml>
                                

                                Hier werden Dir nur die eingeschalteten Lampen angesagt. Wenn alle Lampen aus sind, dann Kommt der erste und der letzte Satz.

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post

                                Support us

                                ioBroker
                                Community Adapters
                                Donate

                                624
                                Online

                                32.0k
                                Users

                                80.4k
                                Topics

                                1.3m
                                Posts

                                4
                                20
                                2017
                                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