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

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Test Javascript-Adapter 5.0.7 - RULES

    This topic has been deleted. Only users with topic management privileges can see it.
    • 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
                        • apollon77
                          apollon77 @firebowl last edited by

                          @firebowl Jaaa ..sorry Typo 🙂 (zu viele Themen parallel)

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

                            @apollon77 Da gab es schon ein Issue, hab mich mal drangehängt. 🙂

                            1 Reply Last reply Reply Quote 1
                            • N
                              niklasmader last edited by

                              Hey,

                              mag mir einer bei einem ganz einfachen Skript helfen? Ich möchte einfach nur bei Änderung von play' auf 'pause' die Lautstärke bei Sonos verstellen. Mit dem 'simple State' und dem Abgleich von 'true' und 'false' klappt das. Aber nicht mit dem String Value 'play' oder 'pause'. Ich habs schon mit Anführungszeichen doppelt oder einfach probiert.

                              Danke euch!

                              Screenshot 2022-11-19 at 20.39.13.png

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

                                @niklasmader Ist der Wert wirklich "pause"? wie Zeigt admin es an?

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

                                  @apollon77 Ich hab's hier heraus gelesen. Ist dort nicht richtig zu schauen? Ich komme von Fhem und das ist auch schon etwas her, daher muss ich mich noch etwas einfinden.

                                  Screenshot 2022-11-19 at 20.47.00.png

                                  Homoran 1 Reply Last reply Reply Quote 0
                                  • Homoran
                                    Homoran Global Moderator Administrators @niklasmader last edited by

                                    @niklasmader sagte in Test Javascript-Adapter 5.0.7 - RULES:

                                    Ist dort nicht richtig zu schauen

                                    geh mal auf den Bleistift und poste die Objektdaten

                                    N 1 Reply Last reply Reply Quote 0
                                    • N
                                      niklasmader @Homoran last edited by

                                      @homoran Oh, interessant. Da gibt es ja sogar noch mehr. Aber "pause" müsste doch auch dabei sein, so wie ich das sehe.

                                      Screenshot 2022-11-19 at 20.54.45.png

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

                                        Dann zeig mal im Javascript das Javascript was er aus deiner Rule generiert ... oben rechts auf das "Rules/JS" Logo klicken

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

                                          @apollon77 Ist anbei. Wofür ist eigentlich die aaskommentierte Sektion? Für die Simulation?

                                          Screenshot 2022-11-19 at 20.59.32.png

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

                                            @niklasmader das sieht aber korrekt aus. Wenn „pause“ dann setze 10. was genau tut nicht?

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            666
                                            Online

                                            31.7k
                                            Users

                                            79.8k
                                            Topics

                                            1.3m
                                            Posts

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