Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. Shellys ("Alt und Plus") über MQTT Adapter

    NEWS

    • Monatsrückblick - April 2025

    • Minor js-controller 7.0.7 Update in latest repo

    • Save The Date: ioBroker@Smart Living Forum Solingen, 14.06.

    Shellys ("Alt und Plus") über MQTT Adapter

    This topic has been deleted. Only users with topic management privileges can see it.
    • mickym
      mickym Most Active @hotspot_2 last edited by

      @hotspot_2 Meines Erachtens brauchst Du das nicht.

      Du solltest eigentlich in jedem Shelly einen INFO Datenpunkt haben. Dort gibts eine Eigenschaft: has_update. Der steht auf true wenn es ein Update gibt.

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

        @mickym Ja, den gibt es. Aber es sieht für mich so aus das der nur bei den Gen1 Devices vorhanden ist.

        {
          "wifi_sta": {
            "connected": true,
            "ssid": "FFHomeNet24",
            "ip": "192.168.3.56",
            "rssi": -54
          },
          "cloud": {
            "enabled": false,
            "connected": false
          },
          "mqtt": {
            "connected": true
          },
          "time": "19:13",
          "unixtime": 1687885996,
          "serial": 1,
          "has_update": false,
          "mac": "C8C9A388F8FA",
          "cfg_changed_cnt": 0,
          "actions_stats": {
            "skipped": 0
          },
          "relays": [
            {
              "ison": false,
              "has_timer": false,
              "timer_started": 0,
              "timer_duration": 0,
              "timer_remaining": 0,
              "overpower": false,
              "source": "mqtt"
            }
          ],
          "meters": [
            {
              "power": 0,
              "overpower": 0,
              "is_valid": true,
              "timestamp": 1687893196,
              "counters": [
                0,
                0,
                0
              ],
              "total": 10074
            }
          ],
          "temperature": 33.46,
          "overtemperature": false,
          "tmp": {
            "tC": 33.46,
            "tF": 92.23,
            "is_valid": true
          },
          "update": {
            "status": "idle",
            "has_update": false,
            "new_version": "20230503-101129/v1.13.0-g9aed950",
            "old_version": "20230503-101129/v1.13.0-g9aed950"
          },
          "ram_total": 52056,
          "ram_free": 39664,
          "fs_size": 233681,
          "fs_free": 166664,
          "uptime": 1540988
        }
        
        mickym 1 Reply Last reply Reply Quote 0
        • mickym
          mickym Most Active @hotspot_2 last edited by mickym

          @hotspot_2 Ok - ich sehe - na dann frag halt ab, ob es eine stable Version gibt.

          {
            "ble": {},
            "cloud": {
              "connected": false
            },
            "input:0": {
              "id": 0,
              "state": false
            },
            "mqtt": {
              "connected": true
            },
            "script:1": {
              "id": 1,
              "running": false
            },
            "switch:0": {
              "id": 0,
              "source": "init",
              "output": false,
              "temperature": {
                "tC": 46.5,
                "tF": 115.8
              }
            },
            "sys": {
              "mac": "A8032ABE54DC",
              "restart_required": false,
              "time": "16:41",
              "unixtime": 1675262494,
              "uptime": 571,
              "ram_size": 234820,
              "ram_free": 162244,
              "fs_size": 458752,
              "fs_free": 110592,
              "cfg_rev": 7,
              "kvs_rev": 1,
              "schedule_rev": 0,
              "webhook_rev": 0,
              "available_updates": {
                "beta": {
                  "version": "0.13.0-beta1"
                },
                "stable": {
                  "version": "0.12.0"
                }
              }
            },
            "wifi": {
              "sta_ip": "192.168.1.101",
              "status": "got ip",
              "ssid": "TP-LINK_F862",
              "rssi": -68
            },
            "ws": {
              "connected": false
            }
          }
          

          Es scheint so zu sein, dass wenn eine stable Version verfügbar ist, dann ist diese unter available Updates gelistet.

          Das sollte doch im status topic vorhanden sein, oder?

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

            @mickym Das oben steht im topic status/sys was ich in das Code Fenster kopiert habe.

            Bin im Moment etwas überfordert wie ich jetzt abfrage stable oder beta und dann die Versionsnummer noch in der Message / Mail mit geben könnte.

            Geht das auch mit den Punkten?

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

              @hotspot_2 80e8f951-02ff-45c4-b30a-6e7de7cfdd74-image.png

              Kannst Du zwar machen - aber das brauchst nicht - abonniere einfach diesen Datenpunkt und prüfe ab, obe eine stable Version verfügbar ist:

              82564f22-6c07-4feb-9922-51d4a4831fc4-image.png

              Wenn Du dann auch noch die Version extrahieren willst - dann schreibst die halt in ein Mail

              f90af4f7-178b-4ba4-bd9b-89d723f3e68c-image.png

              [
                 {
                     "id": "ca22f3da7d89b372",
                     "type": "inject",
                     "z": "7e6af0015415146d",
                     "name": "",
                     "props": [
                         {
                             "p": "payload"
                         }
                     ],
                     "repeat": "",
                     "crontab": "",
                     "once": false,
                     "onceDelay": 0.1,
                     "topic": "",
                     "payload": "{\"ble\":{},\"cloud\":{\"connected\":false},\"input:0\":{\"id\":0,\"state\":false},\"mqtt\":{\"connected\":true},\"script:1\":{\"id\":1,\"running\":false},\"switch:0\":{\"id\":0,\"source\":\"init\",\"output\":false,\"temperature\":{\"tC\":46.5,\"tF\":115.8}},\"sys\":{\"mac\":\"A8032ABE54DC\",\"restart_required\":false,\"time\":\"16:41\",\"unixtime\":1675262494,\"uptime\":571,\"ram_size\":234820,\"ram_free\":162244,\"fs_size\":458752,\"fs_free\":110592,\"cfg_rev\":7,\"kvs_rev\":1,\"schedule_rev\":0,\"webhook_rev\":0,\"available_updates\":{\"beta\":{\"version\":\"0.13.0-beta1\"},\"stable\":{\"version\":\"0.12.0\"}}},\"wifi\":{\"sta_ip\":\"192.168.1.101\",\"status\":\"got ip\",\"ssid\":\"TP-LINK_F862\",\"rssi\":-68},\"ws\":{\"connected\":false}}",
                     "payloadType": "json",
                     "x": 1650,
                     "y": 4500,
                     "wires": [
                         [
                             "cfee908f51dab9a0",
                             "44c0194304f63219"
                         ]
                     ]
                 },
                 {
                     "id": "cfee908f51dab9a0",
                     "type": "debug",
                     "z": "7e6af0015415146d",
                     "name": "status",
                     "active": false,
                     "tosidebar": true,
                     "console": false,
                     "tostatus": false,
                     "complete": "payload",
                     "targetType": "msg",
                     "statusVal": "",
                     "statusType": "auto",
                     "x": 1810,
                     "y": 4460,
                     "wires": []
                 },
                 {
                     "id": "44c0194304f63219",
                     "type": "switch",
                     "z": "7e6af0015415146d",
                     "name": "update?",
                     "property": "payload.sys.available_updates.stable",
                     "propertyType": "msg",
                     "rules": [
                         {
                             "t": "nnull"
                         }
                     ],
                     "checkall": "true",
                     "repair": false,
                     "outputs": 1,
                     "x": 1840,
                     "y": 4500,
                     "wires": [
                         [
                             "cfc161782d85ec28",
                             "b803619ea1582333"
                         ]
                     ]
                 },
                 {
                     "id": "cfc161782d85ec28",
                     "type": "debug",
                     "z": "7e6af0015415146d",
                     "name": "update available",
                     "active": true,
                     "tosidebar": true,
                     "console": false,
                     "tostatus": false,
                     "complete": "payload",
                     "targetType": "msg",
                     "statusVal": "",
                     "statusType": "auto",
                     "x": 2040,
                     "y": 4460,
                     "wires": []
                 },
                 {
                     "id": "b803619ea1582333",
                     "type": "change",
                     "z": "7e6af0015415146d",
                     "name": "",
                     "rules": [
                         {
                             "t": "set",
                             "p": "payload",
                             "pt": "msg",
                             "to": "payload.sys.available_updates.stable.version",
                             "tot": "msg"
                         }
                     ],
                     "action": "",
                     "property": "",
                     "from": "",
                     "to": "",
                     "reg": false,
                     "x": 2050,
                     "y": 4500,
                     "wires": [
                         [
                             "d148aac89a262a60"
                         ]
                     ]
                 },
                 {
                     "id": "d148aac89a262a60",
                     "type": "debug",
                     "z": "7e6af0015415146d",
                     "name": "stable Version verfügbar",
                     "active": true,
                     "tosidebar": true,
                     "console": false,
                     "tostatus": false,
                     "complete": "payload",
                     "targetType": "msg",
                     "statusVal": "",
                     "statusType": "auto",
                     "x": 2290,
                     "y": 4500,
                     "wires": []
                 }
              ]
              

              Von mir aus schreibst was in einen Datenpunkt - aber das analysieren des JSON sollte doch für Dich kein Problem sein und kannst es auch direkt in eine Mail-Node schreiben.

              Einfach Pfad kopieren und du kannst doch auf jede Info zugreifen.

              copy path.gif

              Du kannst natürlich auch die Analyse direkt als true oder false in einen DP schreiben - aber in meinen Augen überflüssig.

              3b6045b3-87f2-454d-aaab-169743c5ae4c-image.png

              [
                 {
                     "id": "869ed991b188bfc0",
                     "type": "change",
                     "z": "7e6af0015415146d",
                     "name": "",
                     "rules": [
                         {
                             "t": "set",
                             "p": "payload",
                             "pt": "msg",
                             "to": "payload.sys.available_updates.stable.version ? true : false",
                             "tot": "jsonata"
                         }
                     ],
                     "action": "",
                     "property": "",
                     "from": "",
                     "to": "",
                     "reg": false,
                     "x": 1990,
                     "y": 4300,
                     "wires": [
                         [
                             "5ff1fc4cf2115549"
                         ]
                     ]
                 },
                 {
                     "id": "5ff1fc4cf2115549",
                     "type": "debug",
                     "z": "7e6af0015415146d",
                     "name": "stable Version verfügbar",
                     "active": true,
                     "tosidebar": true,
                     "console": false,
                     "tostatus": false,
                     "complete": "payload",
                     "targetType": "msg",
                     "statusVal": "",
                     "statusType": "auto",
                     "x": 2250,
                     "y": 4300,
                     "wires": []
                 },
                 {
                     "id": "d57b6a5db7dcd71b",
                     "type": "inject",
                     "z": "7e6af0015415146d",
                     "name": "",
                     "props": [
                         {
                             "p": "payload"
                         }
                     ],
                     "repeat": "",
                     "crontab": "",
                     "once": false,
                     "onceDelay": 0.1,
                     "topic": "",
                     "payload": "{\"ble\":{},\"cloud\":{\"connected\":false},\"input:0\":{\"id\":0,\"state\":false},\"mqtt\":{\"connected\":true},\"script:1\":{\"id\":1,\"running\":false},\"switch:0\":{\"id\":0,\"source\":\"init\",\"output\":false,\"temperature\":{\"tC\":46.5,\"tF\":115.8}},\"sys\":{\"mac\":\"A8032ABE54DC\",\"restart_required\":false,\"time\":\"16:41\",\"unixtime\":1675262494,\"uptime\":571,\"ram_size\":234820,\"ram_free\":162244,\"fs_size\":458752,\"fs_free\":110592,\"cfg_rev\":7,\"kvs_rev\":1,\"schedule_rev\":0,\"webhook_rev\":0,\"available_updates\":{\"beta\":{\"version\":\"0.13.0-beta1\"}}},\"wifi\":{\"sta_ip\":\"192.168.1.101\",\"status\":\"got ip\",\"ssid\":\"TP-LINK_F862\",\"rssi\":-68},\"ws\":{\"connected\":false}}",
                     "payloadType": "json",
                     "x": 1810,
                     "y": 4300,
                     "wires": [
                         [
                             "869ed991b188bfc0"
                         ]
                     ]
                 }
              ]
              

              Kanst ja auch mit Wildcard die status topics abonnieren und dann das topic analysieren.

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

                @mickym Super! Danke, das hilft.

                Das mit den Wildcards klingt interessant. Könnte ich damit alle Status topics z.B. alles was unterhalb vom topic "shelies" bei mir kommt vom MQTT Adapter analysieren und dann jeweils ermitteln von wem die Meldung kommt (IP oder Name)?

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

                  @hotspot_2 Wie schaut denn Deine Struktur aus? Und dieses Info ist unter status? Du brauchst doch nicht alles - sondern nur das status topic!!! Wichtig ist halt dass Du Deine mqtt Struktur hierarchisch identisch aufgebaut hast.

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

                    @mickym Ja, das stimmt. Es würde ja völlig genügen einen von jedem Typ in Node RED abzufragen und dann Singal zu geben das was Neues da ist.

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

                      @hotspot_2 sagte in Shellys ("Alt und Plus") über MQTT Adapter:

                      @mickym Ja, das stimmt. Es würde ja völlig genügen einen von jedem Typ in Node RED abzufragen und dann Singal zu geben das was Neues da ist.

                      Normaler weise ist der status topic doch direkt unter dem topic des Gerätes - die Frage ist nur - ob alle Geräte auf gleicher Ebene sind und wie die mqtt Struktur aussieht.

                      Wie schaut es denn deine mqtt Struktur aus

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

                        @mickym Nein die sind aktuell nicht auf gleicher Ebene. Sondern aufgeteilt nach Art (Licht, Schalter, usw.) und dann nach den Bereichen (Keller, Garten, Dachgeschoss, EG, usw.).

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

                          @hotspot_2 Àuch das macht ja nichts wenn die Hierarchie die gleich ist. mqtt kannst du für jede Ebene einen Wildcard verwenden. Mach halt mal einen Screenshot und klapp die Dinger mal auf.

                          Ich hab das auch so:

                          9a0692dc-2b78-4d18-b652-fa42adda4fc1-image.png

                          bei mir sieht die Struktur so aus:

                          shellies/Art/Raum/Gerät

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

                            @mickym Sieht so aus:

                            7d9f476f-c453-4013-b092-22ae2159a0f8-image.png

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

                              @hotspot_2

                              dann schau mal ob das so passt auf gleicher Ebene.

                              shellies/+/+/+/status/sys
                              

                              Die + stehen für beliebigen Wert. Also wenn die Ebenen gleich sind bekommst Du damit alle topic in dem die Info steht. Das topic kannst dann auch noch über einen regulären Ausdruck ausfiltern. Keine Ahnung ob es in sys ist - musst Du wissen. Ich hab keine Gen2 Geräte.

                              Ansonsten kannst ja mehrer mqtt-In Nodes mit unterschiedlichen Ebenen in einen Flow laufen lassen. Du kannst ja auch das ganze topic verwenden.

                              Unspezifischen alles subscriben würde ich auf KEINEN Fall.

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

                                @mickym Wie kann ich den nochmal testen was für ein output das mqtt in node produzieren würde mit den wildcards oben? Einfach ein Debug dahintersetzen geht ja nicht.

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

                                  @hotspot_2 Freilich einfach ein debug dahinter setzen - dann siehst du ja was rauskommt. Du solltest außerdem ein

                                  2d43ed80-8eb0-40e0-b2bb-2238c268dc07-image.png

                                  command Datenpunkt direkt unter shellies haben. Dort das Kommando announce reinschreiben, dann werden alle Shellies ihren Status aktualisieren.

                                  Anhand der topics der einzelnen Nachrichten siehst Du im debug doch, von welchem Shelly die Nachricht stammt.

                                  das sollte auch für Gen2 Geräte funktionieren:

                                  b8273d17-bf1a-4bd6-a581-7fec218a00a0-image.png

                                  entweder für alle oder einzelne Geräte

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

                                    @mickym Irgendwie klappt das nicht bei mir. Da passiert nichts im debug.

                                    [
                                        {
                                            "id": "80576c1b365aebef",
                                            "type": "mqtt in",
                                            "z": "10e6b7a36260eb50",
                                            "name": "",
                                            "topic": "shellies/licht/garten/hof/status/sys",
                                            "qos": "2",
                                            "datatype": "auto-detect",
                                            "broker": "b22fc4d3e3f172bb",
                                            "nl": false,
                                            "rap": true,
                                            "rh": 0,
                                            "inputs": 0,
                                            "x": 190,
                                            "y": 180,
                                            "wires": [
                                                [
                                                    "cd4cde48c92b7d8b"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "cd4cde48c92b7d8b",
                                            "type": "debug",
                                            "z": "10e6b7a36260eb50",
                                            "name": "debug 1",
                                            "active": true,
                                            "tosidebar": true,
                                            "console": false,
                                            "tostatus": false,
                                            "complete": "true",
                                            "targetType": "full",
                                            "statusVal": "",
                                            "statusType": "auto",
                                            "x": 520,
                                            "y": 180,
                                            "wires": []
                                        },
                                        {
                                            "id": "111bda243154cac4",
                                            "type": "inject",
                                            "z": "10e6b7a36260eb50",
                                            "name": "",
                                            "props": [
                                                {
                                                    "p": "payload"
                                                }
                                            ],
                                            "repeat": "",
                                            "crontab": "",
                                            "once": false,
                                            "onceDelay": 0.1,
                                            "topic": "",
                                            "payload": "announce",
                                            "payloadType": "str",
                                            "x": 140,
                                            "y": 240,
                                            "wires": [
                                                [
                                                    "322b9cc7039a66b2"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "322b9cc7039a66b2",
                                            "type": "mqtt out",
                                            "z": "10e6b7a36260eb50",
                                            "name": "",
                                            "topic": "shellies/command",
                                            "qos": "",
                                            "retain": "",
                                            "respTopic": "",
                                            "contentType": "",
                                            "userProps": "",
                                            "correl": "",
                                            "expiry": "",
                                            "broker": "b22fc4d3e3f172bb",
                                            "x": 490,
                                            "y": 240,
                                            "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": ""
                                        }
                                    ]
                                    
                                    mickym H 2 Replies Last reply Reply Quote 0
                                    • mickym
                                      mickym Most Active @hotspot_2 last edited by

                                      @hotspot_2 Hmm das müsste gehen - Du siehst doch unter den Objekten im mqtt welche Datenpunkte aktualisiert werden. Steht das denn unter sys mit dem Update? - Wie gesagt da ich kein Gen2 Geräte habe - kann ich nur mutmaßen, wie es funktionieren sollte.

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

                                        Ich habs. Man muss "status_update" senden.

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

                                          @hotspot_2 Ah stimmt steht ja auch so drin. 😉

                                          620914eb-1ba6-4492-a5ba-97f1bdcfc1bd-image.png

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

                                            @mickym Ja, so passt das. Habe jetzt mit den "+" Zeichen von allen Gen2 eine Antwort bekommen. Kann dann auch die Gen1 einbauen und mal einen schönen Flow basteln ;-). Danke für deine Hilfe, vielleicht melde ich mich nochmal wenn's klemmt.

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate
                                            FAQ Cloud / IOT
                                            HowTo: Node.js-Update
                                            HowTo: Backup/Restore
                                            Downloads
                                            BLOG

                                            604
                                            Online

                                            31.6k
                                            Users

                                            79.4k
                                            Topics

                                            1.3m
                                            Posts

                                            5
                                            512
                                            60262
                                            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