Skip to content
  • 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
Logo
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. Withings Daten einlesen

NEWS

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    8.0k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    13
    1
    1.8k

  • Neues Video "KI im Smart Home" - ioBroker plus n8n
    BluefoxB
    Bluefox
    15
    1
    2.0k

Withings Daten einlesen

Withings Daten einlesen

Scheduled Pinned Locked Moved Skripten / Logik
126 Posts 27 Posters 32.7k Views 19 Watching
  • 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
    #2

    Hier noch ein passendes VIS Widget:

    261_bildschirmfoto_2015-08-17_um_17.18.51.png

    ! ````
    [{"tpl":"tplMetroTileString","data":{"visibility-cond":"==","visibility-val":1,"bg_class_true":"bg-cyan","bg_class_false":"bg-transparent","icon_class_true":"icon-custom","icon_class_false":"icon-custom","badge_bg_class_true":"","badge_bg_class_false":"","icon_badge_true":"","icon_badge_false":"","brand_bg_class_true":"","brand_bg_class_false":"","name":"Withings Schritte","visibility-oid":"","content_prepend":"Withings Schritte  ","content_append":"","content_oid":"javascript.1.Withings.Schritte","label_prepend":"Gewicht: {javascript.1.Withings.Gewicht} kg","label_append":"","label_id":"","state_oid":"javascript.1.Withings.Schritte.Ziel_erreicht_J","transform":false,"select_on_true":false,"icon":"/vis.0/main/img/schritte.png","icon_width":"50%","icon_height":"50%","icon_false":"/vis.0/main/img/schritte.png","icon_top":"57","icon_left":"44","hover":false},"style":{"left":"295px","top":"200px","width":"137px","height":"137px","z-index":"15","font-family":"","color":"","font-size":""},"widgetSet":"metro"}]

    Es verändert den Hintergrund von Transparent nach Cyan, sobald die Variable javascript.1.Withings.Schritte.Ziel_erreicht_J auf 1 geht.
    
    Dazu prüft ein zweites Skript die aktuelle Zahl der Schritte und setzt bei 10000 die Boolean-Variable um.
    
    >! ````
    var idSchritte = "javascript.1.Withings.Schritte"/*Withings Schritte*/,
        idSchrittzielJ = "javascript.1.Withings.Schritte.Ziel_erreicht_J",
    >! // Schritte prüfen, bei Ziel erreicht Variable umstellen
    on( {
        id: idSchritte,
        valGt: 9999
    }, function (data) {
        if (getState(idSchrittzielJ).val === 0) {
            setState(idSchrittzielJ, 1);
            log('Schrittziel erreicht, Variable gesetzt', 'info');
        }
    });
    >! // Variable täglich um Mitternacht zurücksetzen
    schedule("0 0 * * *", function () {
        setState(idSchrittzielJ, 0);
        log('Schrittziel-Variable zurückgesetzt', 'info');
    });
    

    Dieses Skript läuft in der Javascript Instanz 0, die Schritte werden in der Instanz 1 eingelesen. Daher musste ich die variable idSchrittzielJ im anderen Skript in der Instanz 1 definieren.

    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
    • ruhr70R Offline
      ruhr70R Offline
      ruhr70
      wrote on last edited by
      #3

      Super!!! Ich teste das gleich direkt mal 😉

      Adapter: Fritzbox, Unify Circuit
      Skripte: dynamic hue, Bluetooth Scan, Multi-Ereignisliste

      1 Reply Last reply
      0
      • T Offline
        T Offline
        thiel
        wrote on last edited by
        #4

        Hey Pix,

        funktioniert das ganze auch noch nachdem es jetzt Nokia ist? Denn irgendwie komme ich nicht ganz so zurecht.

        1 Reply Last reply
        0
        • P Offline
          P Offline
          pix
          wrote on last edited by
          #5

          Hallo, noch nicht am Rechner, dauert noch ein paar Tage. Werde dann checken.

          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
          • lobomauL Offline
            lobomauL Offline
            lobomau
            wrote on last edited by
            #6

            Und gibt's was neues? Bin am überlegen mir so eine Nokia Waage zuzulegen. Heutzutage muss ja alles mit ioBroker kompatibel sein 😉

            Host: NUC8i3 mit Proxmox:

            • ioBroker CT Debian 13, npm 10.9.3, nodejs 22.20.0
            • Slave: Pi4
            1 Reply Last reply
            0
            • P Offline
              P Offline
              pix
              wrote on last edited by
              #7

              Hallo,

              hab den Thread gerade erst wieder gesehen und schieb ihn mal hoch: Habe mein Skript kaum geändert. Ich hab gerad kaum Zeit, aber ich leg es mir auf Wiedervorlage 😄

              Auf jeden Fall geht es. Ich musste nur den OAUTH-Schlüssel für die Withings (jetzt Nokia) API erneuern (was etwas kompliziert ist).

              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
              • lobomauL Offline
                lobomauL Offline
                lobomau
                wrote on last edited by
                #8

                Ok, dann probiere ich mich mal daran. Waage ist heute angekommen 🙂

                Host: NUC8i3 mit Proxmox:

                • ioBroker CT Debian 13, npm 10.9.3, nodejs 22.20.0
                • Slave: Pi4
                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  pix
                  wrote on last edited by
                  #9

                  Hallo,

                  wie sieht’s aus? Habe nochmal ins Skript geguckt: habe kein Änderungen vorgenommen nur die Authentifizierung erneuert.

                  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
                  • lobomauL Offline
                    lobomauL Offline
                    lobomau
                    wrote on last edited by
                    #10

                    API Key und API Secret hatte ich gleich erstellt gehabt. Die weiteren Schritte muss ich noch machen… war für mich nicht sofort ersichtlich wie es geht.

                    Host: NUC8i3 mit Proxmox:

                    • ioBroker CT Debian 13, npm 10.9.3, nodejs 22.20.0
                    • Slave: Pi4
                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      pix
                      wrote on last edited by
                      #11

                      Welche weiteren Schritte?

                      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
                      • lobomauL Offline
                        lobomauL Offline
                        lobomau
                        wrote on last edited by
                        #12

                        @pix:

                        Welche weiteren Schritte? > …ein oauth access token, einen oauth access token secret und die user id erhalten... `
                        Hab es hinbekommen 🙂 Funktioniert… jedenfalls wurde schon das korrekte letzte Gewicht abgerufen und die Schrittzahl.

                        Hinweis:

                        API Key = Consumer key

                        API Secret = Consumer secret

                        Host: NUC8i3 mit Proxmox:

                        • ioBroker CT Debian 13, npm 10.9.3, nodejs 22.20.0
                        • Slave: Pi4
                        1 Reply Last reply
                        0
                        • lobomauL Offline
                          lobomauL Offline
                          lobomau
                          wrote on last edited by
                          #13

                          Dein kleines Schritte-Script gibt bei mir einen Fehler aus.

                          In Zeile 5: Missing ";" before statement

                          Und im log:

                          javascript.1	2017-09-26 14:51:36.680	error	script.js.Nokia-Body_Schritte compile failed: SyntaxError: Unexpected token (
                          

                          Host: NUC8i3 mit Proxmox:

                          • ioBroker CT Debian 13, npm 10.9.3, nodejs 22.20.0
                          • Slave: Pi4
                          1 Reply Last reply
                          0
                          • P Offline
                            P Offline
                            pix
                            wrote on last edited by
                            #14

                            Schön, dass es fast klappt.

                            Kannst du bitte das Skript posten, auf das du dich beziehst? Ich weiß nicht, was du mit "kleines Schritte-Script" meinst.

                            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
                            • lobomauL Offline
                              lobomauL Offline
                              lobomau
                              wrote on last edited by
                              #15

                              Gerne. Ich fand das hier bei zwei Scripten recht übersichtlich 🙂

                              var idSchritte = "javascript.1.Withings.Schritte"/*Withings Schritte*/,
                                  idSchrittzielJ = "javascript.1.Withings.Schritte.Ziel_erreicht_J",
                              
                              // Schritte prüfen, bei Ziel erreicht Variable umstellen
                              on( {
                                  id: idSchritte,
                                  valGt: 9999
                              }, function (data) {
                                  if (getState(idSchrittzielJ).val === 0) {
                                      setState(idSchrittzielJ, 1);
                                      log('Schrittziel erreicht, Variable gesetzt', 'info');
                                  }
                              });
                              
                              // Variable täglich um Mitternacht zurücksetzen
                              schedule("0 0 * * *", function () {
                                  setState(idSchrittzielJ, 0);
                                  log('Schrittziel-Variable zurückgesetzt', 'info');
                              });
                              

                              Host: NUC8i3 mit Proxmox:

                              • ioBroker CT Debian 13, npm 10.9.3, nodejs 22.20.0
                              • Slave: Pi4
                              1 Reply Last reply
                              0
                              • P Offline
                                P Offline
                                pix
                                wrote on last edited by
                                #16

                                Jetzt weiß ich, was du meinst.

                                Das ist das Skript zur Meldung des erreichten Schrittziels.

                                Es werden zwei Variablen deklariert. Nach der zweiten sollte in Semikolon und kein Komma kommen. Das ist ein Fehler.

                                Also vorn im „var-Bereich“

                                Getippt mit tapatalk

                                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

                                Damrak2022D 1 Reply Last reply
                                0
                                • lobomauL Offline
                                  lobomauL Offline
                                  lobomau
                                  wrote on last edited by
                                  #17

                                  Alles klar. So ist ohne Fehler:

                                  var idSchritte = "javascript.1.Withings.Schritte"/*Withings Schritte*/,
                                      idSchrittzielJ = "javascript.1.Withings.Schritte.Ziel_erreicht_J";
                                  
                                  // Schritte prüfen, bei Ziel erreicht Variable umstellen
                                  on( {
                                      id: idSchritte,
                                      valGt: 9999
                                  }, function (data) {
                                      if (getState(idSchrittzielJ).val === 0) {
                                          setState(idSchrittzielJ, 1);
                                          log('Schrittziel erreicht, Variable gesetzt', 'info');
                                      }
                                  });
                                  
                                  // Variable täglich um Mitternacht zurücksetzen
                                  schedule("0 0 * * *", function () {
                                      setState(idSchrittzielJ, 0);
                                      log('Schrittziel-Variable zurückgesetzt', 'info');
                                  });
                                  

                                  Host: NUC8i3 mit Proxmox:

                                  • ioBroker CT Debian 13, npm 10.9.3, nodejs 22.20.0
                                  • Slave: Pi4
                                  1 Reply Last reply
                                  0
                                  • lobomauL Offline
                                    lobomauL Offline
                                    lobomau
                                    wrote on last edited by
                                    #18

                                    Bei mir funktioniert das Automatsiche Abrufen noch nicht. Das sollte alle 5min passieren, wenn ich das Script richtig verstehe.

                                    Das Gewicht eingelesen, wenn ich das SCript neustarte. Dabei kommt auch ein Fehler:

                                    javascript.1	2017-09-27 12:35:36.094	error	script.js.Nokia-Body: schedule callback missing
                                    

                                    Host: NUC8i3 mit Proxmox:

                                    • ioBroker CT Debian 13, npm 10.9.3, nodejs 22.20.0
                                    • Slave: Pi4
                                    1 Reply Last reply
                                    0
                                    • uweredU Offline
                                      uweredU Offline
                                      uwered
                                      wrote on last edited by
                                      #19

                                      @lobomau:

                                      @pix:

                                      Welche weiteren Schritte? > …ein oauth access token, einen oauth access token secret und die user id erhalten... `
                                      Hab es hinbekommen 🙂 Funktioniert… jedenfalls wurde schon das korrekte letzte Gewicht abgerufen und die Schrittzahl.

                                      Hinweis:

                                      API Key = Consumer key

                                      API Secret = Consumer secret `

                                      Hallo,

                                      irgendwie stehe ich hier auf dem Schlauch.

                                      Wie kommt man denn an den "oauth access token" und das "oauth access token secret" ?

                                      Danke für Hinweise ….

                                      1 Reply Last reply
                                      0
                                      • P Offline
                                        P Offline
                                        pix
                                        wrote on last edited by
                                        #20

                                        Hinweis: steht im ersten Post.

                                        Stichwort: Withings/Nokia API

                                        Achtung: npm Modul oauth nicht vergessen.

                                        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
                                        • uweredU Offline
                                          uweredU Offline
                                          uwered
                                          wrote on last edited by
                                          #21

                                          Danke pix, für den "Nackenschlag" 😉

                                          ( Der Fehler saß vor der Tastatur und war zu blöd für cut+paste …. )

                                          Gruss

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          Support us

                                          ioBroker
                                          Community Adapters
                                          Donate

                                          543

                                          Online

                                          32.4k

                                          Users

                                          81.3k

                                          Topics

                                          1.3m

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

                                          • Don't have an account? Register

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