Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Node-Red
    5. Shelly Plus Plug S - Node Red

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Shelly Plus Plug S - Node Red

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

      Hallo zusammen.

      ich benutze diese Node-Red um Shelly Plus 1 / 1 PM usw. zu schalten und die Energiewerte abzufragen. Das hat bisher einwandfrei funktioniert.

      [
          {
              "id": "72491a9c9d7f59d3",
              "type": "mqtt in",
              "z": "9531c5f14d11e22e",
              "name": "",
              "topic": "shellies/schalter/keller/gefrierschrkeller/status/switch:0",
              "qos": "2",
              "datatype": "auto-detect",
              "broker": "b22fc4d3e3f172bb",
              "nl": false,
              "rap": true,
              "rh": 0,
              "inputs": 0,
              "x": 220,
              "y": 1880,
              "wires": [
                  [
                      "9a7043332dadd08d",
                      "324b7e7e8f5f7616"
                  ]
              ]
          },
          {
              "id": "9a7043332dadd08d",
              "type": "change",
              "z": "9531c5f14d11e22e",
              "name": "",
              "rules": [
                  {
                      "t": "set",
                      "p": "payload",
                      "pt": "msg",
                      "to": "payload.output",
                      "tot": "msg"
                  }
              ],
              "action": "",
              "property": "",
              "from": "",
              "to": "",
              "reg": false,
              "x": 550,
              "y": 1880,
              "wires": [
                  [
                      "fb9e879fe3e34581"
                  ]
              ]
          },
          {
              "id": "fb9e879fe3e34581",
              "type": "ioBroker out",
              "z": "9531c5f14d11e22e",
              "name": "switch",
              "topic": "0_userdata.0.shellies.schalter.keller.gefrierschrkeller.switch",
              "ack": "true",
              "autoCreate": "true",
              "stateName": "",
              "role": "",
              "payloadType": "boolean",
              "readonly": "false",
              "stateUnit": "",
              "stateMin": "",
              "stateMax": "",
              "x": 730,
              "y": 1880,
              "wires": []
          },
          {
              "id": "f831d0c916d2017f",
              "type": "ioBroker in",
              "z": "9531c5f14d11e22e",
              "name": "switch",
              "attrname": "",
              "topic": "0_userdata.0.shellies.schalter.keller.gefrierschrkeller.switch",
              "payloadType": "value",
              "onlyack": "command",
              "func": "all",
              "gap": "",
              "fireOnStart": "false",
              "outFormat": "MQTT",
              "x": 70,
              "y": 2000,
              "wires": [
                  [
                      "fee25176647f047d"
                  ]
              ]
          },
          {
              "id": "e9396edc08b9f61f",
              "type": "mqtt out",
              "z": "9531c5f14d11e22e",
              "name": "",
              "topic": "shellies/schalter/keller/gefrierschrkeller/rpc",
              "qos": "",
              "retain": "",
              "respTopic": "",
              "contentType": "",
              "userProps": "",
              "correl": "",
              "expiry": "",
              "broker": "b22fc4d3e3f172bb",
              "x": 610,
              "y": 2000,
              "wires": []
          },
          {
              "id": "fee25176647f047d",
              "type": "change",
              "z": "9531c5f14d11e22e",
              "name": "",
              "rules": [
                  {
                      "t": "set",
                      "p": "payload",
                      "pt": "msg",
                      "to": "{\t   \"id\":141,\t   \"src\":\"hotspot_2\",\t   \"method\":\"Switch.Set\",\t   \"params\":{\"id\":0,\"on\":payload}\t}\t \t",
                      "tot": "jsonata"
                  }
              ],
              "action": "",
              "property": "",
              "from": "",
              "to": "",
              "reg": false,
              "x": 230,
              "y": 2000,
              "wires": [
                  [
                      "e9396edc08b9f61f"
                  ]
              ]
          },
          {
              "id": "324b7e7e8f5f7616",
              "type": "change",
              "z": "9531c5f14d11e22e",
              "name": "",
              "rules": [
                  {
                      "t": "set",
                      "p": "payload",
                      "pt": "msg",
                      "to": "payload.apower",
                      "tot": "msg"
                  }
              ],
              "action": "",
              "property": "",
              "from": "",
              "to": "",
              "reg": false,
              "x": 550,
              "y": 1940,
              "wires": [
                  [
                      "cfeeb61019d8da71"
                  ]
              ]
          },
          {
              "id": "cfeeb61019d8da71",
              "type": "ioBroker out",
              "z": "9531c5f14d11e22e",
              "name": "power",
              "topic": "0_userdata.0.shellies.schalter.keller.gefrierschrkeller.power",
              "ack": "true",
              "autoCreate": "true",
              "stateName": "",
              "role": "",
              "payloadType": "boolean",
              "readonly": "false",
              "stateUnit": "",
              "stateMin": "",
              "stateMax": "",
              "x": 730,
              "y": 1940,
              "wires": []
          },
          {
              "id": "b22fc4d3e3f172bb",
              "type": "mqtt-broker",
              "name": "iobroker mqtt adapter",
              "broker": "localhost",
              "port": "1883",
              "clientid": "mqttin_nodered",
              "autoConnect": true,
              "usetls": false,
              "protocolVersion": "4",
              "keepalive": "60",
              "cleansession": true,
              "birthTopic": "",
              "birthQos": "0",
              "birthPayload": "",
              "birthMsg": {},
              "closeTopic": "",
              "closeQos": "0",
              "closePayload": "",
              "closeMsg": {},
              "willTopic": "",
              "willQos": "0",
              "willPayload": "",
              "willMsg": {},
              "userProps": "",
              "sessionExpiry": ""
          }
      

      1813fc2c-e3b8-48e6-9188-bc0e12957224-image.png

      Leider funktioniert das mit einem Shelly Plug S nicht mehr.

      Hat mir jemand einen Tipp was man da anpassen muss? Mit der Shelly Doku bin ich irgendwie nicht weiter gekommen.

      Danke schon mal!

      mickym 1 Reply Last reply Reply Quote 0
      • mickym
        mickym Most Active @hotspot_2 last edited by

        @hotspot_2 Meines Erachtens muss man das nicht so komplziert über rpc Objekte machen - die sollten eigentlich funktionieren, wie Du es gemacht hast.

        Aber ansonsten probiere halt die einfache Variante:

        [
           {
               "id": "2ef69fbc49bacbff",
               "type": "inject",
               "z": "7e6af0015415146d",
               "name": "",
               "props": [
                   {
                       "p": "payload"
                   }
               ],
               "repeat": "",
               "crontab": "",
               "once": false,
               "onceDelay": 0.1,
               "topic": "",
               "payload": "on",
               "payloadType": "str",
               "x": 310,
               "y": 6760,
               "wires": [
                   [
                       "838d68081715eadb"
                   ]
               ]
           },
           {
               "id": "6f1c16bfbd1b5ff6",
               "type": "inject",
               "z": "7e6af0015415146d",
               "name": "",
               "props": [
                   {
                       "p": "payload"
                   }
               ],
               "repeat": "",
               "crontab": "",
               "once": false,
               "onceDelay": 0.1,
               "topic": "",
               "payload": "off",
               "payloadType": "str",
               "x": 310,
               "y": 6800,
               "wires": [
                   [
                       "838d68081715eadb"
                   ]
               ]
           },
           {
               "id": "838d68081715eadb",
               "type": "mqtt out",
               "z": "7e6af0015415146d",
               "name": "",
               "topic": "shellies/schalter/keller/gefrierschrkeller/command/switch:0",
               "qos": "",
               "retain": "",
               "respTopic": "",
               "contentType": "",
               "userProps": "",
               "correl": "",
               "expiry": "",
               "broker": "b22fc4d3e3f172bb",
               "x": 630,
               "y": 6780,
               "wires": []
           },
           {
               "id": "b22fc4d3e3f172bb",
               "type": "mqtt-broker",
               "name": "iobroker mqtt adapter",
               "broker": "localhost",
               "port": "1883",
               "clientid": "mqttin_nodered",
               "autoConnect": true,
               "usetls": false,
               "protocolVersion": "4",
               "keepalive": "60",
               "cleansession": true,
               "birthTopic": "",
               "birthQos": "0",
               "birthPayload": "",
               "birthMsg": {},
               "closeTopic": "",
               "closeQos": "0",
               "closePayload": "",
               "closeMsg": {},
               "willTopic": "",
               "willQos": "0",
               "willPayload": "",
               "willMsg": {},
               "userProps": "",
               "sessionExpiry": ""
           }
        ]
        
        
        

        58cc5af9-22a5-41bc-85be-bea0a79c09e6-image.png

        Ansonsten kann ich keinen Fehler entdecken - wenn Du wirklich ein Boolean schickst, das kann ich nicht sehen, was in deinem Datenpunkt ist. Überprüf halt mal ob das wirklich ein Boolean und kein Text ist.
        Ansonsten nimm halt die einfache Variante

        0e59b9aa-58f7-4a5b-9032-b6feb30ede00-image.png

        [
           {
               "id": "e9396edc08b9f61f",
               "type": "mqtt out",
               "z": "7e6af0015415146d",
               "name": "",
               "topic": "shellies/schalter/keller/gefrierschrkeller/rpc",
               "qos": "",
               "retain": "",
               "respTopic": "",
               "contentType": "",
               "userProps": "",
               "correl": "",
               "expiry": "",
               "broker": "b22fc4d3e3f172bb",
               "x": 810,
               "y": 6640,
               "wires": []
           },
           {
               "id": "fee25176647f047d",
               "type": "change",
               "z": "7e6af0015415146d",
               "name": "",
               "rules": [
                   {
                       "t": "set",
                       "p": "payload",
                       "pt": "msg",
                       "to": "{\t   \"id\":141,\t   \"src\":\"hotspot_2\",\t   \"method\":\"Switch.Set\",\t   \"params\":{\"id\":0,\"on\":payload}\t}\t \t",
                       "tot": "jsonata"
                   }
               ],
               "action": "",
               "property": "",
               "from": "",
               "to": "",
               "reg": false,
               "x": 470,
               "y": 6660,
               "wires": [
                   [
                       "e9396edc08b9f61f",
                       "57b411b641a4cb3b"
                   ]
               ]
           },
           {
               "id": "d1eada87cb8c80f4",
               "type": "inject",
               "z": "7e6af0015415146d",
               "name": "",
               "props": [
                   {
                       "p": "payload"
                   }
               ],
               "repeat": "",
               "crontab": "",
               "once": false,
               "onceDelay": 0.1,
               "topic": "",
               "payload": "true",
               "payloadType": "bool",
               "x": 290,
               "y": 6640,
               "wires": [
                   [
                       "fee25176647f047d"
                   ]
               ]
           },
           {
               "id": "30d45467d3d7f8d2",
               "type": "inject",
               "z": "7e6af0015415146d",
               "name": "",
               "props": [
                   {
                       "p": "payload"
                   }
               ],
               "repeat": "",
               "crontab": "",
               "once": false,
               "onceDelay": 0.1,
               "topic": "",
               "payload": "false",
               "payloadType": "bool",
               "x": 290,
               "y": 6680,
               "wires": [
                   [
                       "fee25176647f047d"
                   ]
               ]
           },
           {
               "id": "57b411b641a4cb3b",
               "type": "debug",
               "z": "7e6af0015415146d",
               "name": "rpc - set",
               "active": true,
               "tosidebar": true,
               "console": false,
               "tostatus": false,
               "complete": "payload",
               "targetType": "msg",
               "statusVal": "",
               "statusType": "auto",
               "x": 700,
               "y": 6700,
               "wires": []
           },
           {
               "id": "b22fc4d3e3f172bb",
               "type": "mqtt-broker",
               "name": "iobroker mqtt adapter",
               "broker": "localhost",
               "port": "1883",
               "clientid": "mqttin_nodered",
               "autoConnect": true,
               "usetls": false,
               "protocolVersion": "4",
               "keepalive": "60",
               "cleansession": true,
               "birthTopic": "",
               "birthQos": "0",
               "birthPayload": "",
               "birthMsg": {},
               "closeTopic": "",
               "closeQos": "0",
               "closePayload": "",
               "closeMsg": {},
               "willTopic": "",
               "willQos": "0",
               "willPayload": "",
               "willMsg": {},
               "userProps": "",
               "sessionExpiry": ""
           }
        ]
        

        H 1 Reply Last reply Reply Quote 0
        • H
          hotspot_2 @mickym last edited by hotspot_2

          @mickym Ich hätte noch was schreiben sollen.

          Das Problem ist im MQTT Adapter beim Shelly Plug S der Ordner /rpc nicht mehr auftaucht. Es gibt nur noch events/rpc und damit kann man nicht schalten. Aus der Doku bin ich nicht schlau geworden.

          Bei den anderen Gen2 Shellys, die ich habe, funktioniert das Beispiel von mir einwandfrei. Haben wir ja auch mal zusammen erstellt.

          mickym 3 Replies Last reply Reply Quote 0
          • mickym
            mickym Most Active @hotspot_2 last edited by

            @hotspot_2 Die events sind deswegen da , da die Events vom Gerät kommen. Alle topics, die Du schickst legt das Gerät nicht an, sondern die kommen von Dir in dem Du diese topics beschreibst. Das Gerät subscribed die.

            Also der rpc ist da sobald du was publishst und ein Gerät legt nie die topics an, auf die es hört.

            H 1 Reply Last reply Reply Quote 0
            • mickym
              mickym Most Active @hotspot_2 last edited by

              @hotspot_2 sagte in Shelly Plus Plug S - Node Red:

              Das Problem ist im MQTT Adapter beim Shelly Plug S der Ordner /rpc nicht mehr auftaucht.

              Das hängt davon ab, ob es ein Shelly Plug S Gen 3 oder Gen 1 ist - oder ein Plus mit Gen 2. Ab Generation 2 haben die, diese rpc Channels.

              1 Reply Last reply Reply Quote 0
              • mickym
                mickym Most Active @hotspot_2 last edited by

                @hotspot_2 Hast du die simple Variante ohne rpc direkt als command versucht?

                H 1 Reply Last reply Reply Quote 0
                • H
                  hotspot_2 @mickym last edited by hotspot_2

                  @mickym sagte in Shelly Plus Plug S - Node Red:

                  @hotspot_2 Die events sind deswegen da , da die Events vom Gerät kommen. Alle topics, die Du schickst legt das Gerät nicht an, sondern die kommen von Dir in dem Du diese topics beschreibst. Das Gerät subscribed die.

                  Also der rpc ist da sobald du was publishst und ein Gerät legt nie die topics an, auf die es hört.

                  Verstanden. Einmal schalten dann passt das. Danke!

                  1 Reply Last reply Reply Quote 0
                  • H
                    hotspot_2 @mickym last edited by

                    @mickym sagte in Shelly Plus Plug S - Node Red:

                    @hotspot_2 Hast du die simple Variante ohne rpc direkt als command versucht?

                    Das teste ich noch.

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

                    Support us

                    ioBroker
                    Community Adapters
                    Donate

                    710
                    Online

                    31.7k
                    Users

                    79.7k
                    Topics

                    1.3m
                    Posts

                    2
                    8
                    303
                    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