Skip to content
  • Home
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Visualisierung
  4. [gelöst]Frage: Zufallszahl erzeugen

NEWS

  • Monatsrückblick Januar/Februar 2026 ist online!
    BluefoxB
    Bluefox
    18
    1
    776

  • Jahresrückblick 2025 – unser neuer Blogbeitrag ist online! ✨
    BluefoxB
    Bluefox
    18
    1
    6.2k

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    13
    1
    1.5k

[gelöst]Frage: Zufallszahl erzeugen

Scheduled Pinned Locked Moved Visualisierung
5 Posts 2 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pix
    wrote on last edited by
    #1

    Hallo,

    ich muss die URL einer Webcam um eine Zufallszahl von 6 Stellen erweitern. Es gibt ja die https://github.com/ioBroker/ioBroker.vis/blob/master/README.md random( R). Wie kann ich die Zahl damit erzeugen?

    Im OID-Feld des Bild-Widgets soll dann {url_des_bildes}{zufallszahl} stehen.

    Gruß,

    Pix

    ioBroker auf Ubuntu in Proxmox (früher Mac mini (bis OS X 10.12.6 Sierra), VIS via iOS; angeschlossen: Homematic CCU2, Homepilot 1, ConBee II, einige Wemos, Sonos, Unifi CK+Protect, Homekit, Homebridge; KEIN blockly! Github-Profil

    1 Reply Last reply
    0
    • BluefoxB Offline
      BluefoxB Offline
      Bluefox
      wrote on last edited by
      #2
      {url:url_des_bildes;url+Math.floor(Math.random()*1000000)}
      
      1 Reply Last reply
      0
      • P Offline
        P Offline
        pix
        wrote on last edited by
        #3

        Hat nicht ganz geklappt. Ich habe mich auch falsch ausgedrückt.

        Die URL ist

        http://www.bayerninfo.de/webcams/images … jpg?dummy=130209

        Die letzten sechs Zahlen müssen sich beim Aufruf ändern, damit ein aktuelles Bild geladen wird. @Bluefox:

        {url:url_des_bildes;url+Math.floor(Math.random()*1000000)}
        ```` `  Brachte keinen Erfolg und meldet undefined, da ich die "url_des_bildes", also den blauen Teil nicht in einem Objekt speichern, sondern direkt im Feld ****Quelle**** des basic Image Widgets eintippen will.
        

        So gehts leider nicht:

        http://www.bayerninfo.de/webcams/images/A9Munich-Nuremberg/a9-km513-brn.jpg?dummy={Math.floor(Math.random()*1000000)}
        
        

        Pix

        EDIT: Ich kann die Zufallszahl natürlich auch per JavaScript erstellen und dann hier einfügen. Ich dachte, es gibt ne Lösung ohne Script.

        ioBroker auf Ubuntu in Proxmox (früher Mac mini (bis OS X 10.12.6 Sierra), VIS via iOS; angeschlossen: Homematic CCU2, Homepilot 1, ConBee II, einige Wemos, Sonos, Unifi CK+Protect, Homekit, Homebridge; KEIN blockly! Github-Profil

        1 Reply Last reply
        0
        • BluefoxB Offline
          BluefoxB Offline
          Bluefox
          wrote on last edited by
          #4
          http://www.bayerninfo.de/webcams/images/A9Munich-Nuremberg/a9-km513-brn.jpg?dummy={d:d;Math.floor(Math.random()*1000000)}
          
          
          1 Reply Last reply
          0
          • P Offline
            P Offline
            pix
            wrote on last edited by
            #5

            @Bluefox:

            http://www.bayerninfo.de/webcams/images/A9Munich-Nuremberg/a9-km513-brn.jpg?dummy={d:d;Math.floor(Math.random()*1000000)}
            
            ```` `  
            

            So funktioniert es. Allerdings hatte ich schon wieder einen Denkfehler.

            Die Zufallszahl wird natürlich nur beim Laden der View generiert, nicht alle 15-30s, wie ich es brauche. Dann mache ich das doch mit einem Script.

            Dennoch vielen Dank, wieder was gelernt!

            Pix

            ioBroker auf Ubuntu in Proxmox (früher Mac mini (bis OS X 10.12.6 Sierra), VIS via iOS; angeschlossen: Homematic CCU2, Homepilot 1, ConBee II, einige Wemos, Sonos, Unifi CK+Protect, Homekit, Homebridge; KEIN blockly! Github-Profil

            1 Reply Last reply
            0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            Support us

            ioBroker
            Community Adapters
            Donate

            618

            Online

            32.8k

            Users

            82.7k

            Topics

            1.3m

            Posts
            Community
            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
            ioBroker Community 2014-2025
            logo
            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Home
            • Recent
            • Tags
            • Unread 0
            • Categories
            • Unreplied
            • Popular
            • GitHub
            • Docu
            • Hilfe