Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Tester
    4. Test Javascript-Adapter 5.0.7 - RULES

    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

    Test Javascript-Adapter 5.0.7 - RULES

    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      Markus Frankl @Ahnungsbefreit last edited by

      @ahnungsbefreit Dem kann ich nur beipflichten. Für mich eine absolut super Ergänzung zu Blockly. Für schnelle und kleine Automationen ist das absolut perfekt. Für komplexere Sachen bleibt dann nach wie vor noch Blockly. Hab grad binnen 10 Min. 4x Lichtsteuerung über Bewegungsmelder umgesetzt. Absolut klasse und Bequem. 😄 Weiter so und vielen dank an @apollon77
      Ps. hab schon mal nen kleines Feature Request auf Git da gelassen 🙂

      1 Reply Last reply Reply Quote 0
      • M
        msauer last edited by msauer

        Hi...Ich will eigentlich ein total simples Skript erstellen, das alle 6 Std ein Objekt auf false und 10 Sekunden später auf true setzt. Das versuche ich in Rules abzubilden. Ich bekomme jedoch eine Error beim kompilieren.

        ec7bfcc7-1cd7-4dbd-966a-03e803e1a231-image.png

        Es fehlt, soweit ich das erkennen kann, etwas in der "und" Spalte. Was muss ich denn da hinzufügen bzw. prüfen?

        1 Reply Last reply Reply Quote 0
        • M
          msauer last edited by msauer

          In meinem anderen JS Script sieht das so aus:

          schedule("*/60 * * * *", async function () {
            setState("sonoff.0.Steckdose04.POWER1"/*Steckdose04 POWER1  Kamera*/, false);
            setStateDelayed("sonoff.0.Steckdose04.POWER1"/*Steckdose04 POWER1  Kamera*/, true, 5000, false);
          });
          

          als Rules:

          setInterval(async function (obj) {
              const _cond = ();
              if (_cond) {
          		await setStateAsync("sonoff.0.Steckdose04.POWER1", true, false);
          		setStateDelayed("sonoff.0.Steckdose04.POWER1", true, false, 10000, true);
              } else {
          		
              }
          }, 360 * 60000);
          
          apollon77 1 Reply Last reply Reply Quote 0
          • apollon77
            apollon77 @msauer last edited by

            @msauer Bitte github issue anlegen. Ich denke der kommt mit dem "leeren" Condition irgendwie nicht ganz klar.

            1 Reply Last reply Reply Quote 0
            • M
              MCU last edited by

              javascript Version 5.1.3
              Änderung vom Scriptnamen führt zur Löschung vom gesamten Script ohne Vorwarnung.
              https://github.com/ioBroker/ioBroker.javascript/issues/820

              testit2020 created this issue in ioBroker/ioBroker.javascript

              closed Javascript UI mit Admin5: Änderung vom Scriptnamen und Verschieben führt zur Löschung vom Script #740

              M 1 Reply Last reply Reply Quote 1
              • M
                MK-66 @MCU last edited by

                @mcu Ich habe bei der V5.1.3 auch das Problem, dass Skripte beim Umbenennen gelöscht werden, scheint also kein Einzefall zu sein.

                wendy2702 1 Reply Last reply Reply Quote 0
                • wendy2702
                  wendy2702 @MK-66 last edited by

                  @mk-66 Häng dich bitte auch mit an das Issue.

                  M 1 Reply Last reply Reply Quote 0
                  • M
                    MCU @wendy2702 last edited by

                    @wendy2702 VORSICHT Auch das Verschieben löscht ein Script.

                    JAVASCRIPT verschieben löscht Script.gif

                    wendy2702 1 Reply Last reply Reply Quote 0
                    • wendy2702
                      wendy2702 @MCU last edited by

                      @mcu Dann mach auch dazu ein Issue auf.

                      M 1 Reply Last reply Reply Quote 0
                      • M
                        MCU @wendy2702 last edited by

                        @wendy2702 Hab es mit in den anderen Punkt rein geschrieben. Reicht das nicht?

                        wendy2702 1 Reply Last reply Reply Quote 0
                        • wendy2702
                          wendy2702 @MCU last edited by

                          @mcu Doch. Sollte reichen.

                          1 Reply Last reply Reply Quote 0
                          • apollon77
                            apollon77 last edited by

                            Bitte testen ob das nur auftritt wenn Admin5 genutzt wird der auch mit Admin4??? ALso liegt es ehrlich an Javascript version oder am Admin?? Das eine Issue ist zu Admin verschiben worden

                            crunchip 1 Reply Last reply Reply Quote 0
                            • crunchip
                              crunchip Forum Testing Most Active @apollon77 last edited by crunchip

                              @apollon77 habe ich getestet, kopieren, umbenennen, verschieben, keine Probleme mit Admin4
                              Habe ich auch hier geschrieben

                              1 Reply Last reply Reply Quote 1
                              • Q
                                Qlink last edited by

                                @Bluefox @apollon77

                                Gibt es irgendwo eine Doku für die Rules Scripte ? Ich kann auf github keine Anleitung darüber finden...
                                Bei mir triggern die Scripte extrem unzuverlässig bzw. teilweise gar nicht und ich weiß nicht ob ich die Scripte falsch zusammenklicke, ob Rules das Problem ist und noch nicht richtig/stabil funktioniert oder ob es an etwas ganz anderem liegt ...

                                Hier z.B. ein Post von mir vor einer Woche, wo scheinbar niemand eine Idee hat oder Rat weiß ...

                                https://forum.iobroker.net/topic/45631/rules-script-triggert-nicht-zuverlässig?_=1623608490104

                                Danke.
                                Beste Grüße

                                1 Reply Last reply Reply Quote 0
                                • otti
                                  otti last edited by

                                  Vielen dank!!!
                                  das ist genau das worauf ich gewartet habe,
                                  ich bin halt einfach zu blöd für blockly,
                                  mit 'Rules' kann ich endlich auch was anfangen!
                                  mfg

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

                                    Bei mir funktionieren Nachrichten per Pushover nicht.
                                    Ich sehe zwar meine Instanzen aber es wird rot "nicht definiert" angezeigt.

                                    5aafcfdd-9213-4c04-8e2f-e9284725ffbe-image.png

                                    Beim Speicher und Starten gibt es dann auch einen Kompilierungsfehler:

                                    a183857f-622c-4050-8d2e-d66d5475e4bd-image.png

                                    Was mache ich falsch?

                                    apollon77 1 Reply Last reply Reply Quote 0
                                    • apollon77
                                      apollon77 @firebowl last edited by

                                      @firebowl Bitte zeige mal das durch Rules erzeugte JavaScript ... (Klicke dazu auf die "Rules/JS" Grafik

                                      F 1 Reply Last reply Reply Quote 0
                                      • F
                                        firebowl @apollon77 last edited by firebowl

                                        @apollon77

                                        
                                        
                                        let cond0 = false;
                                        
                                        on({id: "zigbee.0.00158d0008ab3a82.temperature", change: "ne"}, async function (obj) {
                                            _sendToFrontEnd(1665724678070, {val: obj.state.val, ack: obj.state.ack, valOld: obj.oldState && obj.oldState.val, ackOld: obj.oldState && obj.oldState.ack});
                                            const subCondVar1665724734367 = obj.state.val;
                                            const subCond1665724734367 = subCondVar1665724734367 >= -18;
                                            const _cond = (subCond1665724734367);
                                            
                                            _sendToFrontEnd(1665724734367, {result: subCond1665724734367, value: subCondVar1665724734367, compareWith: -18});
                                            
                                            if (cond0 === false && _cond) {
                                                cond0 = true;    
                                        		// Pushover Hello
                                        		const subActionVar1665727500241 = "Hello".replace(/%s/g, obj.state.val).replace(/%id/g, obj.id).replace(/%name/g, obj.common && obj.common.name).replace(/%old/g, obj.oldState.val);
                                        		_sendToFrontEnd(1665727500241, {text: subActionVar1665727500241});`;            
                                        		sendTo("pushover.0", "send", {
                                        		    message: subActionVar1665727500241,
                                        		    title: "ioBroker".replace(/%s/g, obj.state.val).replace(/%id/g, obj.id).replace(/%name/g, obj.common && obj.common.name).replace(/%old/g, obj.oldState.val),
                                        		    sound: "magic",
                                        		    priority: -1
                                        		});
                                            } else if (cond0 === true && !_cond) {
                                                cond0 = false;    
                                        		
                                            }
                                        });
                                        /*const demo = {
                                          "triggers": [
                                            {
                                              "id": "TriggerState",
                                              "acceptedBy": "triggers",
                                              "_id": 1665724678070,
                                              "tagCard": "on change",
                                              "oid": "zigbee.0.00158d0008ab3a82.temperature",
                                              "oidRole": "value.temperature",
                                              "oidType": "number",
                                              "oidUnit": "°C",
                                              "oidWrite": false,
                                              "oidRead": true
                                            }
                                          ],
                                          "conditions": [
                                            [
                                              {
                                                "id": "ConditionState",
                                                "acceptedBy": "conditions",
                                                "_id": 1665724734367,
                                                "tagCard": ">=",
                                                "oid": "",
                                                "value": "-18",
                                                "useTrigger": true
                                              }
                                            ]
                                          ],
                                          "justCheck": false,
                                          "actions": {
                                            "then": [
                                              {
                                                "id": "ActionPushover",
                                                "acceptedBy": "actions",
                                                "_id": 1665727500241,
                                                "instance": "pushover.0",
                                                "text": "Hello",
                                                "title": "ioBroker",
                                                "sound": "magic",
                                                "priority": -1
                                              }
                                            ],
                                            "else": []
                                          }
                                        };*/
                                        
                                        //{"triggers":[{"id":"TriggerState","acceptedBy":"triggers","_id":1665724678070,"tagCard":"on change","oid":"zigbee.0.00158d0008ab3a82.temperature","oidRole":"value.temperature","oidType":"number","oidUnit":"°C","oidWrite":false,"oidRead":true}],"conditions":[[{"id":"ConditionState","acceptedBy":"conditions","_id":1665724734367,"tagCard":">=","oid":"","value":"-18","useTrigger":true}]],"justCheck":false,"actions":{"then":[{"id":"ActionPushover","acceptedBy":"actions","_id":1665727500241,"instance":"pushover.0","text":"Hello","title":"ioBroker","sound":"magic","priority":-1}],"else":[]}}
                                        

                                        Wenn ich anstatt Pushover einfach nen Logeintrag erzeugen lasse dann funktioniert das Script.
                                        Sorry für die späte Antwort, hab wohl die Benachrichtigung übersehen.

                                        apollon77 1 Reply Last reply Reply Quote 0
                                        • apollon77
                                          apollon77 @firebowl last edited by

                                          @firebowl Bitte mit den Infos ein Issue im GitHub beim Telegram Adapter anlegen.

                                          F 1 Reply Last reply Reply Quote 0
                                          • F
                                            firebowl @apollon77 last edited by

                                            @apollon77 Warum Telegram? Meinst Du Pushover? Telegram hab ich überhaupt nicht installiert.

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            917
                                            Online

                                            31.9k
                                            Users

                                            80.1k
                                            Topics

                                            1.3m
                                            Posts

                                            rules
                                            25
                                            113
                                            14322
                                            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