Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. [Vorlage] Einbinden des Xiaomi Mijia Bluetooth Thermo- und Hygrometer

    NEWS

    • ioBroker goes Matter ... Matter Adapter in Stable

    • 15. 05. Wartungsarbeiten am ioBroker Forum

    • Monatsrückblick - April 2025

    [Vorlage] Einbinden des Xiaomi Mijia Bluetooth Thermo- und Hygrometer

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

      @Colt @AlCalzone schrieb, dass es da wohl mehrere Monate für eine Lösung dauern könnte. Es müsste aber mittels des Phyton-Scripts auf GitHub möglich sein.

      1 Reply Last reply Reply Quote 0
      • S
        Stoni last edited by

        Hallo, kann jemand was zur BT Reichweite sagen? Pi4 mit ioB hängt im EG, Thermostate sollen im ganzen Haus hängen, also bis zu 10 Meter durch Wände in Fertigbauweise, bzw Stahlbetondecke in den Keller.
        Erfahrungen?

        Gruß Stoni

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

          @Stoni sagte

          Erfahrungen? ... Stahlbetondecke ...

          Diesbzgl. keine guten 😉
          Genau wird dir das aber niemand beantworten können, da dies von zu vielen Faktoren abhängt. Ich mache dann immer einen rudimentären Reichweitencheck: BT-Stick am Laptop an den einen Standort, Smartphone an den anderen und dann schauen ob sie sich verbinden können...
          Wenn es BT sein muss, könnte man auch notfalls einen PI Zero oä. als 2. Verbindungspunkt einsetzen.

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

            @SBorg Danke für den Tipp. Hab gerade mal mein Handy in den Keller gelegt und per Laptop gesucht. Wurde nicht gefunden, ergo scheinbar keine Verbindung durch Stahlbeton.
            Es muss nicht zwangsläufig BT sein, ich suche halt noch günstige Alternativen zu den HM-Thermostaten mit ner Anzeige und da stieß ich auf die Mijia. Hab schon einige Aqara im Einsatz, aber wollte was mit Display.

            1 Reply Last reply Reply Quote 0
            • J
              jhuebner1 @Soulforged last edited by

              @Soulforged
              Mal ne doofe Frage:
              Für 3x Hyrgometer, muss ich 3x Scripte anleghen oder kann ich die MAC Adressen irgendwo hintereinander schreiben?

              1 Reply Last reply Reply Quote 0
              • T
                Torsten G. @Colt last edited by

                @Colt said in [Vorlage] Einbinden des Xiaomi Mijia Bluetooth Thermo- und Hygrometer:

                Hallo zusammen,
                gibt es mittlerweile eine möglichkeit den LYWSD03MMC in den iObroker zu bekommen?

                Ich habe mir 2 Stück für 9 Euro zugelegt und stehe nun auch vor der Frage ob jemand schon eine Lösung gefunden hat. Ich habe mir die für die Luftfeuchtigkeit im Keller gekauft und würde die gerne über VIS anzeigen lassen bzw. den Luftentfeuchter starten lassen.

                Wenn jemand schon eine Lösung gefunden hat immer her damit. Aber für Anfänger geeignet 🙂

                Viele Grüße
                Torsten

                SBorg Lenny.CB 2 Replies Last reply Reply Quote 0
                • SBorg
                  SBorg Forum Testing Most Active @Torsten G. last edited by

                  @Torsten-G sagte in [Vorlage] Einbinden des Xiaomi Mijia Bluetooth Thermo- und Hygrometer:

                  Wenn jemand schon eine Lösung gefunden hat immer her damit. Aber für Anfänger geeignet

                  Lösung ja, aber auch für Anfänger? Zumindest ist es nicht sooo schwer: alternative Firmware flashen
                  Gibt auch hier im Forum schon paar Posts dazu: Projekt auf GitHub

                  1 Reply Last reply Reply Quote 0
                  • Lenny.CB
                    Lenny.CB Most Active @Torsten G. last edited by Lenny.CB

                    @Torsten-G schau dir mal die Anleitung an:
                    https://forum.iobroker.net/topic/28388/xiaomi-temp-and-humidity-monitor-2-ble-adapter/97

                    T 1 Reply Last reply Reply Quote 0
                    • T
                      Torsten G. @Lenny.CB last edited by

                      @Lenny-CB said in [Vorlage] Einbinden des Xiaomi Mijia Bluetooth Thermo- und Hygrometer:

                      @Torsten-G schau dir mal die Anleitung an:
                      https://forum.iobroker.net/topic/28388/xiaomi-temp-and-humidity-monitor-2-ble-adapter/97

                      Vielen Dank hat geholfen. Ist Anfänger geeignet 🙂

                      1 Reply Last reply Reply Quote 0
                      • M
                        Martin 5 @Soulforged last edited by

                        @soulforged Hallo, ich habe das Script etwas angepasst. Bei mir läuft es nun mit 6 Thermometern (die kleinen quadratischen Kästchen).

                        const pollrate_m = 5; //Abfrageintervall in Minuten (Empfehlung alle 5 Minuten / Temperaturänderung ist langsam / Schont die Batterie)
                        const bluetooth_macs = ['A4:C1:38:15:0D:18','A4:C1:38:19:34:B7','A4:C1:38:2B:A7:0C','A4:C1:38:5E:0B:9B','A4:C1:38:6A:F8:3C','A4:C1:38:FA:CC:07'];
                        const bluetooth_str  = ['Bad','Schlafzimmer','Küche','Arbeitszimmer','Wohnzimmer','Gästezimmer'];
                        const dpID = "javascript.0.Bluetooth.XiaomiHygroTemp";
                        const s_temp  = "Temperatur";
                        const s_hygro = "Luftfeuchte";
                        const s_spann = "Spannung";
                        for(let i = 0; i < bluetooth_str.length; i++){
                            createState(dpID + "." + bluetooth_str[i] + "." + s_temp, 0,{unit: "°C", name: "Temperatur"});
                            createState(dpID + "." + bluetooth_str[i] + "." + s_hygro, 0,{unit: "%", name: "Luftfeuchte"});
                            createState(dpID + "." + bluetooth_str[i] + "." + s_spann, 0,{unit: "V", name: "Spannung"});
                        }
                        var cronstring = "*/" + pollrate_m + " * * * *";
                        
                        schedule(cronstring, async function () {
                            for(let i = 0; i < bluetooth_macs.length; i++)
                                poll_XiaomiHygroTemp(bluetooth_macs[i], i);
                                await sleep(5000);
                        });
                        
                        function poll_XiaomiHygroTemp(mac, i){
                            var bluetooth_message = '';
                            var temperatur;
                            var feuchte;
                            var spannung;
                            var spawn = require('child_process').spawn,
                            gattool = spawn('gatttool',['-b', mac , '--char-write-req', '-a', '0x0038', '-n', '0100' ,'--listen']);
                            gattool.stdout.on('data', function (data) {
                                bluetooth_message += data.toString();
                                if(bluetooth_message.length > 96) {
                                    gattool.kill(/*'SIGQUIT'*/'SIGKILL'); //gatttool in kommandozeile unsanft beenden
                                    const pos1 = bluetooth_message.indexOf("value: ") + 7;
                                    const tempStr = bluetooth_message.substring(pos1, pos1 + 15).split(" ");
                                    temperatur = Math.round(parseInt(tempStr[1]+tempStr[0], 16)/10)/10;
                                    spannung =   parseInt(tempStr[4]+tempStr[3], 16)/1000;
                                    feuchte =    parseInt(tempStr[2], 16);
                                    console.log(i + ": " + temperatur + ", " + feuchte + ", " + spannung + ", " + bluetooth_str[i]);
                                    setState(dpID + "." + bluetooth_str[i] + "." + s_temp, temperatur, true);
                                    setState(dpID + "." + bluetooth_str[i] + "." + s_hygro, feuchte, true);
                                    setState(dpID + "." + bluetooth_str[i] + "." + s_spann, spannung, true);
                        
                                /*  Antwort: Characteristic value was written successfully
                                             Notification handle = 0x0036 value: f8 07 4a d6 0b
                                    Bescheibung:
                                    f8 07 is the temperature as signed INT16 in little endian format. Divide it by 100 to get the temperature in degree Celsius. 
                                    4a is the humidity. Only integer output.
                                    d6 0b are the battery voltage in Millivolts in little endian format.
                                    Terminal:
                                    sudo hcitool lescan - Nach BLE Geräten suchen.
                                */
                                }
                            });
                         
                            gattool.stderr.on('data', function (data) {
                                //console.log('stderr: ' + data.toString());
                                log(i + ": " + bluetooth_str[i] + " hat nicht geantwortet. Warte auf nächsten Poll")
                            })
                        };
                        

                        Grüße Martin

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

                        Support us

                        ioBroker
                        Community Adapters
                        Donate
                        FAQ Cloud / IOT
                        HowTo: Node.js-Update
                        HowTo: Backup/Restore
                        Downloads
                        BLOG

                        567
                        Online

                        31.6k
                        Users

                        79.5k
                        Topics

                        1.3m
                        Posts

                        13
                        22
                        15432
                        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