Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Praktische Anwendungen (Showcase)
    4. [Linux Shell-Skript] WLAN-Wetterstation

    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

    [Linux Shell-Skript] WLAN-Wetterstation

    This topic has been deleted. Only users with topic management privileges can see it.
    • SBorg
      SBorg Forum Testing Most Active @Negalein last edited by

      @negalein sagte in [Linux Shell-Skript] WLAN-Wetterstation:

      @sborg sagte in [Linux Shell-Skript] WLAN-Wetterstation:

      Kommen die Daten jetzt noch immer regelmäßig an?

      nein, seit Mittwoch 19 Uhr tot

      Dann stelle es wieder zurück, ev. geht es wieder und war ein längeres Problem bei Windy bzgl. Österreich.
      Ich kann es nicht nachstellen und habe außer Geocaching keine Idee mehr. Hast du einen VPN und könntest notfalls den Zugang auf bspw. Deutschland verbiegen?

      1 Reply Last reply Reply Quote 0
      • SBorg
        SBorg Forum Testing Most Active @icebear last edited by

        @icebear sagte in [Linux Shell-Skript] WLAN-Wetterstation:

        jetzt hab ich mir mal die wetterstation.conf angesehen und festgestellt das bei den Zusatzsensoren die WS80, WH40H und WH/WN32 nicht explizit aufgeführt sind.

        Liegt schlichtweg daran, dass noch keiner einen der Sensoren hatte. Da ich keinen Support von Ecowitt habe, weiß ich einfach nicht wie die Bezeichner lauten. Wenn du/jemand den String postet kann ich sie auch implementieren 🙂

        1 Reply Last reply Reply Quote 0
        • SBorg
          SBorg Forum Testing Most Active @Negalein last edited by

          @negalein sagte in [Linux Shell-Skript] WLAN-Wetterstation:

          ich kann seit heute Vormittag nichts mehr an Awekas schicken.

          Hatte ich schon Samstag Morgen bei Awekas gemeldet und geht seit aktuell ca. 4 Stunden wieder.

          1 Reply Last reply Reply Quote 0
          • S
            Shakira1972 @Shakira1972 last edited by

            @shakira1972 sagte in [Linux Shell-Skript] WLAN-Wetterstation:

            @boronsbruder sagte in [Linux Shell-Skript] WLAN-Wetterstation:

            @sborg meinte die Kommandozeile ./wetterstation.sh --data ausführen und die Ausgabe der Sensoren, ohne den ganzen Krismkrams darum, posten:

            Ok, ich hoffe das sind nun die richtigen Werte...

            soilmoisture1=50&soilad1=240&soilmoisture2=47&soilad2=249&soilmoisture3=35&soilad3=196&soilmoisture4=46&soilad4=245&soilmoisture5=50&soilad5=260&soilmoisture6=47&soilad6=247&soilmoisture7=41&soilad7=225&soilmoisture8=38&soilad8=222&soilmoisture9=50&soilad9=250&soilmoisture10=48&soilad10=238&soilmoisture11=58&soilad11=282&soilmoisture12=52&soilad12=248&soilmoisture13=54&soilad13=257&soilmoisture14=50&soilad14=239&soilmoisture15=53&soilad15=255&soilmoisture16=56&soilad16=261
            

            Wenn ich das richtig verstehe, dann zeigt es hier, im Gegensatz zu den Werten in IoBroker, die richtigen Werte an.
            Aktuell in IoBroker:
            0f813add-e6a0-44ac-87c8-12eedcfdb69f-image.png
            Danke für Eure Hilfe!

            Niemand eine Idee, woran es liegen könnte?
            Danke
            Shaki

            1 Reply Last reply Reply Quote 0
            • Boronsbruder
              Boronsbruder @SBorg last edited by

              @Shakira1972

              @sborg sagte in [Linux Shell-Skript] WLAN-Wetterstation:

              Da ich einen gedanklichen Fehler bei der V3.5.0 bei der Erhöhung der Sensoranzahl auf 16 Stück beim DP100 hatte:

              Neues Bugfix-Release des Wetterstation WLAN-Skriptes auf GitHub V3.5.1

              • ~ Fix falsche Messwerte bei DP100 Sensor Nr.1 wenn mehr als 10 Sensoren vorhanden sind

              Wie immer zu finden im GitHub


              Update-Routine von Vorgängerversion:

              • aktuellen WS-Updater nutzen

                wget -O ws_updater.sh https://raw.githubusercontent.com/SBorg2014/WLAN-Wetterstation/master/ws_updater.sh
              • ./ws_updater.sh im Installationsverzeichnis ausführen
              • Menüpunkt "4" wählen und die Fragen beantworten

              Update enthält lediglich einen Fix für mehr als 9 Stück DP100 Sensoren, ist also optional.

              S 1 Reply Last reply Reply Quote 0
              • S
                Shakira1972 @Boronsbruder last edited by

                @boronsbruder Super, hat funktioniert!
                Danke!

                R 1 Reply Last reply Reply Quote 0
                • R
                  Rand @Shakira1972 last edited by

                  Leicht OT, aber vieleicht hilft es ja jemanden 🙂

                  Hatte ja nach einem Weg gesucht den WFC01 auszulesen und nun ein einfaches JS basteln lassen:

                  const gwIp = '192.168.x.y'; // Replace with your actual GW2000 IP
                  const deviceId = 13443;      // Your WFC01 device ID
                  const model = 1;             // Always 1 for WFC01
                  const request = require('request');
                  
                  const enableLogging = true;
                  const statePrefix = 'javascript.0.WFC01';
                  
                  function logDebug(msg) {
                      if (enableLogging) log(msg);
                  }
                  
                  function createAndSetState(id, value, unit = '', type = 'number') {
                      const fullId = `${statePrefix}.${id}`;
                      if (!existsState(fullId)) {
                          createState(fullId, value, {
                              type: type,
                              read: true,
                              write: false,
                              unit: unit
                          });
                          logDebug(`Created state: ${fullId}`);
                      }
                      setState(fullId, value, true);
                      logDebug(`Updated ${fullId} → ${value}${unit}`);
                  }
                  
                  const options = {
                      url: `http://${gwIp}/parse_quick_cmd_iot`,
                      method: 'POST',
                      headers: {
                          'Content-Type': 'application/json'
                      },
                      body: JSON.stringify({
                          command: [{
                              cmd: "read_device",
                              id: deviceId,
                              model: model
                          }]
                      }),
                      timeout: 5000
                  };
                  
                  logDebug('Sending POST request to WFC01...');
                  request(options, (error, response, body) => {
                      if (error) {
                          logDebug(`Request error: ${error}`);
                          return;
                      }
                  
                      if (response.statusCode !== 200) {
                          logDebug(`Unexpected status code: ${response.statusCode}`);
                          logDebug(`Response body: ${body}`);
                          return;
                      }
                  
                      if (!body) {
                          logDebug('Empty response body');
                          return;
                      }
                  
                      try {
                          const data = JSON.parse(body);
                          logDebug(`Parsed JSON data: ${JSON.stringify(data)}`);
                  
                          const d = data.command[0];
                  
                          createAndSetState('flow_velocity', parseFloat(d.flow_velocity), 'L/min');
                          createAndSetState('water_total', parseFloat(d.water_total), 'L');
                          createAndSetState('water_status', parseInt(d.water_status));
                          createAndSetState('water_temp', parseFloat(d.water_temp), '°C');
                          createAndSetState('battery', parseInt(d.wfc01batt));
                          createAndSetState('signal', parseInt(d.rssi));
                          createAndSetState('warning', parseInt(d.warning));
                          createAndSetState('run_time', parseInt(d.run_time), 's');
                  
                      } catch (e) {
                          logDebug(`JSON parse error: ${e.message}`);
                      }
                  });
                  
                  

                  Habs ohne >request< nicht hinbekommen, da hat er den call nicht sauber gemacht.
                  Die Infos dazu stammen aus dem Ecowitt API document welches sie auf Anfrage verschicken (Local IOT API 20240828.docx in meinem Fall).

                  S 2 Replies Last reply Reply Quote 0
                  • S
                    Solardach @Rand last edited by

                    @rand Hallo !
                    Vielen Dank für das Skript, 👍 👏
                    Danach hatte ich schon länger gesucht.
                    Ich habe es installiert und läuft bei mir mit der WS3900A Wetterstation als Gateway.
                    Den Punkt "happen_water" habe ich noch dazu gesetzt.

                    water volume when water program starts. (L = water_total - happen_water)

                    1 Reply Last reply Reply Quote 0
                    • S
                      Solardach @Rand last edited by

                      @rand
                      Das Problem mit dem Skript ist, das es keinen Trigger gibt.
                      Es werden nur einmalig beim Skript Start die Werte eingelesen und das wars.
                      Vieleicht kann man noch einen Trigger mit einbauen ?

                      R 1 Reply Last reply Reply Quote 0
                      • R
                        Rand @Solardach last edited by Rand

                        @solardach

                        Klar, danke, hätte vieleicht vorher prüfen sollen ob alles tut, aber es war spät;)
                        Es wird auch ohne saubere Werte angelegt (nur als State, das habe ich auch noch gemacht (machen lassen ;))

                        Edit: So Water_happen sollte mit drin sein, hat es beim ersten durchlauf gestern scheinbar ignoriert, aber ist auch bei mir vorhanden.

                        Edit 2 - Es gab noch eine Diskrepanz zwischen State und Ihrem Datentyp (numerisch) -> ping @Solardach

                        const gwIp = '192.168.x.y';
                        const deviceId = 13443;
                        const model = 1;
                        const request = require('request');
                        
                        const enableLogging = true;
                        const statePrefix = 'javascript.0.WFC01';
                        
                        function logDebug(msg) {
                            if (enableLogging) log(msg);
                        }
                        
                        // Create or update state with proper type, role, unit
                        function recreateState(id, value, meta) {
                            const fullId = `${statePrefix}.${id}`;
                        
                            // If state exists, only update value
                            if (!existsState(fullId)) {
                                createState(fullId, value, {
                                    type: meta.type,
                                    role: meta.role,
                                    read: true,
                                    write: false,
                                    unit: meta.unit || ''
                                });
                                logDebug(`Created state: ${fullId}`);
                            }
                        
                            setState(fullId, value, true);
                            logDebug(`Updated ${fullId} → ${value}${meta.unit || ''}`);
                        }
                        
                        // Define correct roles per ioBroker documentation
                        const fieldDefinitions = {
                            flow_velocity:  { unit: 'L/min', type: 'number', role: 'value.flow' },
                            water_total:    { unit: 'L',     type: 'number', role: 'value.total' },
                            water_status:   {                type: 'number', role: 'value.status' },
                            water_temp:     { unit: '°C',    type: 'number', role: 'value.temperature' },
                            battery:        {                type: 'number', role: 'value.battery' },
                            signal:         {                type: 'number', role: 'value.signal' },
                            warning:        {                type: 'number', role: 'value.warning' },
                            run_time:       { unit: 's',     type: 'number', role: 'value.interval' }
                        };
                        
                        const options = {
                            url: `http://${gwIp}/parse_quick_cmd_iot`,
                            method: 'POST',
                            headers: { 'Content-Type': 'application/json' },
                            body: JSON.stringify({
                                command: [{
                                    cmd: "read_device",
                                    id: deviceId,
                                    model: model
                                }]
                            }),
                            timeout: 5000
                        };
                        
                        logDebug('Sending POST request to WFC01...');
                        request(options, (error, response, body) => {
                            if (error) {
                                logDebug(`Request error: ${error}`);
                                return;
                            }
                        
                            if (response.statusCode !== 200) {
                                logDebug(`Unexpected status code: ${response.statusCode}`);
                                logDebug(`Response body: ${body}`);
                                return;
                            }
                        
                            if (!body) {
                                logDebug('Empty response body');
                                return;
                            }
                        
                            try {
                                const data = JSON.parse(body);
                                logDebug(`Parsed JSON data: ${JSON.stringify(data)}`);
                                const d = data.command[0];
                        
                                recreateState('flow_velocity', parseFloat(d.flow_velocity), fieldDefinitions.flow_velocity);
                                recreateState('water_total', parseFloat(d.water_total), fieldDefinitions.water_total);
                                recreateState('water_status', parseInt(d.water_status), fieldDefinitions.water_status);
                                recreateState('water_temp', parseFloat(d.water_temp), fieldDefinitions.water_temp);
                                recreateState('battery', parseInt(d.wfc01batt), fieldDefinitions.battery);
                                recreateState('signal', parseInt(d.rssi), fieldDefinitions.signal);
                                recreateState('warning', parseInt(d.warning), fieldDefinitions.warning);
                                recreateState('run_time', parseInt(d.run_time), fieldDefinitions.run_time);
                        
                            } catch (e) {
                                logDebug(`JSON parse error: ${e.message}`);
                            }
                        });
                        
                        
                        S 1 Reply Last reply Reply Quote 0
                        • S
                          Solardach @Rand last edited by

                          @rand
                          Kann es sein das jetzt ein altes Skript drin steht ?
                          Es verursacht mehr Probleme mit den Datentypen, und es fehlen die Werte water_happen und Volume.

                          R 1 Reply Last reply Reply Quote 0
                          • R
                            Rand @Solardach last edited by

                            @solardach
                            Ja. Der nachteil von ChatGPT, man muss immer alles doppelt und dreifach prüfen 😞
                            Ich repariere es nachher.

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

                            Support us

                            ioBroker
                            Community Adapters
                            Donate

                            945
                            Online

                            31.9k
                            Users

                            80.1k
                            Topics

                            1.3m
                            Posts

                            linux shell-script wetterstation wlan-wetterstation
                            147
                            5570
                            3346577
                            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