Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Timer von Alexa laut runterzählen lassen

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Timer von Alexa laut runterzählen lassen

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

      Hallo!
      Kurze frage: Kann man ein Blockly script machen wo man Z.B. Alexa sagt: Alexa Timer auf 10 Minuten. Das dann die 10 Minuten runterlaufen aber Alexa, z.B. die letzten 30 Sekunden, laut runter zählt? Vielleicht hatte jemand auch schon so eine Idee? Oder gibt es bei Alexa so eine Einstellung? Hab leider noch nichts gefunden?

      liv-in-sky 1 Reply Last reply Reply Quote 0
      • liv-in-sky
        liv-in-sky @netman1904 last edited by liv-in-sky

        @netman1904

        ich habe mir über node red einen timer eingerichtet, der zählt "parallel" zu dem alexa gestellten timer - das ganze wird dann über ein led-matrix-system angezeigt - so sehe ich im wohnzimmer, wie weit mein timer in der küchen alexa ist

        getriggert wird über die history des alexa2 adapters

        gesagt: alexa timer 5 minuten - timer startet
        gesagt: alexa lösche timer - timer wird gestoppt

        problem - es können keine 2 oder mehrere timer auf den echos laufen - sonst geht es nicht - könnte geandert werden - muss man halt noch das echo gerät abfragen, bzw. für jedes echo gerät einen counter anlegen

        Image 1.png

        Image 3.png

        es muss auch eine umwandlung vorgenomen werden - von fünf auf 5 - alexa schreibt die zahl aus !

        var x = msg.payload;
        
        
        if ( x=="fünf" ) { x="5";}
        if ( x=="drei" ) { x="3";}
        if ( x=="vier" ) { x="4";}
        if ( x=="zwei" ) { x="2";}
        if ( x=="eine" ) { x="1";}    
        if ( x=="zwanzig" ) { x="20";} 
        if ( x=="acht" ) { x="8";} 
        if ( x=="zehn" ) { x="10";} 
        if ( x=="neun" ) { x="9";} 
        if ( x=="fünfzehn" ) { x="15";} 
        if ( x=="vierzig" ) { x="40";} 
        if ( x=="zwölf" ) { x="12";} 
        if ( x=="fünf und dreißig" ) { x="35";} 
        if ( x=="fünf und zwanzig" ) { x="25";} 
        if ( x=="fünf und vierzig" ) { x="45";} 
        if ( x=="dreißig" ) { x="30";} 
        if ( x=="sechzig" ) { x="60";}
        if ( x=="fünf und fünfzig" ) { x="55";}
        
        
        x=Number(x)*60;
        msg.payload={
            "payload": "on",
            "timeout": x
        }
         //   msg.payload = x;
          return msg;
        
        
        
        1 Reply Last reply Reply Quote 0
        • liv-in-sky
          liv-in-sky last edited by

          hier mal der export - zum testen


          [
          {
          "id": "c32230ec.1234e",
          "type": "mytimeout",
          "z": "d63e845b.4c6218",
          "name": "",
          "outtopic": "",
          "outsafe": "on",
          "outwarning": "",
          "outunsafe": "off",
          "warning": "",
          "timer": "30",
          "debug": false,
          "ndebug": false,
          "ignoreCase": false,
          "repeat": false,
          "again": false,
          "x": 830,
          "y": 1220,
          "wires": [
          [
          "8abc4373.fee84",
          "9cb011dc.adec6"
          ],
          [
          "ba63ab12.025ab8",
          "2d0c2e68.88b9a2",
          "eaaab3a3.54e43"
          ]
          ]
          },
          {
          "id": "70402a50.ae4444",
          "type": "inject",
          "z": "d63e845b.4c6218",
          "name": "",
          "topic": "",
          "payload": "{"payload":"on","timeout":200}",
          "payloadType": "json",
          "repeat": "",
          "crontab": "",
          "once": false,
          "onceDelay": 0.1,
          "x": 630,
          "y": 1140,
          "wires": [
          [
          "c32230ec.1234e",
          "2b8c9aae.6224c6"
          ]
          ]
          },
          {
          "id": "48a7d39d.5358cc",
          "type": "debug",
          "z": "d63e845b.4c6218",
          "name": "",
          "active": false,
          "tosidebar": true,
          "console": false,
          "tostatus": false,
          "complete": "true",
          "x": 1290,
          "y": 1260,
          "wires": []
          },
          {
          "id": "8abc4373.fee84",
          "type": "debug",
          "z": "d63e845b.4c6218",
          "name": "",
          "active": false,
          "tosidebar": true,
          "console": false,
          "tostatus": false,
          "complete": "true",
          "x": 1010,
          "y": 1160,
          "wires": []
          },
          {
          "id": "c34e6d95.dba",
          "type": "inject",
          "z": "d63e845b.4c6218",
          "name": "",
          "topic": "off",
          "payload": "off",
          "payloadType": "str",
          "repeat": "",
          "crontab": "",
          "once": false,
          "onceDelay": 0.1,
          "x": 630,
          "y": 1180,
          "wires": [
          [
          "c32230ec.1234e"
          ]
          ]
          },
          {
          "id": "de7655d6.cb2bf8",
          "type": "function",
          "z": "d63e845b.4c6218",
          "name": "Umwandlung on und time",
          "func": "var x = msg.payload;\n\n\nif ( x=="fünf" ) { x="5";}\nif ( x=="drei" ) { x="3";}\nif ( x=="vier" ) { x="4";}\nif ( x=="zwei" ) { x="2";}\nif ( x=="eine" ) { x="1";} \nif ( x=="zwanzig" ) { x="20";} \nif ( x=="acht" ) { x="8";} \nif ( x=="zehn" ) { x="10";} \nif ( x=="neun" ) { x="9";} \nif ( x=="fünfzehn" ) { x="15";} \nif ( x=="vierzig" ) { x="40";} \nif ( x=="zwölf" ) { x="12";} \nif ( x=="fünf und dreißig" ) { x="35";} \nif ( x=="fünf und zwanzig" ) { x="25";} \nif ( x=="fünf und vierzig" ) { x="45";} \nif ( x=="dreißig" ) { x="30";} \nif ( x=="sechzig" ) { x="60";}\nif ( x=="fünf und fünfzig" ) { x="55";}\n\n\nx=Number(x)*60;\nmsg.payload={\n "payload": "on",\n "timeout": x\n}\n // msg.payload = x;\n return msg;\n\n",
          "outputs": 1,
          "noerr": 0,
          "x": 730,
          "y": 1080,
          "wires": [
          [
          "cce15fb6.b7472",
          "5f09c433.50c71c"
          ]
          ]
          },
          {
          "id": "d5658a9b.721cf8",
          "type": "change",
          "z": "d63e845b.4c6218",
          "name": "off",
          "rules": [
          {
          "t": "set",
          "p": "payload",
          "pt": "msg",
          "to": "off",
          "tot": "str"
          }
          ],
          "action": "",
          "property": "",
          "from": "",
          "to": "",
          "reg": false,
          "x": 510,
          "y": 1220,
          "wires": [
          [
          "c32230ec.1234e"
          ]
          ]
          },
          {
          "id": "cce15fb6.b7472",
          "type": "delay",
          "z": "d63e845b.4c6218",
          "name": "",
          "pauseType": "delay",
          "timeout": "2",
          "timeoutUnits": "seconds",
          "rate": "1",
          "nbRateUnits": "1",
          "rateUnits": "second",
          "randomFirst": "1",
          "randomLast": "5",
          "randomUnits": "seconds",
          "drop": false,
          "x": 1020,
          "y": 1080,
          "wires": [
          [
          "c32230ec.1234e"
          ]
          ]
          },
          {
          "id": "d4ac23a9.00213",
          "type": "switch",
          "z": "d63e845b.4c6218",
          "name": "Suche nach TIMER",
          "property": "payload",
          "propertyType": "msg",
          "rules": [
          {
          "t": "regex",
          "v": "minute",
          "vt": "str",
          "case": true
          },
          {
          "t": "regex",
          "v": "lösch",
          "vt": "str",
          "case": true
          }
          ],
          "checkall": "true",
          "repair": false,
          "outputs": 2,
          "x": 350,
          "y": 1140,
          "wires": [
          [
          "d5658a9b.721cf8",
          "d8b27563.72918",
          "3e9c77a2.2fe948"
          ],
          [
          "d5658a9b.721cf8",
          "d8b27563.72918"
          ]
          ]
          },
          {
          "id": "3e9c77a2.2fe948",
          "type": "change",
          "z": "d63e845b.4c6218",
          "name": "unnötiges",
          "rules": [
          {
          "t": "change",
          "p": "payload",
          "pt": "msg",
          "from": "alexa timer ",
          "fromt": "re",
          "to": "",
          "tot": "str"
          },
          {
          "t": "change",
          "p": "payload",
          "pt": "msg",
          "from": " minuten",
          "fromt": "re",
          "to": "",
          "tot": "str"
          }
          ],
          "action": "",
          "property": "",
          "from": "",
          "to": "",
          "reg": false,
          "x": 520,
          "y": 1080,
          "wires": [
          [
          "de7655d6.cb2bf8"
          ]
          ]
          },
          {
          "id": "4595295f.a54ef8",
          "type": "change",
          "z": "d63e845b.4c6218",
          "name": "matrix alarm mode setzen",
          "rules": [
          {
          "t": "change",
          "p": "payload",
          "pt": "msg",
          "from": "off",
          "fromt": "str",
          "to": "0",
          "tot": "str"
          },
          {
          "t": "change",
          "p": "payload",
          "pt": "msg",
          "from": "on",
          "fromt": "str",
          "to": "2",
          "tot": "str"
          }
          ],
          "action": "",
          "property": "",
          "from": "",
          "to": "",
          "reg": false,
          "x": 1470,
          "y": 1180,
          "wires": [
          [
          "50b294cb.2482cc",
          "6b342e77.b104",
          "fc4dd697.f295b8"
          ]
          ]
          },
          {
          "id": "6b342e77.b104",
          "type": "debug",
          "z": "d63e845b.4c6218",
          "name": "",
          "active": false,
          "tosidebar": true,
          "console": false,
          "tostatus": false,
          "complete": "true",
          "x": 1650,
          "y": 1260,
          "wires": []
          },
          {
          "id": "ba63ab12.025ab8",
          "type": "function",
          "z": "d63e845b.4c6218",
          "name": "",
          "func": "var x = msg.payload;\n\n x=x/60;\n x= Math.round(x);\n \n msg.payload = x;\n\n\n return msg;\n\n",
          "outputs": 1,
          "noerr": 0,
          "x": 1150,
          "y": 1300,
          "wires": [
          [
          "13bb6c3b.f7c784",
          "48a7d39d.5358cc"
          ]
          ]
          },
          {
          "id": "13bb6c3b.f7c784",
          "type": "ioBroker out",
          "z": "d63e845b.4c6218",
          "name": "",
          "topic": "controll-own.0.TIME-NodeRed.Minutes",
          "ack": "false",
          "autoCreate": "false",
          "x": 1630,
          "y": 1360,
          "wires": []
          },
          {
          "id": "8cc8e271.327c5",
          "type": "switch",
          "z": "d63e845b.4c6218",
          "name": "Suche nach TIMER",
          "property": "payload",
          "propertyType": "msg",
          "rules": [
          {
          "t": "regex",
          "v": "[on|off]",
          "vt": "str",
          "case": false
          },
          {
          "t": "eq",
          "v": "Warning",
          "vt": "str"
          }
          ],
          "checkall": "true",
          "repair": false,
          "outputs": 2,
          "x": 1230,
          "y": 1200,
          "wires": [
          [
          "4595295f.a54ef8",
          "63694e47.177ef"
          ],
          []
          ]
          },
          {
          "id": "2d0c2e68.88b9a2",
          "type": "debug",
          "z": "d63e845b.4c6218",
          "name": "",
          "active": false,
          "tosidebar": true,
          "console": false,
          "tostatus": false,
          "complete": "true",
          "x": 930,
          "y": 1360,
          "wires": []
          },
          {
          "id": "9cb011dc.adec6",
          "type": "delay",
          "z": "d63e845b.4c6218",
          "name": "",
          "pauseType": "delay",
          "timeout": "2",
          "timeoutUnits": "seconds",
          "rate": "1",
          "nbRateUnits": "1",
          "rateUnits": "second",
          "randomFirst": "1",
          "randomLast": "5",
          "randomUnits": "seconds",
          "drop": false,
          "x": 1020,
          "y": 1200,
          "wires": [
          [
          "8cc8e271.327c5"
          ]
          ]
          },
          {
          "id": "5b2678a.04f2e88",
          "type": "change",
          "z": "d63e845b.4c6218",
          "name": "off",
          "rules": [
          {
          "t": "change",
          "p": "payload",
          "pt": "msg",
          "from": "0",
          "fromt": "str",
          "to": "",
          "tot": "str"
          }
          ],
          "action": "",
          "property": "",
          "from": "",
          "to": "",
          "reg": false,
          "x": 1510,
          "y": 1120,
          "wires": [
          [
          "dc688ad4.e14648",
          "840bd2b.654673"
          ]
          ]
          },
          {
          "id": "fc4dd697.f295b8",
          "type": "switch",
          "z": "d63e845b.4c6218",
          "name": "",
          "property": "payload",
          "propertyType": "msg",
          "rules": [
          {
          "t": "eq",
          "v": "2",
          "vt": "str"
          },
          {
          "t": "eq",
          "v": "0",
          "vt": "str"
          }
          ],
          "checkall": "true",
          "repair": false,
          "outputs": 2,
          "x": 1350,
          "y": 1120,
          "wires": [
          [],
          [
          "5b2678a.04f2e88"
          ]
          ]
          },
          {
          "id": "eaaab3a3.54e43",
          "type": "ioBroker out",
          "z": "d63e845b.4c6218",
          "name": "controll-own.0.TIME-NodeRed.RestSeconds",
          "topic": "controll-own.0.TIME-NodeRed.RestSeconds",
          "ack": "false",
          "autoCreate": "false",
          "x": 1230,
          "y": 1360,
          "wires": []
          },
          {
          "id": "63694e47.177ef",
          "type": "ioBroker out",
          "z": "d63e845b.4c6218",
          "name": "controll-own.0.TIME-NodeRed.Start",
          "topic": "controll-own.0.TIME-NodeRed.Start",
          "ack": "true",
          "autoCreate": "false",
          "x": 1640,
          "y": 1300,
          "wires": []
          },
          {
          "id": "840bd2b.654673",
          "type": "ioBroker out",
          "z": "d63e845b.4c6218",
          "name": "controll-own.0.TIME-NodeRed.Seconds",
          "topic": "controll-own.0.TIME-NodeRed.Seconds",
          "ack": "true",
          "autoCreate": "false",
          "x": 1620,
          "y": 1020,
          "wires": []
          },
          {
          "id": "2b8c9aae.6224c6",
          "type": "change",
          "z": "d63e845b.4c6218",
          "name": "off",
          "rules": [
          {
          "t": "set",
          "p": "payload",
          "pt": "msg",
          "to": "payload.timeout",
          "tot": "msg"
          }
          ],
          "action": "",
          "property": "",
          "from": "",
          "to": "",
          "reg": false,
          "x": 890,
          "y": 1020,
          "wires": [
          [
          "840bd2b.654673"
          ]
          ]
          },
          {
          "id": "1e479d88.627b8a",
          "type": "inject",
          "z": "d63e845b.4c6218",
          "name": "",
          "topic": "",
          "payload": "timer fünf minuten",
          "payloadType": "str",
          "repeat": "",
          "crontab": "",
          "once": false,
          "onceDelay": 0.1,
          "x": 140,
          "y": 1040,
          "wires": [
          [
          "d4ac23a9.00213"
          ]
          ]
          },
          {
          "id": "3f33a0ff.2a8218",
          "type": "debug",
          "z": "d63e845b.4c6218",
          "name": "",
          "active": false,
          "tosidebar": true,
          "console": false,
          "tostatus": false,
          "complete": "true",
          "x": 230,
          "y": 1260,
          "wires": []
          },
          {
          "id": "d8b27563.72918",
          "type": "debug",
          "z": "d63e845b.4c6218",
          "name": "",
          "active": false,
          "tosidebar": true,
          "console": false,
          "tostatus": false,
          "complete": "true",
          "x": 590,
          "y": 1300,
          "wires": []
          },
          {
          "id": "dc3f21b8.98d6c",
          "type": "ioBroker in",
          "z": "d63e845b.4c6218",
          "name": "Alexa Summary",
          "topic": "alexa2.0.History.summary",
          "payloadType": "value",
          "onlyack": "",
          "func": "rbe",
          "gap": "",
          "x": 100,
          "y": 1140,
          "wires": [
          [
          "3f33a0ff.2a8218",
          "d4ac23a9.00213"
          ]
          ]
          },
          {
          "id": "5f09c433.50c71c",
          "type": "debug",
          "z": "d63e845b.4c6218",
          "name": "",
          "active": false,
          "tosidebar": true,
          "console": false,
          "tostatus": false,
          "complete": "true",
          "x": 1010,
          "y": 1040,
          "wires": []
          }
          ]

          • es müssen die datenpunkte angelegt (minutes, seconds, restseconds,start) und in nodered zugewiesen werden
          • "node-red contrib-mytimeout" -node installieren (ich mach das immer in node-red (manage palette) und gleichzeitig im instanz setting

          Image 4.png
          Image 5.png

          müßte natürlich auch als js oder blockly übersetzt werden können

          N 1 Reply Last reply Reply Quote 0
          • N
            netman1904 @liv-in-sky last edited by

            @liv-in-sky Ok Danke. Werde ich mal demnächst in Angriff nehmen!!

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

            Support us

            ioBroker
            Community Adapters
            Donate

            405
            Online

            31.9k
            Users

            80.3k
            Topics

            1.3m
            Posts

            2
            4
            741
            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