Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Datenpunkt aufsplitten?

    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

    Datenpunkt aufsplitten?

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

      Hallo Leute,
      folgende Situation:

      Ich habe in meinem ryd Adapter einen Datenpunkt mit den Koordinaten von meinem Auto in folgendem Format:
      ryd.jpg

      Um diesen Datenpunkt in meiner VIS (openStreetMap) darzustellen, müsste ich die Koordinaten aber getrennt haben.

      Map.jpg

      Das kann man doch sicherlich irgendwie mit einem Script splitten, oder?

      Bin da leider nicht so bewandert und hoffe Ihr könnt mir dabei helfen.

      Danke schon mal und allen noch ein frohes Neues...

      Gruß Rico

      arteck 1 Reply Last reply Reply Quote 0
      • arteck
        arteck Developer Most Active @RicoGesch last edited by

        @RicoGesch

        das ist er array was du da hast

        datenpunkt und dann xxx.xxx.xxx.loc[0] für die erste zahl xxx.xxx.xxx.loc[1] für die 2.te

        R 1 Reply Last reply Reply Quote 0
        • R
          RicoGesch @arteck last edited by

          @arteck Könntest Du mir das bitte etwas genauer erklären was Du meinst, bin da leider ein Anfänger...

          Danke

          paul53 arteck 2 Replies Last reply Reply Quote 0
          • paul53
            paul53 @RicoGesch last edited by paul53

            @RicoGesch

            const idPos = 'ryd.0.things.5a576364048084340c9657a9.curLocation.loc'; 
            const idLong = '0_userdata.0.Auto.Long';
            const idLat = '0_userdata.0.Auto.Lat';
            
            function position(pos) {
                pos = JSON.parse(pos);
                setState(idLong, pos[0], true);
                setState(idLat, pos[1], true);
            }
            
            position(getState(idPos).val); // Script start
            on(idPos, function(dp) {
                position(dp.state.val);
            });
            
            R 1 Reply Last reply Reply Quote 0
            • arteck
              arteck Developer Most Active @RicoGesch last edited by

              @RicoGesch klick hier und poste es

              d48bb5b7-ca32-41c4-9d6e-e1e0a273d8f6-grafik.png

              R 1 Reply Last reply Reply Quote 0
              • R
                RicoGesch @arteck last edited by

                @arteck

                ryd.0.things.5a576364048084340c9657a9.curLocation

                arteck 1 Reply Last reply Reply Quote 0
                • R
                  RicoGesch @paul53 last edited by RicoGesch

                  @paul53 @arteck Vielen Dank!!!!

                  Ihr seid super!!!

                  Gruß Rico

                  1 Reply Last reply Reply Quote 0
                  • arteck
                    arteck Developer Most Active @RicoGesch last edited by

                    @RicoGesch sagte in Datenpunkt aufsplitten?:

                    ryd.0.things.5a576364048084340c9657a9.curLocation

                    das trägst du da ein

                    {ryd.0.things.5a576364048084340c9657a9.curLocation.loc[0]}
                    

                    adcb8182-a506-42cd-a0df-c3ae65648be7-grafik.png

                    und das unten drunter

                    {ryd.0.things.5a576364048084340c9657a9.curLocation.loc[1]}
                    
                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post

                    Support us

                    ioBroker
                    Community Adapters
                    Donate

                    598
                    Online

                    31.8k
                    Users

                    80.0k
                    Topics

                    1.3m
                    Posts

                    javascript
                    3
                    8
                    471
                    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