Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Alias DP Wert schreiben

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Alias DP Wert schreiben

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

      noch eine Frage heute in Bezug auf Alias

      //const idDstPV_Produktion = 'alias.0.PV_GesamtProduktion.PV_GesamtProduktion';
      const idDstPV_Produktion = '0_userdata.0.PV_Anlage.PV_GesamtProduktion';
      
      const idSrcSH10 = 'alias.0.SH10_Total_Output_Energy.5003_Total_Output_Energy';
      const idSrcSG3 = 'alias.0.SG3_Total_Output_Energy.5003_Total_Output_Energy';
      const idSrcSG10 = 'alias.0.SG10_Total_Output_Energy.5003_Total_Output_Energy';
      
      
      console.log ((getState(idSrcSH10).val)+ getState(idSrcSG3).val + getState(idSrcSG10).val);
      let pvp = getState(idSrcSH10).val + getState(idSrcSG3).val + getState(idSrcSG10).val;
      console.log(pvp)
      setState(idDstPV_Produktion, pvp,true);
      

      Das Script schreibt in den DP idDstPV_Produktion wie es soll
      Wenn ich aber den Alias von ganz oben nehme geht das nicht.
      Es kommt kein Fehler und der Wert im DP + Alias ist "null"
      Kann man nicht auf einen Alias schreiben?

      paul53 1 Reply Last reply Reply Quote 0
      • paul53
        paul53 @ostseeskipper last edited by paul53

        @ostseeskipper sagte: Kann man nicht auf einen Alias schreiben?

        Doch, man kann.
        Browser refresh versucht?

        1 Reply Last reply Reply Quote 0
        • O
          ostseeskipper last edited by

          @paul53
          wenn zeile 1 auskommentriert wird der errechnete Wert eingetragen
          wenn zeile 2 auskommentiert erscheint NULL

          paul53 1 Reply Last reply Reply Quote 0
          • paul53
            paul53 @ostseeskipper last edited by paul53

            @ostseeskipper sagte: wenn zeile 2 auskommentiert erscheint NULL

            Auf welchen Datenpunkt verweist der Alias (Zeile 1)?

            O 1 Reply Last reply Reply Quote 0
            • O
              ostseeskipper @paul53 last edited by ostseeskipper

              @paul53
              Der Alias in Zeile 1 verweisst auf den DP der in Zeile 2 genannt ist

              Wenn direkt auf den in Zeile 2 geschrieben wird, wird auch der Wert im Alias DP (Zeile 1) angezeigt

              paul53 1 Reply Last reply Reply Quote 0
              • paul53
                paul53 @ostseeskipper last edited by

                @ostseeskipper sagte: wird auch der Wert im Alias DP (Zeile 1) angezeigt

                Zeige bitte die Objekteigenschaften des Alias in Code tags.

                O 1 Reply Last reply Reply Quote 0
                • O
                  ostseeskipper @paul53 last edited by

                  @paul53
                  der vom Alias

                  {
                    "common": {
                      "alias": {
                        "id": "0_userdata.0.PV_Anlage.PV_GesamtProduktion",
                        "read": "",
                        "write": ""
                      },
                      "name": "PV_GesamtProduktion",
                      "role": "value",
                      "type": "number",
                      "unit": "kWh",
                      "min": null,
                      "max": null,
                      "read": true,
                      "write": true,
                      "custom": {
                        "sql.0": {
                          "enabled": true,
                          "storageType": "",
                          "counter": false,
                          "aliasId": "",
                          "debounceTime": 0,
                          "blockTime": 0,
                          "changesOnly": true,
                          "changesRelogInterval": "0",
                          "changesMinDelta": 1,
                          "ignoreBelowNumber": "",
                          "disableSkippedValueLogging": false,
                          "retention": "31536000",
                          "customRetentionDuration": 365,
                          "maxLength": 0,
                          "enableDebugLogs": false,
                          "debounce": "1000"
                        }
                      }
                    },
                    "native": {},
                    "type": "state",
                    "_id": "alias.0.PV_GesamtProduktion.PV_GesamtProduktion",
                    "acl": {
                      "object": 1636,
                      "state": 1636,
                      "owner": "system.user.gast",
                      "ownerGroup": "system.group.user"
                    },
                    "from": "system.adapter.admin.0",
                    "user": "system.user.admin",
                    "ts": 1681933744618
                  }
                  
                  paul53 1 Reply Last reply Reply Quote 0
                  • paul53
                    paul53 @ostseeskipper last edited by

                    @ostseeskipper
                    Zeilen 12, 13 sind das Problem!

                    O 1 Reply Last reply Reply Quote 0
                    • O
                      ostseeskipper @paul53 last edited by ostseeskipper

                      @paul53
                      Hab die Alias mit dem Adapter erzeugt
                      lösch ich die NULL da einfach?
                      in anderen steht "" drin

                      nun ist das so und funktioniert. DANKE

                      {
                        "common": {
                          "alias": {
                            "id": "0_userdata.0.PV_Anlage.PV_GesamtProduktion",
                            "read": "",
                            "write": ""
                          },
                          "name": "PV_GesamtProduktion",
                          "role": "value",
                          "type": "number",
                          "unit": "kWh",
                          "read": true,
                          "write": true,
                          "custom": {
                            "sql.0": {
                              "enabled": true,
                              "storageType": "",
                              "counter": false,
                              "aliasId": "",
                              "debounceTime": 0,
                              "blockTime": 0,
                              "changesOnly": true,
                              "changesRelogInterval": "0",
                              "changesMinDelta": 1,
                              "ignoreBelowNumber": "",
                              "disableSkippedValueLogging": false,
                              "retention": "31536000",
                              "customRetentionDuration": 365,
                              "maxLength": 0,
                              "enableDebugLogs": false,
                              "debounce": "1000"
                            }
                          }
                        },
                        "native": {},
                        "type": "state",
                        "_id": "alias.0.PV_GesamtProduktion.PV_GesamtProduktion",
                        "acl": {
                          "object": 1636,
                          "state": 1636,
                          "owner": "system.user.gast",
                          "ownerGroup": "system.group.user"
                        },
                        "from": "system.adapter.admin.0",
                        "user": "system.user.admin",
                        "ts": 1681933744618
                      }
                      

                      Funktioniert aber trotzdem nicht.

                      paul53 1 Reply Last reply Reply Quote 0
                      • paul53
                        paul53 @ostseeskipper last edited by

                        @ostseeskipper sagte: in anderen steht "" drin

                        Passt auch nicht zu "type": "number".
                        Lösch die beiden Zeilen raus.

                        O 1 Reply Last reply Reply Quote 0
                        • O
                          ostseeskipper @paul53 last edited by

                          @paul53
                          Ja hab ich gemacht. Komisch das ist in allen drin die mit der Adapter GUI erzeugt wurden.

                          paul53 1 Reply Last reply Reply Quote 0
                          • paul53
                            paul53 @ostseeskipper last edited by

                            @ostseeskipper sagte: die mit der Adapter GUI erzeugt wurden.

                            Welcher Adapter?
                            Man kann Alias-DP auch im Tab "Objekte" erstellen, bekommt aber erst einmal eine Warnung, bevor man die Original-ID zugewiesen hat.

                            O 2 Replies Last reply Reply Quote 0
                            • O
                              ostseeskipper @paul53 last edited by ostseeskipper

                              @paul53

                              mit diesem hier
                              ab756bfa-3fad-4442-9ffa-2cf78d20f202-grafik.png

                              und dann über automatisch erstellen

                              1 Reply Last reply Reply Quote 0
                              • O
                                ostseeskipper @paul53 last edited by

                                @paul53

                                im Objekte Tab hab ich noch nichts gesehen wie man da einen Alias anlegen kann 😞

                                paul53 1 Reply Last reply Reply Quote 0
                                • paul53
                                  paul53 @ostseeskipper last edited by paul53

                                  @ostseeskipper sagte: im Objekte Tab hab ich noch nichts gesehen wie man da einen Alias anlegen kann

                                  Einfach Objekte unter "alias.0" erstellen. Bei Datenpunkten gibt es dann einen zusätzlichen Tab für die Alias-Eigenschaften.

                                  @ostseeskipper sagte in Alias DP Wert schreiben:

                                  über automatisch erstellen

                                  Diese Funktion habe ich nie genutzt. Sie könnte das Problem sein.

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

                                  Support us

                                  ioBroker
                                  Community Adapters
                                  Donate

                                  892
                                  Online

                                  31.7k
                                  Users

                                  79.8k
                                  Topics

                                  1.3m
                                  Posts

                                  2
                                  15
                                  473
                                  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