Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Hardware
    4. [Anleitung] Selbstbau Wemos D1 mini und Helligkeitssensor BH1750

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    [Anleitung] Selbstbau Wemos D1 mini und Helligkeitssensor BH1750

    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      Iomega @Iomega last edited by

      @Iomega : Ich war ein wenig ungeduldig, er sendet nur alle fünf (5!!) Minuten ein Update der Sensorwerte 😠 . Konfigurierbar scheint das nicht zu sein. Bisschen langsam für einen Regensensor....
      @OpenSourceNomad : ESPhome?

      1 Reply Last reply Reply Quote 0
      • kmxak
        kmxak Most Active last edited by

        Tasmota
        TelePeriod 0 = disable telemetry messages
        1 = reset telemetry period to firmware default (TELE_PERIOD)
        10..3600 = set telemetry period in seconds (default = 300)

        https://tasmota.github.io/docs/Commands/

        I 1 Reply Last reply Reply Quote 0
        • I
          Iomega @kmxak last edited by Iomega

          @kmxak Cool! Dank Dir 😊 Funktioniert.
          Damit hätte ich um diese Uhrzeit nicht so schnell gerechnet 👏
          Ist sogar "bootfest" 😀

          1 Reply Last reply Reply Quote 0
          • A
            aueland last edited by

            Moin,
            auch wenn der Thread schon ein wenig älter ist möchte ich mal Danke für die Anleitung, Hinweise und Tipps sagen. Habe heute erfolgreich einen BH1750 an einen Wemos D1 mini mittels ESPHome angebunden, so dass er mir ganz wunderbar die LUX-Werte per MQTT liefert (mit 4 Nachkommastellen 😄 ) und ich so schön damit arbeiten kann was Dämmerungsschaltungen angeht. Falls man kein MQTT möchte, geht das ganze auch wunderbar mit dem ESPHome adapter for ioBroker.

            2021-08-30_182918.jpg

            Hier mal meine yaml für den Sensor:

            esphome:
              name: d1-lux-balkon
              platform: ESP8266
              board: esp01_1m
            
            # Enable logging
            logger:
              level: DEBUG
            
            # Enable Home Assistant API
            api:
            
            ota:
              password: "***"
            
            wifi:
              ssid: "***"
              password: "***"
            
              # Enable fallback hotspot (captive portal) in case wifi connection fails
              ap:
                ssid: "***"
                password: "***"
            
            captive_portal:
            
            # MQTT connection
            mqtt:
              broker: 100.100.0.1
              username: ***
              password: ***
              
            # Enable I²C bus
            i2c:
              sda: 0
              scl: 2
              scan: true
              
            # LUX sensor settings
            sensor:
              - platform: bh1750
                name: "Helligkeit BH1750"
                address: 0x23
                measurement_duration: 180
                update_interval: 60s
                accuracy_decimals: 4
            

            Gruß
            Sascha

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

              Ich packe den Thread nochmal aus. Hab nen Wemos D1 Mini mit einem BH1750 versehen. Leider aktualisiert sich die Lichtstärke nicht nach 60s. Nach >5 Min ist noch keine Änderung da. Folgendes Yaml ist in Verwendung :

              esphome:
                name: esp8266-lux
                platform: esp8266
                board: d1_mini
              
              # Enable logging
              logger:
              
              # Enable Home Assistant API
              api: 
                password: "xxx"
              
              ota:
                password: "xxx"
              
              wifi:
                ssid: !secret wifi_ssid
                password: !secret wifi_password
              
                # Enable fallback hotspot (captive portal) in case wifi connection fails
                ap:
                  ssid: "Esp8266-Lux Fallback Hotspot"
                  password: "xxx"
              
              captive_portal:
              
              i2c:
                sda: GPIO4
                scl: GPIO5
                scan: True
              
              sensor:
                - platform: bh1750
                  name: "Lux"
                  address: 0x23
                  #measurement_duration: 120
                  update_interval: 60s
              
              

              Nach einem Neustart des Wemos kommt 1x ein Wert, nur aktualisiert es sich nicht vernünftig. Will den Sensor für eine Beleuchtung nutzen. Hierfür brauche ich im optimalen Fall alle 2 Min. die Lichtstärke .
              Hat einer eine Idee?

              OpenSourceNomad 1 Reply Last reply Reply Quote 0
              • OpenSourceNomad
                OpenSourceNomad Most Active @smarthome2020 last edited by OpenSourceNomad

                @smarthome2020 said in [Anleitung] Selbstbau Wemos D1 mini und Helligkeitssensor BH1750:

                Hat einer eine Idee?

                Hat einer Logs?

                5fb6f5dd-4357-4a71-8af7-e90442d430e6-image.png

                Die neuste esphome version (2022.03) hat übrigens eine interessante Änderung bezüglich des bh1750:

                BH1750 dynamically calculate options #3214
                Until now for BH1750 you had to set static resolution/measurement_duration values - and so either optimize for low-light or bright scenes. Instead, dynamically calculate those options now by first doing a quick l-resolution measurement, then switch to the optimal mode/mtreg values.

                S 2 Replies Last reply Reply Quote 0
                • S
                  smarthome2020 @OpenSourceNomad last edited by

                  @opensourcenomad

                  
                  INFO Reading configuration /opt/iobroker/iobroker-data/esphome.0/esp8266-lux.yaml...
                  INFO Starting log output from esp8266-lux.local using esphome API
                  INFO Successfully connected to esp8266-lux.local
                  [21:47:09][I][app:102]: ESPHome version 2022.1.3 compiled on Mar 18 2022, 21:40:35
                  [21:47:09][C][wifi:488]: WiFi:
                  [21:47:09][C][wifi:350]:   Local MAC: Xxxx
                  [21:47:09][C][wifi:351]:   SSID: xxxx]
                  [21:47:09][C][wifi:352]:   IP Address: 192.168.xxx.xxx
                  [21:47:09][C][wifi:354]:   BSSID: xxx]
                  [21:47:09][C][wifi:355]:   Hostname: 'esp8266-lux'
                  [21:47:09][C][wifi:357]:   Signal strength: -45 dB ▂▄▆█
                  [21:47:09][C][wifi:361]:   Channel: 6
                  [21:47:09][C][wifi:362]:   Subnet: 255.255.255.0
                  [21:47:09][C][wifi:363]:   Gateway: 192.168.xxx.xxx
                  [21:47:09][C][wifi:364]:   DNS1: 192.168.xxx.xxx
                  [21:47:09][C][wifi:365]:   DNS2: 0.0.0.0
                  [21:47:09][C][logger:233]: Logger:
                  [21:47:09][C][logger:234]:   Level: DEBUG
                  [21:47:09][C][logger:235]:   Log Baud Rate: 115200
                  [21:47:09][C][logger:236]:   Hardware UART: UART0
                  [21:47:09][C][i2c.arduino:037]: I2C Bus:
                  [21:47:09][C][i2c.arduino:038]:   SDA Pin: GPIO4
                  [21:47:09][C][i2c.arduino:039]:   SCL Pin: GPIO5
                  [21:47:09][C][i2c.arduino:040]:   Frequency: 50000 Hz
                  [21:47:09][C][i2c.arduino:043]:   Recovery: bus successfully recovered
                  [21:47:09][I][i2c.arduino:053]: Results from i2c bus scan:
                  [21:47:09][I][i2c.arduino:059]: Found i2c device at address 0x23
                  [21:47:09][C][bh1750.sensor:027]: BH1750 'Lux'
                  [21:47:09][C][bh1750.sensor:027]:   Device Class: 'illuminance'
                  [21:47:09][C][bh1750.sensor:027]:   State Class: 'measurement'
                  [21:47:09][C][bh1750.sensor:027]:   Unit of Measurement: 'lx'
                  [21:47:09][C][bh1750.sensor:027]:   Accuracy Decimals: 1
                  [21:47:09][C][bh1750.sensor:028]:   Address: 0x23
                  [21:47:09][C][bh1750.sensor:048]:   Resolution: 0.5
                  [21:47:09][C][bh1750.sensor:049]:   Update Interval: 60.0s
                  [21:47:09][C][captive_portal:144]: Captive Portal:
                  [21:47:09][C][ota:082]: Over-The-Air Updates:
                  [21:47:09][C][ota:083]:   Address: esp8266-lux.local:8266
                  [21:47:09][C][ota:086]:   Using Password.
                  [21:47:09][C][api:134]: API Server:
                  [21:47:09][C][api:135]:   Address: esp8266-lux.local:6053
                  [21:47:09][C][api:139]:   Using noise encryption: NO
                  [21:47:09][C][mdns:084]: mDNS:
                  [21:47:09][C][mdns:085]:   Hostname: esp8266-lux
                  
                  

                  Hier wäre vllt was, ist aber neu seit eben, habe ich heute Nachmittag noch nicht gesehen.

                  
                  esphome.0
                  2022-03-18 21:41:30.992	error	ESPHome client 192.168.xxx.xxError: connect EISCONN 192.168.xxx.xx:6053 - Local (192.168.xxx.xx:41654)
                  
                  
                  OpenSourceNomad 1 Reply Last reply Reply Quote 0
                  • OpenSourceNomad
                    OpenSourceNomad Most Active @smarthome2020 last edited by OpenSourceNomad

                    @smarthome2020 bräuchte ein log was ein paar Minuten läuft um zu sehen was "schief" läuft.

                    Wenn er allerdings einmal (beim start) messen kann und danach nicht mehr riecht es nach einem fehlenden pull⬆⬇, in den logs sollte dann zumindest eine Zeile stehen das er nix bekommen hat oder i2c communication fehlgeschlagen hat etc.

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

                      @opensourcenomad
                      Bei dem Sensor passiert im log über Minuten nichts , während bei einem anderen Sensor im Log neue Einträge hinzu kommen.
                      Scheinbar ist der Wemos inaktiv nach dem Start?

                      Nachtrag: nach ein paar Minuten kam noch :

                      
                      [22:16:50][I][ota:102]: Boot seems successful, resetting boot loop counter.
                      
                      
                      OpenSourceNomad 1 Reply Last reply Reply Quote 0
                      • OpenSourceNomad
                        OpenSourceNomad Most Active @smarthome2020 last edited by

                        @smarthome2020 said in [Anleitung] Selbstbau Wemos D1 mini und Helligkeitssensor BH1750:

                        Bei dem Sensor passiert im log über Minuten nichts , während bei einem anderen Sensor im Log neue Einträge hinzu kommen.

                        Schalt mal die logger component auf verbose 🔍

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

                          @opensourcenomad

                          Neben dem log von eben kommt dann ergänzend nur :

                          [22:25:23][V][mdns:086]:   Services:
                          [22:25:23][V][mdns:088]:   - _esphomelib, _tcp, 6053
                          [22:25:23][V][mdns:090]:     TXT: version = 2022.1.3
                          [22:25:23][V][mdns:090]:     TXT: mac = bcff4d191c18
                          [22:25:23][V][mdns:090]:     TXT: platform = ESP8266
                          [22:25:23][V][mdns:090]:     TXT: board = d1_mini
                          [22:26:12][D][api:098]: Accepted 192.168.xxx.xx
                          [22:26:12][V][api.connection:763]: Hello from client: 'raspberrypi (192.168.xxx.xx)'
                          [22:26:12][D][api.connection:779]: raspberrypi (192.168.xxx.xx): Connected successfully
                          
                          

                          Im Hauptlog des ioBroker kommt aber immer wieder:

                          
                          ESPHome client 192.168.xxx.xx Error: connect EISCONN 192.168.xxx.xx:6053 - Local (192.168.xxx.xx:48714)
                          
                          
                          OpenSourceNomad 1 Reply Last reply Reply Quote 0
                          • OpenSourceNomad
                            OpenSourceNomad Most Active @smarthome2020 last edited by

                            @smarthome2020 said in [Anleitung] Selbstbau Wemos D1 mini und Helligkeitssensor BH1750:

                            Neben dem log von eben kommt dann ergänzend nur

                            und minütlich kommt nix bezüglich der bh1750 component? Zur not noch very_verbose versuchen.

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

                              @opensourcenomad

                              
                              [22:43:28][VV][scheduler:185]: Running interval '' with interval=60000 last_execution=6490 (now=66490)
                              [22:43:33][D][api:098]: Accepted 192.168.xxx.x
                              [22:43:33][VV][api.service:337]: on_ping_request: PingRequest {}
                              [22:43:33][VV][api.service:043]: send_ping_response: PingResponse {}
                              [22:43:33][VV][api.service:301]: on_hello_request: HelloRequest {
                                client_info: 'raspberrypi'
                              }
                              [22:43:33][V][api.connection:763]: Hello from client: 'raspberrypi (192.168.xxx.x)'
                              [22:43:33][VV][api.service:013]: send_hello_response: HelloResponse {
                                api_version_major: 1
                                api_version_minor: 6
                                server_info: 'esp8266-lux (esphome v2022.1.3)'
                              }
                              [22:43:33][VV][api.service:310]: on_connect_request: ConnectRequest {
                                password: 'xxx'
                              }
                              [22:43:33][D][api.connection:779]: raspberrypi (192.168.xxx.x): Connected successfully
                              [22:43:33][VV][api.service:019]: send_connect_response: ConnectResponse {
                                invalid_password: NO
                              }
                              [22:43:33][VV][api.service:355]: on_device_info_request: DeviceInfoRequest {}
                              [22:43:33][VV][api.service:049]: send_device_info_response: DeviceInfoResponse {
                                uses_password: YES
                                name: 'esp8266-lux'
                                mac_address: 'Xxx'
                                esphome_version: '2022.1.3'
                                compilation_time: 'Mar 18 2022, 22:41:21'
                                model: 'd1_mini'
                                has_deep_sleep: NO
                                project_name: ''
                                project_version: ''
                                webserver_port: 0
                              }
                              [22:43:33][VV][api.service:364]: on_list_entities_request: ListEntitiesRequest {}
                              [22:43:33][VV][api.service:132]: send_list_entities_sensor_response: ListEntitiesSensorResponse {
                                object_id: 'lux'
                                key: 914478924
                                name: 'Lux'
                                unique_id: 'esp8266-luxsensorlux'
                                icon: ''
                                unit_of_measurement: 'lx'
                                accuracy_decimals: 1
                                force_update: NO
                                device_class: 'illuminance'
                                state_class: STATE_CLASS_MEASUREMENT
                                legacy_last_reset_type: LAST_RESET_NONE
                                disabled_by_default: NO
                                entity_category: ENTITY_CATEGORY_NONE
                              }
                              [22:43:33][VV][api.service:373]: on_subscribe_states_request: SubscribeStatesRequest {}
                              [22:43:33][VV][api.service:055]: send_list_entities_done_response: ListEntitiesDoneResponse {}
                              [22:43:33][VV][api.service:140]: send_sensor_state_response: SensorStateResponse {
                                key: 914478924
                                state: 12.9167
                                missing_state: NO
                              }
                              [22:43:36][VV][api.service:337]: on_ping_request: PingRequest {}
                              [22:43:36][VV][api.service:043]: send_ping_response: PingResponse {}
                              [22:43:48][VV][api.service:337]: on_ping_request: PingRequest {}
                              [22:43:48][VV][api.service:043]: send_ping_response: PingResponse {}
                              
                              

                              Und :

                              
                              d1_mini
                              [22:50:04][VV][api.service:337]: on_ping_request: PingRequest {}
                              [22:50:04][VV][api.service:043]: send_ping_response: PingResponse {}
                              [22:50:09][VV][scheduler:185]: Running interval 'update' with interval=60000 last_execution=407236 (now=467236)
                              [22:50:09][VV][i2c.arduino:124]: 0x23 TX 21
                              [22:50:09][VV][i2c.arduino:148]: TX failed: not acknowledged
                              [22:50:13][VV][api.service:337]: on_ping_request: PingRequest {}
                              [22:50:13][VV][api.service:043]: send_ping_response: PingResponse {}
                              [22:50:19][VV][api.service:337]: on_ping_request: PingRequest {}
                              [22:50:19][VV][api.service:043]: send_ping_response: PingResponse {}
                              [22:50:28][VV][scheduler:185]: Running interval '' with interval=60000 last_execution=426490 (now=486492)
                              [22:50:29][VV][api.service:337]: on_ping_request: PingRequest {}
                              [22:50:29][VV][api.service:043]: send_ping_response: PingResponse {}
                              [22:50:34][VV][api.service:337]: on_ping_request: PingRequest {}
                              [22:50:34][VV][api.service:043]: send_ping_response: PingResponse {}
                              [22:50:44][VV][api.service:337]: on_ping_request: PingRequest {}
                              [22:50:44][VV][api.service:043]: send_ping_response: PingResponse {}
                              [22:50:49][VV][api.service:337]: on_ping_request: PingRequest {}
                              [22:50:49][VV][api.service:043]: send_ping_response: PingResponse {}
                              
                              
                              OpenSourceNomad 1 Reply Last reply Reply Quote 0
                              • S
                                smarthome2020 @OpenSourceNomad last edited by

                                @opensourcenomad sagte in [Anleitung] Selbstbau Wemos D1 mini und Helligkeitssensor BH1750:

                                Die neuste esphome version (2022.03) hat übrigens eine interessante Änderung bezüglich des bh1750:

                                Wie sehe ich, welche Version aufgespielt ist? Habe eben alle esphome Geräte aktualisiert… finde nur nirgends was von 2022.03..

                                D 1 Reply Last reply Reply Quote 0
                                • OpenSourceNomad
                                  OpenSourceNomad Most Active @smarthome2020 last edited by

                                  @smarthome2020 said in [Anleitung] Selbstbau Wemos D1 mini und Helligkeitssensor BH1750:

                                  [22:50:09][VV][i2c.arduino:124]: 0x23 TX 21
                                  [22:50:09][VV][i2c.arduino:148]: TX failed: not acknowledged
                                  

                                  Wie vermutet hackt es an der Kommunikation. Eventuell mal pull up am gpio aktivieren?

                                  Wie sehe ich, welche Version aufgespielt ist?

                                  Z.b. im Dashboard footer

                                  1 Reply Last reply Reply Quote 0
                                  • D
                                    Dieter_P @smarthome2020 last edited by

                                    @smarthome2020

                                    Bei mir hat sich der BH1750 nach einigen Messungen/Ergebnissen immer wieder verabschiedet (Der I2C Teilnehmer wurde nicht mehr gefunden). Die Lösung war eine Pufferung der 5V Versorgungsspannung direkt am BH1750 mit einem kleinen Elko (100uF).

                                    S 1 Reply Last reply Reply Quote 0
                                    • K
                                      klassisch Most Active last edited by klassisch

                                      Erfahrungsbericht:
                                      Betreibe 2 BH1750 Sensoren seit Jahren. Einer sitzt unter einem Dachfenster und schaut unter 25° Dachneigung nach Norden. Der andere scheut durch ein Giebelfenster (also 90° Neigung) nach Osten.
                                      SW ist noch alt und selbstgefrickelt. Müßte man heute so nicht mehr machen, aber läuft stabil.
                                      Ale meine ESPs D1 Mini bekommen vom Start weg jeweils einen 1000µF Kondensators an den 3.3V und 5V. Nicht optimiert, wahrscheinlich überdimensioniert, aber eben stabil.

                                      Nett sind dann die Jahresansichten. Ansonsten habe ich wenige praktische Anwendungen.
                                      Für meine Lichtsteuerung in den Zimmern nutze ich aqara Zigbee Helligkeitssensoren an das Fenster geklebt.

                                      Helligkeit-Dachfenster-Nord-1Jahr-2021.JPG

                                      Helligkeit-Ostfenster-1Jahr-2021.JPG

                                      Hier noch eine Mehrjahresansicht, seit Aufzeichnung mit ioBroker. Die CCU.io Daten konnte ich leider nicht konvertieren.
                                      47ae6b73-5857-4f8d-bc2c-ec81f7dbfce2-grafik.png

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

                                        @dieter_p
                                        Ich hab den Sensor an den 3,3V angeklemmt. Meinst du, dass das zu wenig ist und die Ursache sein könnte?
                                        Ansonsten muss ich einen Kondensator besorgen. Bisher lief alles ohne Kondensatoren/Widerständen stabil.

                                        OpenSourceNomad D 2 Replies Last reply Reply Quote 0
                                        • OpenSourceNomad
                                          OpenSourceNomad Most Active @smarthome2020 last edited by

                                          @smarthome2020 said in [Anleitung] Selbstbau Wemos D1 mini und Helligkeitssensor BH1750:

                                          Ich hab den Sensor an den 3,3V angeklemmt.

                                          Immer 5V wenn der Sensor (breakoutboard) das kann.

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

                                            @opensourcenomad
                                            Auf 5V angekoppelt ist der Sensor gar nicht erreichbar.
                                            Geht nur auf 3,3V.

                                            Ich muss nachher mal einen anderen BH1750 nutzen bzw. ein anderes Board. Nicht, dass Hardware daran schuld ist.

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            687
                                            Online

                                            31.7k
                                            Users

                                            79.8k
                                            Topics

                                            1.3m
                                            Posts

                                            24
                                            123
                                            29728
                                            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