Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. Pool Thermometer und Chlormesser

    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

    Pool Thermometer und Chlormesser

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

      @oxident

      Hallo oxident, könntest du mir bitte die yaml zur Verfügung stellen?
      Eine Frage noch, ist es dann möglich, die Messung unabhängig anzutriggern? Bei mir wird aktuell alle 75 Minuten über Sigfox gemessen natürlich mit Abo 😀

      O 1 Reply Last reply Reply Quote 0
      • O
        oxident @Diamand2k22 last edited by

        @diamand2k22 Hoppla, sorry. Völlig vergessen:

        substitutions:
          
          # Blueconnect
          blueriiot2_mac: '00:A0:50:24:79:67' # ANPASSEN
          blueriiot2_name_prefix: 'spa'
          blueriiot2_id_prefix: 'sp'
        
          # send true 0x01 to this service ID
          blueriiot_send_service_uuid: 'F3300001-F0A2-9B06-0C59-1BC4763B5C00'
          blueriiot_send_characteristic_uuid: 'F3300002-F0A2-9B06-0C59-1BC4763B5C00'
          
          # notification is recieved on this Service ID                  
          blueriiot_recieve_service_uuid: 'F3300001-F0A2-9B06-0C59-1BC4763B5C00'
          blueriiot_recieve_characteristic_uuid: 'F3300003-F0A2-9B06-0C59-1BC4763B5C00'
        
        esphome:
          name: "poolsensors"
          friendly_name: Pool
          on_boot:
            priority: 600
            then:
              - delay: 20s
        
        esp32:
          board: m5stack-atom # ANPASSEN
          framework:
            type: esp-idf
            version: recommended
        
        # Enable logging
        logger:
          #level: VERY_VERBOSE
          level: INFO
        
        # Enable Home Assistant API
        api:
          password: "1234"
         
        ota:
          password: "1234"
        
        wifi:
          ssid: !secret wifi_ssid
          password: !secret wifi_password
        
        web_server:
          port: 80
        
        output:
          # Countermeasure to the problem that CH552 applies 4v to GPIO0, thus reducing WiFi sensitivity.
          # Setting output_high adds a bias of 3.3v and suppresses overvoltage.
          # From: https://github.com/m5stack/M5Unified/blob/d26d2415f409b664631ff066ceeaffd6a753a4ff/src/M5Unified.cpp#L506
          - platform: gpio
            id: wifi_fix_output
            pin: GPIO0
        
        
        esp32_ble_tracker:
          scan_parameters:
            active: false
            interval: 1000ms
            window: 700ms
        
          on_ble_advertise:
            - mac_address: ${blueriiot2_mac}
              then:
                - logger.log: 
                    format: "Found Spa sensor with RSSI %d"
                    args: [ "x.get_rssi()"]
                    level: "INFO"
        
        ble_client:
          - mac_address: ${blueriiot2_mac}
            id: ble_client_${blueriiot2_id_prefix}
            on_connect: 
              then:
                - logger.log: 
                    format: "Connected to 2nd sensor"
                    level: "INFO"
                - lambda: "id(binary_sensor_${blueriiot2_id_prefix}_connected).publish_state(true);"
                - delay: 2s
                - button.press: button_${blueriiot2_id_prefix}_doreading
            on_disconnect: [lambda: "id(binary_sensor_${blueriiot2_id_prefix}_connected).publish_state(false);"]
            
        binary_sensor:
         - platform: template
           id: binary_sensor_${blueriiot2_id_prefix}_connected
           name: ${blueriiot2_name_prefix} Status
           device_class: connectivity
           entity_category: diagnostic
        
        # OPTIONAL und SPEZIFISCH für M5Atom
        # derzeit: Led bei Knopfdruck an-/ausschalten
        #  - platform: gpio # btn
        #    id: pushbutton
        #    pin:
        #      number: 39
        #      inverted: true
        #    on_click:
        #      then:
        #        - if:
        #            condition:
        #              - light.is_on: matrix_light
        #            then:
        #              - light.turn_off: matrix_light
        #            else:
        #              - light.turn_on:
        #                  id: matrix_light
        #                  effect: rainbow
        
        #light:
        #  - platform: fastled_clockless # 5x5 RGB Matrix (WS2812C)
        #    name: "5x5 Matrix"
        #    id: matrix_light
        #    pin: 27
        #    chipset: WS2812
        #    num_leds: 25
        #    color_correct: [50%, 50%, 50%] # The LED's on the Atom Matrix should not be run at full power
        #    effects:
        #      - addressable_rainbow:
        #          name: rainbow
        # ENDE spezifischer Teil M5Atom
        
        sensor:
          - platform: ble_rssi
            mac_address: ${blueriiot2_mac}
            name: "RSSI value Spa sensor"
        
          - platform: template 
            id: sensor_${blueriiot2_id_prefix}_temperature
            name: ${blueriiot2_name_prefix} Temperature
            # Optional variables:
            unit_of_measurement: "°C"
            icon: "mdi:water-percent"
            device_class: "temperature"
            state_class: "measurement"
            accuracy_decimals: 1
          
          - platform: template 
            id: sensor_${blueriiot2_id_prefix}_ph
            name: ${blueriiot2_name_prefix} PH
            # Optional variables:
            #unit_of_measurement: "°C"
            #icon: "mdi:water-percent"
            #device_class: "temperature"
            state_class: "measurement"
            accuracy_decimals: 1
        
          - platform: template 
            id: sensor_${blueriiot2_id_prefix}_orp
            name: ${blueriiot2_name_prefix} Chloor
            # Optional variables:
            #unit_of_measurement: "°C"
            #icon: "mdi:water-percent"
            device_class: "voltage"
            state_class: "measurement"
            accuracy_decimals: 1
            
          - platform: template 
            id: sensor_${blueriiot2_id_prefix}_bat
            name: ${blueriiot2_name_prefix} Battery
            # Optional variables:
            unit_of_measurement: "%"
            #icon: "mdi:water-percent"
            device_class: "battery"
            state_class: "measurement"
            accuracy_decimals: 1
            
          - platform: template 
            id: sensor_${blueriiot2_id_prefix}_salt
            name: ${blueriiot2_name_prefix} Salt
            # Optional variables:
            unit_of_measurement: "g/L"
            icon: "mdi:water-percent"
            state_class: "measurement"
            accuracy_decimals: 1
            
          - platform: template 
            id: sensor_${blueriiot2_id_prefix}_cond
            name: ${blueriiot2_name_prefix} Conductivity
            # Optional variables:
            unit_of_measurement: "mS/cm"
            #icon: "mdi:water-percent"
            state_class: "measurement"
            accuracy_decimals: 1
        
        switch:
          - platform: ble_client
            ble_client_id: ble_client_${blueriiot2_id_prefix}
            name: "${blueriiot2_name_prefix} Enable"
            id: switch_${blueriiot2_id_prefix}_enable
        
          - platform: restart
            name: "${blueriiot2_name_prefix} Restart"
            id: switch_${blueriiot2_id_prefix}_restart
        
        button:
          - platform: template
            id: button_${blueriiot2_id_prefix}_doreading
            name: ${blueriiot2_name_prefix} do reading
            internal: true
            on_press:
              then:
                - logger.log: 
                    format: "Writing to 2nd sensor..."
                    level: "INFO"
                - ble_client.ble_write:
                    id: ble_client_${blueriiot2_id_prefix}
                    service_uuid: ${blueriiot_send_service_uuid}
                    characteristic_uuid: ${blueriiot_send_characteristic_uuid}
                    # A lambda returning an std::vector<uint8_t>.
                    value: !lambda |-
                      return {0x01};
        
        text_sensor:
          - platform: ble_client
            id: ${blueriiot2_id_prefix}_reading_data
            name: ${blueriiot2_name_prefix} reading data
            internal: true
            ble_client_id: ble_client_${blueriiot2_id_prefix}
            service_uuid: ${blueriiot_recieve_service_uuid}
            characteristic_uuid: ${blueriiot_recieve_characteristic_uuid}
            notify: true
            update_interval: never
            on_notify:
              then:
               lambda: |-
                  std::string rawhex = format_hex_pretty((uint8_t *) x.c_str(), x.size()).c_str();
                  ESP_LOGD("raw_hex", "%s", rawhex.c_str());
        
                  float temperature = (float)((int16_t)(x[2]<< 8) + x[1])/100;
                  ESP_LOGD("temp", "%f", temperature);
                  id(sensor_${blueriiot2_id_prefix}_temperature).publish_state(temperature);
        
                  float raw_ph = (float)( (int16_t) (x[4]<< 8) + x[3]) ;
                  float ph = (float)( (int16_t) (2048 - raw_ph)) / 232  + 7 ; 
                  ESP_LOGD("ph", "%f", ph);
                  id(sensor_${blueriiot2_id_prefix}_ph).publish_state(ph);
        
                  float orp = (float)( (int16_t) (x[6]<< 8) + x[5]) / 3.86  - 21.57826;
                  ESP_LOGD("orp", "%f", orp);
                  id(sensor_${blueriiot2_id_prefix}_orp).publish_state(orp);
        
                  float salt = (float)( (int16_t) (x[8]<< 8) + x[7]) / 25.0;
                  ESP_LOGD("salt", "%f", salt);
                  id(sensor_${blueriiot2_id_prefix}_salt).publish_state(salt);
        
                  float cond = (float)( (int16_t) (x[10]<< 8) + x[9]) / 0.4134;
                  ESP_LOGD("cond", "%f", cond);
                  id(sensor_${blueriiot2_id_prefix}_cond).publish_state(cond);
        
                  float bat = (float)( (int16_t) x[11]);
                  ESP_LOGD("bat", "%f", bat);
                  id(sensor_${blueriiot2_id_prefix}_bat).publish_state(bat);
        
                  id(switch_${blueriiot2_id_prefix}_enable).turn_off();
        

        Du müsstest eigentlich nur die MAC-Adresse ganz oben eintragen und den Rest nach belieben anpassen. Ich habe es auf einem m5stack-Atom laufen ... bei anderen solltest Du eventuell noch die "platform" ändern.

        Ja, dann kannst Du so oft Du willst die Messung anstoßen. Einfach den "... enable" switch setzen und abwarten.

        D 1 Reply Last reply Reply Quote 0
        • D
          Diamand2k22 @oxident last edited by

          @oxident

          Super danke dir 👍🏻 hattest du nicht ein ESP32 WROOM 32 DevKitC V4 38 Pin Board?

          O 1 Reply Last reply Reply Quote 0
          • O
            oxident @Diamand2k22 last edited by

            @diamand2k22 Ja, in der Tat. Das nutze ich aber zusätzlich noch für ein paar andere Sachen (Poolabdeckung und ein paar Taster). Da war mir die YAML zu kompliziert zum Auseinanderpflücken 😉

            Habe daher die "alte" Version gepostet. Im Blueconnect-Teil hat sich aber nix verändert.

            D 1 Reply Last reply Reply Quote 0
            • D
              Diamand2k22 @oxident last edited by

              @oxident

              Danke dir, ich probiere es mal aus. Ist mein erster esp32 😀

              O 1 Reply Last reply Reply Quote 0
              • O
                oxident @Diamand2k22 last edited by

                @diamand2k22 Steile Lernkurve ... aber letzten Endes lohnt es sich und macht Spaß 🙂

                D 1 Reply Last reply Reply Quote 1
                • vowill
                  vowill @mameier1234 last edited by

                  Danke an @mameier1234 für den Blueconnect-Adapter - funktioniert einwandfrei!
                  Ein Hinweis für alle, die sich - wie ich zunächst - über den Zeitversatz bei der letzten Messung wundern: Der über den Adapter in xx.timestamp gelieferte Zeitstempel ist im GMT-Format. Für Deutschland müssen da also 1 (Winterzeit) bzw. 2 (Sommerzeit) Stunden hinzuaddiert werden. Oder man nutzt in einem Skript die Funktion:

                  // Umwandlung Zeitstempel von GMT nach ME(S)Z
                  timestamp_in_ME_S_Z = formatDate(getDateObject(getState('blueconnect.0.xxxx.ph.timestamp').val), 'TT.MM.JJJJ SS:mm:ss');

                  bzw. als Blockly:
                  Screenshot 2024-08-27 141425.jpg

                  1 Reply Last reply Reply Quote 1
                  • D
                    Diamand2k22 @oxident last edited by

                    @oxident

                    Wie hast du die Mac Adresse von dem BlueConnect herausgefunden?

                    Gruß

                    vowill O 2 Replies Last reply Reply Quote 0
                    • vowill
                      vowill @Diamand2k22 last edited by

                      @diamand2k22 Die Adresse wird vom Adapter automatisch eingetragen, wenn man sich mit Name und Passwort (aus der App) anmeldet. Voraussetzung ist, wie weiter oben geschrieben, dass man entweder einen Blueconnect Go Plus hat oder für den 'normalen' Blueconnect ein Abo bucht.

                      1 Reply Last reply Reply Quote 0
                      • O
                        oxident @Diamand2k22 last edited by

                        @diamand2k22 Ehrlich gesagt habe ich auf irgendeinem Gerät, ich glaube, es war ein Shelly, mal mitgeloggt, welche BLE-Geräte sich immer so melden 😉

                        Vielleicht kannst Du es auch auf dem Handy mit der App herausfinden.

                        D 1 Reply Last reply Reply Quote 0
                        • D
                          Diamand2k22 @oxident last edited by

                          @oxident

                          In der App stehts leider nicht drin,
                          das war meine erste Idee 😀
                          Nagut dann muss ich mal schauen wie ich das mache, notfalls über Shelly.

                          Ich hab mir jetzt übrigens auch einen M5Stack Atom besorgt, da sollte ich ja deine komplette yaml 1:1 bis auf die Mac Adresse übernehmen können oder ?

                          O 1 Reply Last reply Reply Quote 0
                          • O
                            oxident @Diamand2k22 last edited by

                            @diamand2k22 Ja, klar. Aber eigentlich sollte auch jeder andere ESP32 funktionieren. Beim M5Stack ist halt etwas doof, dass er keine Antenne hat und Bluetooth/Wifi gleichzeitig auch manchmal hakt...

                            D 1 Reply Last reply Reply Quote 0
                            • D
                              Diamand2k22 @oxident last edited by Diamand2k22

                              @oxident
                              Ich hab mir den jetzt mal aufgrund des Gehäuses gekauft, da ich bei den anderen esp32 Platinen mir immer zusätzlich was basteln musst und ich wollte den M5Atom mal ausprobieren 😀
                              Von der Reichweite sollte es gehen, der Pool ist ca. 3Meter vom m5atom entfernt .

                              O 1 Reply Last reply Reply Quote 0
                              • O
                                oxident @Diamand2k22 last edited by

                                @diamand2k22 Ja, das müsste passen. Viel Erfolg 😉

                                D 1 Reply Last reply Reply Quote 1
                                • D
                                  Diamand2k22 @oxident last edited by Diamand2k22

                                  @oxident

                                  hab's hinbekommen mit ble tracker und logging level verbose.
                                  jetzt läuft alles, danke dir nochmal!

                                  O 1 Reply Last reply Reply Quote 1
                                  • O
                                    oxident @Diamand2k22 last edited by

                                    @diamand2k22 Gerne. Aber es bleibt noch "work in progress" ... wenn Du Fehler findest, gerne Bescheid sagen!

                                    1 Reply Last reply Reply Quote 0
                                    • W
                                      willywonka89 @oxident last edited by

                                      @oxident said in Pool Thermometer und Chlormesser:

                                      @diamand2k22 Letzten Endes habe ich diesen ESP32 hier benutzt: https://www.ebay.de/itm/373835160946?mkcid=16&mkevt=1&mkrid=707-127634-2357-0&ssspo=VPl0vy4uQMu&sssrc=4429486&ssuid=l3eyvw_dRxm&var=&widget_ver=artemis&media=COPY

                                      Wichtig war die Antenne halt bei mir wegen WLAN und Bluetooth. Die regulären ESP32 konnten halt kaum eine Verbindung zum Blueconnect herstellen und hatten erst Recht Stress, wenn gleichzeitig Daten ins WLAN gesendet wurden.

                                      Der neue ESP ist deutlich leistungsfähiger und bekommt zuverlässig die Daten vom Sensor.

                                      Wie gesagt, YAML liefere ich nach, sobald ich zu Hause bin.

                                      Hi!
                                      @oxident welchen esp32 hast du genau genommen? Der ebay link funktioniert leider nicht mehr 🙁

                                      O 1 Reply Last reply Reply Quote 0
                                      • O
                                        oxident @willywonka89 last edited by

                                        @willywonka89 Also eigentlich war escein ganz normaler ESP32-WROOM mit externer Antenne.
                                        Schau mal hier: https://www.ebay.de/itm/286506582655?mkcid=16&mkevt=1&mkrid=707-127634-2357-0&ssspo=IA0Xwa_pTMi&sssrc=4429486&ssuid=l3eyvw_dRxm&var=&widget_ver=artemis&media=COPY

                                        W 1 Reply Last reply Reply Quote 0
                                        • W
                                          willywonka89 @oxident last edited by

                                          @oxident super danke für die Info! Hast du dann im Endeffekt eben so einen ESP32 WROOM genutzt oder den M5Atom?

                                          lg rainer

                                          O 1 Reply Last reply Reply Quote 0
                                          • O
                                            oxident @willywonka89 last edited by

                                            @willywonka89 Letzten Endes des WROOM ... der M5 hatte leider immer Stress gemacht, wenn ich Wifi und BLE gleichzeitig genutzt habe. Kann aber auch am schlechten (BLE-)Empfang gelegen haben.

                                            Ansonsten wäre der M5 natürlich super geeignet.

                                            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

                                            780
                                            Online

                                            31.7k
                                            Users

                                            79.9k
                                            Topics

                                            1.3m
                                            Posts

                                            allgemein
                                            30
                                            118
                                            16211
                                            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